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

Support activation of Test2::Plugin::BailOnFail by env var #1006

Open
dboehmer opened this issue Sep 15, 2024 · 1 comment
Open

Support activation of Test2::Plugin::BailOnFail by env var #1006

dboehmer opened this issue Sep 15, 2024 · 1 comment

Comments

@dboehmer
Copy link
Contributor

dboehmer commented Sep 15, 2024

I often happen to run longer test files with some failing test statement in the middle. To see the relevant section of the test output I keep scrolling up in my terminal until I finally edit the test and add use Test2::Plugin::BailOnFail. But I don’t want to add this to any of my test file permanently, e.g. because they should run to the end in CI.

Could we instead add a feature to Test2::V0 to activate the plugin automatically if some env var like TEST2_BAILONFAIL is set to a true value?

@exodist
Copy link
Member

exodist commented Sep 15, 2024

I think a better option would be to add and env var TEST2_ENABLE_PLUGIN that takes a comma separated list of plugins to enable.

Examples:
TEST2_ENABLE_PLUGIN=BailOnFail
TEST2_ENABLE_PLUGIN=BailOnFail,UTF8,+My::Plugin

I also think this env var should be recognized by Test2::API so even if you use Test::More or another Test2 bundle other than V0 you can still use this.

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