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

chore(ct): replace find-related-test-files hook with populateDependencies #31835

Closed

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Jul 24, 2024

As discussed in the team sync, now that we have the populateDependencies plugin step, we don't need this CLI hook anymore.

I'm not sure if this refactor is worth it though, because it means we'll start calling the Plugin steps out of order (we call populateDependencies without calling setup first). Should we also run setup? If we do that, does that mean we should also run teardown()? Should we use a proper TaskRunner instance for managing that? Or should we just stick with the hook we have for simplicity over architectural conformance?

Lots of questions that i'm sure @dgozman has great answers to :D

This is a follow-up to #31727.

@Skn0tt Skn0tt self-assigned this Jul 24, 2024

This comment has been minimized.

@Skn0tt Skn0tt marked this pull request as draft July 24, 2024 08:36
@Skn0tt Skn0tt marked this pull request as ready for review July 24, 2024 08:54

This comment has been minimized.

@dgozman
Copy link
Contributor

dgozman commented Jul 24, 2024

I think we should create a task runner and call plugin.setup/teardown as usual. And we can also migrate clear-cache and dev-server to do the same.

This comment has been minimized.

@Skn0tt
Copy link
Member Author

Skn0tt commented Jul 24, 2024

Good call, did that in the new commits.

I don't see how clear-cache and dev-server are related to populateDependencies. Are you saying we should add new Plugin steps for that, just like populateDependencies?

This comment has been minimized.

@Skn0tt
Copy link
Member Author

Skn0tt commented Jul 24, 2024

The failing test run-tests.spec.ts:1153:5 › should produce output twice also fails on main and I don't see how it'd be related to this change, so I'm ignoring it.

This comment has been minimized.

@@ -138,14 138,10 @@ export class Runner {
}

async findRelatedTestFiles(mode: 'in-process' | 'out-of-process', files: string[]): Promise<FindRelatedTestFilesReport> {
const result = await this.loadAllTests(mode);
if (result.status !== 'passed' || !result.suite)
return { errors: result.errors, testFiles: [] };
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep reporting the errors.

Note that you can modify loadAllTests() to make it reusable for this case. I also noticed that we don't need lines 124-130 (old code) at all, so it can be simpler as well.

@Skn0tt
Copy link
Member Author

Skn0tt commented Jul 24, 2024

Alright, implemented that. What's your take on the questions in #31835 (comment)?

This comment has been minimized.

This comment has been minimized.

@dgozman
Copy link
Contributor

dgozman commented Jul 25, 2024

I don't see how clear-cache and dev-server are related to populateDependencies. Are you saying we should add new Plugin steps for that, just like populateDependencies?

Yeah, these would be separate calls. The idea was that we will use a single extensibility mechanism instead of two.

@Skn0tt
Copy link
Member Author

Skn0tt commented Jul 25, 2024

I've implemented that, but feel a little unsure about the runDevServer hook. In order for it to work, we need to pass over FullConfigInternal. Is Plugin part of our public API? If it is, giving it an internal config sounds like a no-go.

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

2 failed
❌ [playwright-test] › runner.spec.ts:118:5 › should ignore subprocess creation error because of SIGINT
❌ [playwright-test] › web-server.spec.ts:153:5 › should resolve cwd wrt config directory

11 flaky ⚠️ [chromium-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [chromium-library] › library/trace-viewer.spec.ts:248:1 › should have network requests
⚠️ [chromium-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [chromium-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [firefox-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:42:3 › get should work
⚠️ [firefox-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [playwright-test] › ui-mode-test-setup.spec.ts:87:5 › should show errors in config
⚠️ [chromium-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [playwright-test] › ui-mode-test-screencast.spec.ts:21:5 › should show screenshots
⚠️ [webkit-library] › library/browsercontext-fetch-happy-eyeballs.spec.ts:49:3 › get should work on request fixture
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all

29167 passed, 690 skipped
✔️✔️✔️

Merge workflow run.

@Skn0tt Skn0tt closed this Aug 20, 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.

None yet

2 participants