Skip to content

Commit

Permalink
fix test case and report status (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
junedev committed Oct 4, 2022
1 parent 3e7ad29 commit 4d5bf3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions testrunner/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ func getStructure(lines bytes.Buffer, input_dir string, ver int) *testReport {
continue
}
if test.Status == statErr {
report.Status = statErr
// If only one test has an error, the overall report should
// only say "fail". Report level "error" is only for cases
// when we don't have any test level results.
report.Status = statFail
}
if report.Status == statPass && test.Status == statFail {
report.Status = statFail
Expand Down Expand Up @@ -337,7 +340,7 @@ type config struct {
func findAdditionalTestFlags(input_dir string) []string {
configContent, err := os.ReadFile(filepath.Join(input_dir, ".meta", "config.json"))
if err != nil {
log.Printf("failed to read config.json: %v", err)
log.Printf("warning: config.json could not be read: %v", err)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion testrunner/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestRunTests_RuntimeError(t *testing.T) {
result := string(jsonBytes)

pre := `{
"status": "error",
"status": "fail",
"version": 2,
"tests": [
{
Expand Down

0 comments on commit 4d5bf3b

Please sign in to comment.