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

Skip to content

Conversation

@reibitto
Copy link
Contributor

This is an extension in functionality of #1918.

It mainly consists of 2 things:

  • Adds the ability to do test selection on suite labels too (not just the test labels)
  • Allows passing in multiple -t arguments if you want to select 2 or more nodes in the tree.

It'll be clearer with examples:

Selects a test by label:

sbt:core-tests> testOnly *.ZIOSpec -- -t "interrupts effects on first failure"
[info] + ZIO
[info]   + foreachPar
[info]     + interrupts effects on first failure
[info] Ran 1 test in 432 ms: 1 succeeded, 0 ignored, 0 failed

Selects a suite by label:

sbt:core-tests> testOnly *.ZIOSpec -- -t "foreachPar"
[info] + ZIO
[info]   + foreachPar
[info]     + runs effects in parallel
[info]     + propagates error
[info]     + interrupts effects on first failure
[info] Ran 3 tests in 412 ms: 3 succeeded, 0 ignored, 0 failed

Selects 2 suites by label:

sbt:core-tests> testOnly *.ZIOSpec -- -t "foreachPar" -t "forkAll"
[info] + ZIO
[info]   + foreachPar
[info]     + runs effects in parallel
[info]     + propagates error
[info]     + interrupts effects on first failure
[info]   + forkAll
[info]     + happy-path
[info]     + empty input
[info]     + propagate failures
[info]     + propagates defects
[info] Ran 7 tests in 584 ms: 7 succeeded, 0 ignored, 0 failed

I find this is to be more usable than the idea that I was considering before of having a separate -s option for filtering by suite.

The basic idea here is that if the suite label matches, everything under that suite will be selected. Otherwise, if it's a test label, then select just that node (the original behavior).

Also, we added filterTestLabels last time. I no longer need it though as I created a more general filterLabels. Should we remove filterTestLabels?

@jdegoes jdegoes requested a review from adamgfraser October 22, 2019 21:07
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

This looks great! I think it is fine to leave filterTestLabels as it is a well defined method and provides functionality that is potentially useful even though no longer used for the implementation of this feature.

@adamgfraser adamgfraser merged commit 8359a6a into zio:master Oct 23, 2019
ghostdogpr pushed a commit to ghostdogpr/scalaz-zio that referenced this pull request Nov 5, 2019
Twizty pushed a commit to Twizty/zio that referenced this pull request Nov 13, 2019
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