Skip to content

Reduce the overridding surface area for integration test setup#1989

Merged
bidetofevil merged 2 commits intomainfrom
hho/reduce-test-setup-override
Mar 6, 2025
Merged

Reduce the overridding surface area for integration test setup#1989
bidetofevil merged 2 commits intomainfrom
hho/reduce-test-setup-override

Conversation

@bidetofevil
Copy link
Contributor

@bidetofevil bidetofevil commented Mar 5, 2025

Goal

Simplify how you can use blocking executors for background and priority workers. This allows us to then not have to create new instances of EmbFakeLogger for integration tests, thus allowing us to just set the internal error exclusion when instantiating an instance of that for the integration test rule. In turn, this allows us to get rid of the poorly named/documented factory method for FakeEmbLogger.

@bidetofevil bidetofevil marked this pull request as ready for review March 5, 2025 22:28
@bidetofevil bidetofevil requested a review from a team as a code owner March 5, 2025 22:28
@bidetofevil bidetofevil force-pushed the hho/reduce-test-setup-override branch 3 times, most recently from b4c6263 to 4c61286 Compare March 6, 2025 00:09
@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 95372a0 to 4fdf3f9 Compare March 6, 2025 00:09
Copy link
Member

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments about fake workers no longer being required in some existing tests

Comment on lines +40 to +42
EmbraceSetupInterface(workerToFake = Worker.Background.LogMessageWorker).also {
executor = it.getFakedWorkerExecutor()
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced this is required any more given the extensive refactors to the integration test framework that mean it's possible to block & wait until requests are delivered. I'd suggest deleting this and flushLogs entirely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me try that. That would be great, even if we have to wait for the batch time to elapse, as that's more real.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup! This seems to be the case. I had to make additional changes because it seems like faking the worker changes the order of the internal error that gets logged, so the tests were failing because it didn't find the right one.

I'll make a bigger change after merging this that makes it clear what I'm doing.

Comment on lines +31 to +33
EmbraceSetupInterface(workerToFake = Worker.Background.LogMessageWorker).also {
executor = it.getFakedWorkerExecutor()
}
Copy link
Member

Choose a reason for hiding this comment

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

Similar feedback to FlutterInternalInterfaceTest - I don't think fake workers are required anymore here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be dope if true lol.

)
EmbraceSetupInterface(workerToFake = Worker.Background.LogMessageWorker).also {
executor = it.getFakedWorkerExecutor()
}
Copy link
Member

Choose a reason for hiding this comment

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

Similar feedback to FlutterInternalInterfaceTest - I don't think this is required anymore if we refactor the assertions a little bit

@bidetofevil bidetofevil changed the base branch from hho/abandon-startup-onbackground to graphite-base/1989 March 6, 2025 16:50
@bidetofevil bidetofevil force-pushed the hho/reduce-test-setup-override branch from 4c61286 to 7547b7c Compare March 6, 2025 17:06
@bidetofevil bidetofevil changed the base branch from graphite-base/1989 to main March 6, 2025 17:07
@bidetofevil bidetofevil force-pushed the hho/reduce-test-setup-override branch from 7547b7c to e39b3e6 Compare March 6, 2025 17:07
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Contributor Author

bidetofevil commented Mar 6, 2025

Merge activity

  • Mar 6, 6:19 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Mar 6, 6:19 PM EST: A user merged this pull request with Graphite.

@bidetofevil bidetofevil merged commit ea995b9 into main Mar 6, 2025
11 checks passed
@bidetofevil bidetofevil deleted the hho/reduce-test-setup-override branch March 6, 2025 23:19
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