Skip to content

Fix test reporting #4379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2018
Merged

Conversation

allanrenucci
Copy link
Contributor

When running the tests, we were reporting the number of errors
encountered instead of the number of failed tests. For neg tests, errors
are not test failures

When running the tests, we were reporting the number of errors
encountered instead of the number of failed tests. For neg tests, errors
are not test failures
@Blaisorblade
Copy link
Contributor

errorCount seems a trap, and reasonsForFailure seems to fall into it even if it's also called for neg tests by checkExpectedErrors.
Neg test shouldn't have failed, but did. Reasons: - encountered ${test.errorCount} error(s).

Copy link
Contributor

@Blaisorblade Blaisorblade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original change made sense, in fact this errorCount field was a misfeature, so I went further and removed it. @allanrenucci can you review that?

if (test.errorCount == 0) ""
else s"\n - encountered ${test.errorCount} error(s)"
if (test.failureCount == 0) ""
else s"\n - encountered ${test.failureCount} error(s)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change error(s) for failure(s)

@Blaisorblade Blaisorblade force-pushed the fix-test-reporting branch 2 times, most recently from bf99300 to 60dd039 Compare April 25, 2018 18:39
@allanrenucci
Copy link
Contributor Author

@Blaisorblade I am not sure about the second part of this PR. I think errorCount is useful is some cases. E.g. compiling a neg file and failing because the compiler emits 2 errors instead of 3.

I would suggest to open a new PR with your changes

@Blaisorblade
Copy link
Contributor

I am not sure about the second part of this PR. I think errorCount is useful is some cases. E.g. compiling a neg file and failing because the compiler emits 2 errors instead of 3.

That still works, and it's still visible in the meta test, in the output line

Wrong number of errors encountered when compiling out/VulpixMetaTests/neg/missing-error-annotation, expected: 0, actual: 2

The code you talk about is not affected — 565a2e5 changes some other behavior, the rest is purely meaning-preserving dead code elimination.

The behavior you describe involves another field named errorCount — see https://github.com/dotty-staging/dotty/blob/29f47602ee0d94bc0c89deab126dad32950316c0/compiler/test/dotty/tools/vulpix/ParallelTesting.scala#L754-L759 for the code involving the other errorCount, and see https://github.com/dotty-staging/dotty/blob/29f47602ee0d94bc0c89deab126dad32950316c0/compiler/test/dotty/tools/vulpix/ParallelTesting.scala#L714 to see where // error appears to be actually handled.

FWIW, I don't have a problem with splitting the other commits if there is plausible reason at all, this just isn't one.

@allanrenucci
Copy link
Contributor Author

FWIW, I don't have a problem with splitting the other commits if there is plausible reason at all, this just isn't one

The reason is that it's safe to merge the first commit and I'd like to experiment with the other commits to convince myself that it is indeed dead code

@Blaisorblade
Copy link
Contributor

The current PR was tested in http://dotty-ci.epfl.ch/lampepfl/dotty/4656, so merging.

@Blaisorblade Blaisorblade merged commit c8030ef into scala:master Apr 25, 2018
@Blaisorblade Blaisorblade deleted the fix-test-reporting branch April 25, 2018 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants