-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add details page for individual test runs
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
Showing
11 changed files
with
259 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package api | ||
|
||
import ( | ||
"net/http" | ||
"strconv" | ||
|
||
"github.com/FACT-Finder/noflake/database" | ||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
func (a *api) GetTestResult(ctx echo.Context, testID, uploadID string) error { | ||
output, err := a.testResult(testID, uploadID) | ||
if err != nil { | ||
return err | ||
} | ||
return ctx.JSON(http.StatusOK, output) | ||
} | ||
|
||
func (a *api) testResult(testIDStr, uploadIDStr string) (TestResult, error) { | ||
testID, err := strconv.Atoi(testIDStr) | ||
if err != nil { | ||
return TestResult{}, err | ||
} | ||
|
||
uploadID, err := strconv.Atoi(uploadIDStr) | ||
if err != nil { | ||
return TestResult{}, err | ||
} | ||
|
||
testResult, err := database.GetTestResult(a.db, testID, uploadID) | ||
if err != nil { | ||
return TestResult{}, err | ||
} | ||
|
||
return TestResult{ | ||
TestId: testIDStr, | ||
UploadId: uploadIDStr, | ||
Name: testResult.Name, | ||
CommitSHA: testResult.CommitSHA, | ||
Url: testResult.URL, | ||
Success: testResult.Success, | ||
Output: testResult.Output, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{template "start" .}} | ||
<div> | ||
<a href="/ui/test/{{.Result.TestId}}/fails">Show all failures for this test</a> | ||
</div> | ||
<br /> | ||
<table> | ||
<tr><td>Name</td><td>{{.Result.Name}}</td></tr> | ||
<tr><td>Commit</td><td>{{.Result.CommitSHA}}</td></tr> | ||
<tr><td>Success</td><td>{{.Result.Success}}</td> | ||
<tr><td>Build</td><td><a href="{{.Result.Url}}">{{.Result.Url}}</a></td> | ||
</table> | ||
<br /> | ||
<div> | ||
<div><b>Output:</b></div> | ||
<pre> | ||
{{.Result.Output}} | ||
</pre> | ||
</div> | ||
{{template "end" .}} | ||
{{.Output}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.