Ticket #1949 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Cannot skip integration tests

Reported by: curtis Owned by: dscho
Priority: minor Milestone: imagej2-b8-analysis
Component: Build System Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

It seems that it is impossible to skip some of ImageJ2's integration tests, specifically the ij-uploader-hobbes test. If you pass -DskipTests it is ignored; if you pass -DskipITs it is ignored. The test always runs. We should fix the relevant POM(s) so that these flags are respected as expected.

Change History

comment:1 Changed 6 years ago by dscho

For reasons I forgot, I chose to use the invoker plugin rather than the failsafe plugin. Therefore, -DskipITs does not work, but -Dinvoker.skip=true should do, according to  https://maven.apache.org/plugins/maven-invoker-plugin/examples/skipping.html.

Maybe we want something like this in our root pom.xml?

<properties>

...
<invoker.skip>${skipITs}</invoker.skip>
...

</properties>

Hmm?

This is now implemented (and tested) in  https://github.com/imagej/imagej/compare/skip-its.

comment:2 Changed 6 years ago by curtis

Ah, sorry I missed that. I think having invoker.skip get set when skipITs is set is reasonable. Thanks!

comment:3 Changed 6 years ago by curtis

I think technically it should also be skipped when skipTests is set, and maven.skip.test is supposed to skip even compilation of the tests. To accomplish all of that, we might need to use profiles. And it's unclear when all that hackery should end...

Is it really proper for invoker stuff to live in src/it/*?

comment:4 Changed 6 years ago by curtis

Also, all of this would need to change if we ever start using maven-invoker-plugin for something *other* than ITs.

comment:5 Changed 6 years ago by dscho

I'd like to *not* skip the integration tests when skipTests is set to true: for the updater, it comes in real handy if I can skip the regular tests with skipTests if I want to run *only* the integration tests (which are slow enough to be a pain already...).

Also, while I cannot really propose a solution for excluding invoker-plugin runs other than integration tests, I am pretty certain that the only such case left the ImageJ repository recently with the launcher (which uses invoker-plugin to attach an icon to its Windows version).

comment:6 Changed 6 years ago by curtis

Fair enough. I think the fix is OK as is, then. If you want to skip compilation of the tests you just have to remember to do -Dmaven.test.skip=true -DskipTests which isn't so horrible.

comment:7 Changed 6 years ago by dscho

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.