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

Add test coverage for test suite import prefix value #2226

Closed
wants to merge 11 commits into from

Conversation

kenzieschmoll
Copy link

@kenzieschmoll kenzieschmoll commented May 13, 2024

Addresses a TODO from flutter/flutter#143170 (comment). The matching Flutter Tools PR is here: flutter/flutter#148244

@kenzieschmoll kenzieschmoll requested a review from jakemac53 May 13, 2024 17:51
Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

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

While this could work, this is definitely not intended to be a public part of our API, it is an implementation detail only.

So from that perspective I would definitely prefer any other option. If there is no other solution that works, we could consider it.

This may not work for other integrations either - such as build_test, flutter, google3, or any other custom integrations with package:test.

pkgs/test/lib/src/runner/browser/compilers/dart2js.dart Outdated Show resolved Hide resolved
pkgs/test/test/runner/prefix_test.dart Outdated Show resolved Hide resolved
@jakemac53
Copy link
Contributor

cc @natebosch

@jakemac53
Copy link
Contributor

Note that this also currently precludes us from adding a show main or something like that, which tbh we probably should be adding currently.

@kenzieschmoll
Copy link
Author

Note that this also currently precludes us from adding a show main or something like that, which tbh we probably should be adding currently.

How so? import 'some_uri' as test show main; should still work fine.

@kenzieschmoll kenzieschmoll marked this pull request as draft May 13, 2024 18:28
@kenzieschmoll kenzieschmoll marked this pull request as ready for review May 13, 2024 20:02
@kenzieschmoll kenzieschmoll changed the title Add test coverage for test library import prefix value Add test coverage for test suite import prefix value May 13, 2024
@jakemac53
Copy link
Contributor

How so? import 'some_uri' as test show main; should still work fine.

I believe the code I saw was looking for as test; specifically (with the semicolon). I think it also probably would get broken by any changes to whitespace.

@natebosch
Copy link
Member

I left a comment on the other issue, but we don't currently restrict test suites to those under the package root, so I don't think you can guarantee that this URI will be useful.

@kenzieschmoll
Copy link
Author

kenzieschmoll commented May 13, 2024

How so? import 'some_uri' as test show main; should still work fine.

I believe the code I saw was looking for as test; specifically (with the semicolon). I think it also probably would get broken by any changes to whitespace.

We are checking the prefix directly, so this should handle whitespace changes like adding show or hide items.

@kenzieschmoll
Copy link
Author

Will hold off on landing this until the discussion at flutter/flutter#143170 (comment) is resolved.

@kenzieschmoll kenzieschmoll marked this pull request as draft May 14, 2024 23:15
@kenzieschmoll
Copy link
Author

Closing this since this PR since this issue was resolved with a different solution than using the test import prefix: #2246

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.

3 participants