Skip to content

ocamltest: also announce system errors as test errors#1634

Merged
gasche merged 1 commit intoocaml:trunkfrom
gasche:ocamltest-system-errors
Feb 26, 2018
Merged

ocamltest: also announce system errors as test errors#1634
gasche merged 1 commit intoocaml:trunkfrom
gasche:ocamltest-system-errors

Conversation

@gasche
Copy link
Copy Markdown
Member

@gasche gasche commented Feb 26, 2018

If you forget to commit a test file with your patch (but include it
in ocamltests), ocamltest will fail (print a message to standard error
and return a non-zero code), but until now it would not print the
standard-format "testing ... => failed" message which makes the
failure visible to the summarize.awk script.

(See #1565 (comment))

This commit ensures that such early failures still result in an
explicit test-failed message being shown in the standard way, in
addition to stderr-level error reporting.

@trefis
Copy link
Copy Markdown
Contributor

trefis commented Feb 26, 2018

While we're on that subject, I've been wondering why the "ocamltests" file was required at all. Don't all ocamltest tests require a "(* TEST ... *)" comment at the beginning of the file?

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Feb 26, 2018 via email

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Feb 26, 2018 via email

@gasche
Copy link
Copy Markdown
Member Author

gasche commented Feb 26, 2018

Not printing the message has a disadvantage: it makes it much harder for human users to find the source of the problem from the CI log output, as was demonstrated this morning. I see no advantage.

(I'm not proposing to change whichever policy you have towards stderr or exit values, just to print more information on severe failure to play nice with the existing test harness. And the change is only a couple lines.)

@lpw25
Copy link
Copy Markdown
Contributor

lpw25 commented Feb 26, 2018

Could we get it to show up in the "Unexpected errors" count rather than the failed tests count?

@gasche
Copy link
Copy Markdown
Member Author

gasche commented Feb 26, 2018

Sure, it's a one-line change, will do.

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Feb 26, 2018 via email

@gasche gasche force-pushed the ocamltest-system-errors branch from 37dca89 to 2a6872f Compare February 26, 2018 13:24
@gasche
Copy link
Copy Markdown
Member Author

gasche commented Feb 26, 2018

I changed to print unexpected error instead of failed, which has the desired behavior at summarization-time. Would some of you consider approving the change?

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Feb 26, 2018 via email

@gasche gasche force-pushed the ocamltest-system-errors branch from 2a6872f to 03e8d25 Compare February 26, 2018 13:47
@gasche gasche changed the title ocamltest: also announce system errors as test failures ocamltest: also announce system errors as test errors Feb 26, 2018
@gasche
Copy link
Copy Markdown
Member Author

gasche commented Feb 26, 2018

I changed the commit message and PR title.

If you forget to commit a test file with your patch (but include
it in ocamltests), ocamltest will fail (print a message to
standard error and return a non-zero code), but until now it would
not print the standard-format "testing ... => unexpected error"
message which makes the failure visible to the summarize.awk
script.

This commit ensures that such early failures still result in an
explicit unexpected-error message being shown in the standard way,
in addition to stderr-level error reporting.
@gasche
Copy link
Copy Markdown
Member Author

gasche commented Feb 26, 2018

Thanks @shindere for the review, @lpw25 for the nice idea to use "unexpected error", and @trefis for finding the problem in the first place. Merging.

@gasche gasche merged commit 9cb6855 into ocaml:trunk Feb 26, 2018
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants