Skip to content

Fixes for pending change to test runner. #2494

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

Closed

Conversation

davidmorgan
Copy link

@davidmorgan davidmorgan commented Jan 17, 2024

The test runner will start reading failure expectations in imported files; until now it only read failure expectations from the main test file.

This causes a lot of failure expectations in the co19 tests to be checked that were not previously checked. Some need fixing, which is what this PR does. Some will fail correctly, and are noted below.

compilation_t04: "part_0.dart" has no error when used like this, copy to "part_12.dart" without the failure expectation and use that.
compilation_t15: same issue as compilation_t04, use "part_12" with no failure expectation in place of "part_0".
definition_syntax_t18: "library;" is now allowed, removed the failure test.
top_level_syntax_t06: add additional error expectation for missing function body error. \

Not fixed as the failures seem correct:

compilation_t11: will start failing on the analyzer: the CFE reports the issue in part_9.dart, the analyzer does not.
definition_syntax_t04: will start failing on analyzer and CFE, library statement is in wrong order and should be ignored, but they treat it is valid and so don't report wrong library name in part.
Reserved_Words/*_t12: will start failing on the analyzer, it does not report use of reserved words in "part ;" as an error.

  • Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.

The test runner will start reading failure expectations in imported files; until now it only read failure expectations from the main test file.

This causes a lot of failure expectations in the co19 tests to be checked that were not previously checked. Some need fixing, which is what this PR does. Some will fail correctly, and are noted below.

compilation_t04: "part_0.dart" has no error when used like this, copy to "part_12.dart" without the failure expectation and use that.
compilation_t15: same issue as compilation_t04, use "part_12" with no failure expectation in place of "part_0".
definition_syntax_t18: "library;" is now allowed, removed the failure test.
top_level_syntax_t06: add additional error expectation for missing function body error.

Not fixed as the failures seem correct:

compilation_t11: will start failing on the analyzer: the CFE reports the issue in part_9.dart, the analyzer does not.
definition_syntax_t04: will start failing on analyzer and CFE, library statement is in wrong order and should be ignored, but they treat it is valid and so don't report wrong library name in part.
Reserved_Words/*_t12: will start failing on the analyzer, it does not report use of reserved words in "part <word>;" as an error.
@sgrekhov
Copy link
Contributor

@davidmorgan thank you for doing this. I uploaded your change in the test runner and checked the failing tests. The results are in the table below

Failure Issue
analyzer-asserts-linuxPass -> MissingCompileTimeError (expected Pass)  
co19/Language/Libraries_and_Scripts/Parts/compilation_t11 dart-lang/sdk#54661
co19/Language/Reference/Lexical_Rules/Reserved_Words/*_t12 dart-lang/sdk#54661
analyzer-asserts-linuxcfe...CompileTimeError -> MissingCompileTimeError (expected Pass)  
co19/Language/Libraries_and_Scripts/definition_syntax_t04 Fixed. Removed expected error on part directive
co19/Language/Libraries_and_Scripts/top_level_syntax_t06 Fixed. Added ; after function call (we are checking function call in a wrong place here)
Pass -> MissingCompileTimeError (expected Pass)  
co19/Language/Libraries_and_Scripts/Parts/compilation_t04 Fixed. part_0.dart should not expect any errors (see email thread with Erik)
co19/Language/Libraries_and_Scripts/Parts/compilation_t15 Fixed. part_0.dart should not expect any errors (see email thread with Erik)
co19/Language/Libraries_and_Scripts/Parts/syntax_t04 Fixed. part_0.dart should not expect any errors (see email thread with Erik)
co19/Language/Libraries_and_Scripts/definition_syntax_t18 Fixed. Dont expect an error here, unnamed libraries are allowed since 2.19

As a result I believe that the tests should be updated in a slightly different way. Please see #2497. It also adds missing newlines at the end of some files.

Generally, the upcoming change is very cool! It allowed to discover a couple of analyzer issues immediately. Thank you!

@davidmorgan davidmorgan marked this pull request as draft January 19, 2024 10:32
@davidmorgan
Copy link
Author

Thanks! If I understood you correctly you intend to land your PR instead of this one, sounds good to me, so I have marked it as a draft.

I made some comments on your PR and on the linked issue :)

@sgrekhov
Copy link
Contributor

Replaced by #2497. Thank you

@sgrekhov sgrekhov closed this Feb 15, 2024
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