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

Allow skipping on a test-by-test basis #145

Open
matthew-carroll opened this issue Jan 12, 2022 · 3 comments
Open

Allow skipping on a test-by-test basis #145

matthew-carroll opened this issue Jan 12, 2022 · 3 comments

Comments

@matthew-carroll
Copy link

matthew-carroll commented Jan 12, 2022

To deal with developers on different Mac OSes, I'm writing goldens to different directories based on the OS version:

goldens_macos_10.15/
goldens_macos_11/

With different developers generating these goldens at different times, we'd like to skip golden tests when the golden file doesn't exist yet. We don't want that triggering a failure.

We'd like an opportunity to control that skipping behavior. This could either come as a configuration to skip tests that don't have a file, or it might make more sense to provide a per-test callback where the callback is given the golden file name and then decides whether or not to run the goldens comparison.

@coreysprague
Copy link
Contributor

coreysprague commented Jan 12, 2022

Trying to get clarity on your scenario...

Is it something like this?

  • developer A adds a new testGoldens() test in file_a.dart, generates goldens on macOS_11
  • developer B adds a new testGoldens() test in file_b.dart, generates goldens on macOS_10.15

the developers merge in their changes, and you want developer A's flutter test to pass despite missing a golden file for file_b.dart, and developer B's flutter test to pass despite missing a golden file for file_a.dart?

@matthew-carroll
Copy link
Author

@coreysprague that's correct. And the same is true for CI. Failures in CI is the primary outstanding problem, but that problem is the same as what you've described.

@matthew-carroll
Copy link
Author

Also, another feature that might make sense with this change would be to only update goldens that don't exist yet. That way, I can checkout a repo and immediately generate any goldens that don't exist for my platform yet, without worrying about overwriting the existing goldens for my platform.

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

No branches or pull requests

2 participants