Skip to content

Comments

feat: add skip_all command#113

Open
guglielmobartelloni wants to merge 3 commits intozachallaun:mainfrom
guglielmobartelloni:feature/skip_all
Open

feat: add skip_all command#113
guglielmobartelloni wants to merge 3 commits intozachallaun:mainfrom
guglielmobartelloni:feature/skip_all

Conversation

@guglielmobartelloni
Copy link

#88 Adds the ability to skip all the tests using the "x" command.

[tag("y", :green), " ", tag("yes", :faint)],
[tag("n", :red), " ", tag("no", :faint)],
[tag("s", :yellow), " ", tag("skip", :faint)],
[tag("x", :red), " ", tag("skip all", :faint)],
Copy link
Owner

Choose a reason for hiding this comment

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

Two thoughts about this:

  1. I think this should use :yellow instead of :red, since it's more akin to s than n.
  2. While the issue tracking this feature suggested x (because I was original thinking of it as a sort of "exit"), I'm now wondering if it should use S instead.

Thoughts?

Choose a reason for hiding this comment

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

Yes, since it's a "more powerful" skip I think it's better if we use S instead of x and it's more in tune with the yellow color.

Choose a reason for hiding this comment

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

I will look like this
image

@zachallaun
Copy link
Owner

Would you be willing to take a crack at an integration test for this? You can look at test_integration/skipped_assertion_test.exs for a reference. The integration test file should be similar except that there should be a second test case that would normally update, but shouldn't because it should be skipped.

@guglielmobartelloni guglielmobartelloni force-pushed the feature/skip_all branch 2 times, most recently from 84ffc7d to b5dce74 Compare April 21, 2025 14:48
@zachallaun
Copy link
Owner

zachallaun commented Apr 21, 2025

No problem, but how can I run the test itself? I don't know how the integration tests work in this case.

New integration tests are automatically picked up and run. There's no way to run just a single integration test, but you can run only the integration tests with mix test --only integration, and you can get extra information about a specific integration test using the DBG env var. So if you name the test something like skip_all_assertions_test.exs, you could run DBG=skip_all mix test --only integration (the DBG value only needs to be a substring of the test file name).

@guglielmobartelloni
Copy link
Author

No problem, but how can I run the test itself? I don't know how the integration tests work in this case.

New integration tests are automatically picked up and run. There's no way to run just a single integration test, but you can run only the integration tests with mix test --only integration, and you can get extra information about a specific integration test using the DBG env var. So if you name the test something like skip_all_assertions_test.exs, you could run DBG=skip_all mix test --only integration (the DBG value only needs to be a substring of the test file name).

Ok, if I understood correctly besed on the skip_all behavior I only need to use a # S comment on top of the first test and the rest I assume that should be skipped. Like in the commit e1527af

@zachallaun
Copy link
Owner

Just wanted to let you know that this is still on my radar and I'm hoping to do a quick final review, merge, and release later this week. Thanks for being patient!

@guglielmobartelloni
Copy link
Author

No worries at all, totally understood that you were busy. Thanks!

@guglielmobartelloni
Copy link
Author

I integrated the commented changes with a rebase. The three commits should be updated.

guglielmobartelloni and others added 3 commits May 6, 2025 17:29
Co-authored-by: Zach Allaun <zach.allaun@gmail.com>
Co-authored-by: Zach Allaun <zach.allaun@gmail.com>
@guglielmobartelloni
Copy link
Author

Any updates?

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