Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[web] Improve dev/bots/service_worker_test #106225

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

Open
ditman opened this issue Jun 17, 2022 · 0 comments
Open

[web] Improve dev/bots/service_worker_test #106225

ditman opened this issue Jun 17, 2022 · 0 comments
Labels
a: tests "flutter test", flutter_test, or one of our tests c: tech-debt Technical debt, code quality, testing, etc. P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@ditman
Copy link
Member

ditman commented Jun 17, 2022

dev/bots/service_worker_test.dart used to be a small file that focused on testing if the service worker pre-cache and cache behavior worked as expected.

However in the last few months, more features have been tested using the same infrastructure, and the file is getting a little bit too big and hard to maintain.

A couple of bits that stand out:

  • The app that is under test uses different HTML and Dart entrypoints. This is handled by copying around different index.html files, and using -t lib/some_other_main.dart with different logic. Copying the files is ad-hoc code, and would benefit from [web] Customize path of index.html and/or web directory. #78254
  • There's a lot of copy-pasta maintaining the "server that logs how many hits each requested file has" to do assertions later, there's at least 3 copies of very similar code in the file (I just had to add the 3rd!), where most of it could be reused.

Code:

Proposal

Audit all the different usages of dev/integration_tests/web/lib/*.dart, and see if there are more integration tests that build those apps... and how they do it. Maybe service_worker_test.dart is not the only file that could benefit from this refactor (?)

Tweak dev/bots/service_worker_test.dart to reuse code, start web apps more properly (after #78254), and in general, show it some TLC.

@ditman ditman added platform-web Web applications specifically c: tech-debt Technical debt, code quality, testing, etc. labels Jun 17, 2022
@yjbanov yjbanov added a: tests "flutter test", flutter_test, or one of our tests P3 Issues that are less important to the Flutter project labels Jun 30, 2022
@flutter-triage-bot flutter-triage-bot bot added team-web Owned by Web platform team triaged-web Triaged by Web platform team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests c: tech-debt Technical debt, code quality, testing, etc. P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

No branches or pull requests

2 participants