-
Notifications
You must be signed in to change notification settings - Fork 7
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
Test fixes #173
Test fixes #173
Conversation
(The assertion violation was silently ignored in a few test cases. As it is no longer needed, remove it.)
@netdpb The conformance tests suddenly accept
There, you'll e.g. see that |
It looks like the compile error may be getting reported under full path but that the conformance-test runner may be looking for errors only in the relative paths: @@ -73,6 +75,10 @@ public final class ConformanceTestReport {
report.format(
"# %,d pass; %,d fail; %,d total; %.1f%% score%n",
passes, fails, total, 100.0 * passes / total);
+ Set<Path> unknownFilesWithErrors = difference(reportedFactsByFile.keySet(), files);
+ if (!unknownFilesWithErrors.isEmpty()) {
+ throw new RuntimeException("unknown files with errors: " + unknownFilesWithErrors);
+ }
for (Path file : files) {
ImmutableListMultimap<Long, ExpectedFact> expectedFactsInFile =
index(expectedFactsByFile.get(file), Fact::getLineNumber);
|
Ah! I return the first DetailMessage before relativizing! |
@cpovirk Thanks for tracking this down! Relativizing earlier fixes the issue. |
I think the point of that |
Output diagnostics even if they are not relative to the |
It shouldn't ever be. Maybe unexpected errors in unexpected locations (or no location) should cause the runner to throw an exception? I don't want to put those in the test report. Anyway, feel free to file a separate issue for what to do in that case. |
Filed #176. |
Co-authored-by: David P. Baker <[email protected]>
@@ -62,7 +62,7 @@ final class DetailMessage extends TestDiagnostic { | |||
*/ | |||
static DetailMessage parse(TestDiagnostic input, @Nullable Path rootDirectory) { | |||
Path file = input.getFile(); | |||
if (rootDirectory != null && !file.toString().equals("")) { | |||
if (rootDirectory != null && file.startsWith(rootDirectory)) { | |||
// Empty file strings cannot be relativized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this comment.
CI fails because of #159.
This PR fixes the test setup to actually highlight that failure.