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

Introduce a way to "print out" a ExUnit test plan #14389

Closed
whatyouhide opened this issue Apr 2, 2025 · 6 comments
Closed

Introduce a way to "print out" a ExUnit test plan #14389

whatyouhide opened this issue Apr 2, 2025 · 6 comments

Comments

@whatyouhide
Copy link
Member

whatyouhide commented Apr 2, 2025

I've had multiple occasions recently where I needed to know which tests ExUnit would run given some configuration. For example, if I run

MIX_TEST_PARTITION=5 mix test --partitions 6

or

mix test --only flaky

There's a "trick" to use which is to add --trace and go through the list of tests that run, but that's not very tool friendly.

I’m thinking we might introduce an API for printing out a test plan. It could be just that, without running the tests:

mix test.plan [flags]

or just printing out the plan before starting the suite:

mix test --print-plan [flags]

Thoughts?

@josevalim
Copy link
Member

What about --dry-run? That effectively calls the formatters and what not, but does not effectively run the tests? It is as if all setup blocks and tests were a no-op?

@whatyouhide
Copy link
Member Author

Mh that could be an option, but why would you want to do that other than for printing out the plan? In that case, why not call the option something more direct? (Just trying to understand, I think --dry-run would work too)

@josevalim
Copy link
Member

Basically because --dry-run would compose with all other options. with --only, --seed, file filters, and whatever have you. Otherwise we would have to reimplement all option handling in a new task.

@whatyouhide
Copy link
Member Author

@josevalim good point about the new task, scratch that. Also, I think it would be nice with --dry-run that it would work with custom formatters to print out the tests in any way a tool might want (without running them).

@josevalim
Copy link
Member

@whatyouhide please open up a new issue with the description of what we want to go with (without the discussion) so others can contribute?

@whatyouhide
Copy link
Member Author

Closing in favor of #14393.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants