Skip to content
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 Discovery on expanding nodes for closed files sometimes doesn't discover tests #4594

Closed
DanTup opened this issue Jun 19, 2023 · 1 comment
Labels
in testing Relates to test execution of Dart/Flutter tests for end users is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Jun 19, 2023

... but opening the file does:

test.discovery.mp4

When we open the file, seems like we don't get an outline (but the discovery code expects that we do):

Mon Jun 19 2023 [16:27:15 GMT+0100 (British Summer Time)] Log file started
[4:27:17 PM] [General] [Info] Returning cached results for project search
[4:27:20 PM] [Analyzer] [Info] ==> Content-Length: 426
[4:27:20 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C%3A/Dev/Test%20Projects/dartcode_4553_project2/test/test2_test.dart","languageId":"dart","version":1,"text":"import 'package:test/test.dart';\n\nvoid main() {\n  test('project2 passing test 2', () {\n    expect(1, 1);\n  });\n\n  test('project2 failing test 2', () {\n    expect(1, 2);\n  });\n}\n"}},"clientRequestTime":1687188440001}
[4:27:20 PM] [Analyzer] [Info] ==> Content-Length: 426
[4:27:20 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C%3A/Dev/Test%20Projects/dartcode_4553_project1/test/test2_test.dart","languageId":"dart","version":1,"text":"import 'package:test/test.dart';\n\nvoid main() {\n  test('project1 passing test 2', () {\n    expect(1, 1);\n  });\n\n  test('project1 failing test 2', () {\n    expect(1, 2);\n  });\n}\n"}},"clientRequestTime":1687188440585}
[4:27:21 PM] [Analyzer] [Info] ==> Content-Length: 426
[4:27:21 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C%3A/Dev/Test%20Projects/dartcode_4553_project2/test/test1_test.dart","languageId":"dart","version":1,"text":"import 'package:test/test.dart';\n\nvoid main() {\n  test('project2 passing test 1', () {\n    expect(1, 1);\n  });\n\n  test('project2 failing test 1', () {\n    expect(1, 2);\n  });\n}\n"}},"clientRequestTime":1687188441071}
[4:27:21 PM] [Analyzer] [Info] ==> Content-Length: 426
[4:27:21 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C%3A/Dev/Test%20Projects/dartcode_4553_project1/test/test1_test.dart","languageId":"dart","version":1,"text":"import 'package:test/test.dart';\n\nvoid main() {\n  test('project1 passing test 1', () {\n    expect(1, 1);\n  });\n\n  test('project1 failing test 1', () {\n    expect(1, 2);\n  });\n}\n"}},"clientRequestTime":1687188441583}
Mon Jun 19 2023 [16:27:41 GMT+0100 (British Summer Time)] Log file ended
@DanTup DanTup added is bug in testing Relates to test execution of Dart/Flutter tests for end users labels Jun 19, 2023
@DanTup DanTup added this to the v3.68.0 milestone Jun 19, 2023
@DanTup
Copy link
Member Author

DanTup commented Jun 19, 2023

Possibly related to dart-lang/sdk@0add39a?

I think in VS Code we're opening the file to try and trigger an outline if we don't already have one, but we no longer force analysis for a file when it opens, and thus don't generate outlines.

One possible fix it to send a request that would force analysis of the file after opening it (ideally something that doesn't trigger any expensive work on top of the analysis).

@DanTup DanTup closed this as completed in 814b1fb Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in testing Relates to test execution of Dart/Flutter tests for end users is bug
Projects
None yet
Development

No branches or pull requests

1 participant