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

Disable extension when test execution is skipped #73

Closed
bartoszmajsak opened this Issue Jul 28, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@bartoszmajsak
Member

bartoszmajsak commented Jul 28, 2017

Issue Overview

When user sets -DskipTests or -DskipITs, depending on the configuration to which smart-testing should be applied, we should disable registration of our provider.

Expected Behaviour

Smart Testing is not enabled based on the Maven flags.

Current Behaviour

Extension is registering all required dependencies even though surefire or failsafe is not executed.

@bartoszmajsak bartoszmajsak added this to the 0.0.1 milestone Jul 28, 2017

@bartoszmajsak bartoszmajsak changed the title from Disable extension to Disable extension when test execution is skipped Jul 28, 2017

@bartoszmajsak

This comment has been minimized.

Show comment
Hide comment
@bartoszmajsak

bartoszmajsak Aug 11, 2017

Member
  • we can use both skipTests and skipITs (depending if it's surefire or failsafe) as properties, just pass values true. also maven.skip.test=true (this one is global and disables everything)
  • as we disable test execution overall we won't even reach our surefire provider - we have to test it differently
    • maybe we can have a log line in SmartTestingMavenConfigurer saying something like Enabling Smart Testing {version} for [surefire, failsafe] .... (depending on for which plugin it should be applied - see below)
    • then in the test we grep the log and check if that's in there (assumption would it is not or has proper information - again see below)

There is also an additional case.

  • we can have ST enabled only for surefire or failsafe (by default for both)
  • so we can enable ST for failsafe by saying smart.testing.apply.to=failsafe and then if say -DskipITs extension shouldn't be configured for failsafe
  • when I say smart.testing.apply.to=surefire but still use -DskipITs we still should execute surefire tests with our stuff

The easiest verification is to check the log, this you can do as a first step. Once this is done we can think about better verification. The log I suggested would anyway be useful. Once this is done let's think how we can test it better.

Member

bartoszmajsak commented Aug 11, 2017

  • we can use both skipTests and skipITs (depending if it's surefire or failsafe) as properties, just pass values true. also maven.skip.test=true (this one is global and disables everything)
  • as we disable test execution overall we won't even reach our surefire provider - we have to test it differently
    • maybe we can have a log line in SmartTestingMavenConfigurer saying something like Enabling Smart Testing {version} for [surefire, failsafe] .... (depending on for which plugin it should be applied - see below)
    • then in the test we grep the log and check if that's in there (assumption would it is not or has proper information - again see below)

There is also an additional case.

  • we can have ST enabled only for surefire or failsafe (by default for both)
  • so we can enable ST for failsafe by saying smart.testing.apply.to=failsafe and then if say -DskipITs extension shouldn't be configured for failsafe
  • when I say smart.testing.apply.to=surefire but still use -DskipITs we still should execute surefire tests with our stuff

The easiest verification is to check the log, this you can do as a first step. Once this is done we can think about better verification. The log I suggested would anyway be useful. Once this is done let's think how we can test it better.

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