spotify / missinglink

Build time tool for detecting link problems in java projects
Apache License 2.0
144 stars 27 forks source link

Maven plugin invoker integration tests #32

Closed dflemstr closed 9 years ago

dflemstr commented 9 years ago

I saw that there was a system-tests folder that was not being used by anything in the build/CI process of this plugin. So I converted those tests into proper Maven integration tests by using the maven-invoker-plugin. Roughly what this adds is that now when you run mvn verify or mvn install in this repo, you get a part like this:

[INFO] --- maven-invoker-plugin:1.9:integration-test (integration-test) @ missinglink-maven-plugin ---
[INFO] Building: 00-test-harness/pom.xml
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Build Order:
[INFO] [INFO] 
[INFO] [INFO] parent
[INFO] [INFO] a
[INFO] [INFO] a
[INFO] [INFO] a-class-duplicate
[INFO] [INFO] b
[INFO] [INFO]                                                                         
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building parent 1-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------

... (building the test harness) ...

[INFO] [INFO] Reactor Summary:
[INFO] [INFO] 
[INFO] [INFO] parent ............................................. SUCCESS [  3.789 s]
[INFO] [INFO] a .................................................. SUCCESS [  5.555 s]
[INFO] [INFO] a .................................................. SUCCESS [  0.208 s]
[INFO] [INFO] a-class-duplicate .................................. SUCCESS [  0.152 s]
[INFO] [INFO] b .................................................. SUCCESS [  0.196 s]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 10.104 s
[INFO] [INFO] Finished at: 2015-07-19T15:55:22+02:00
[INFO] [INFO] Final Memory: 21M/211M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ..SUCCESS (14.0 s)
[INFO] Building: class-missing/pom.xml
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]                                                                         
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building class-missing 1-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------

... (building each integration test project in turn) ...

[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ..SUCCESS (19.4 s)
[INFO] 
[INFO] --- maven-invoker-plugin:1.9:verify (integration-test) @ missinglink-maven-plugin ---
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 10, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------

Interesting stuff that could be done on top of this:

dflemstr commented 9 years ago

@pettermahlen @mattnworb @spkrka

dflemstr commented 9 years ago

(Unrelated, I also converted version numbers from 0.x-SNAPSHOT to x-SNAPSHOT and removed redundant <packaging>jar</packaging> to save trees)

pettermahlen commented 9 years ago

Looks great! This is what I wanted to do with the system tests, only better. :)

I only wonder why coveralls reports decreased coverage for the CheckMojo, that doesn't make sense to me. But I'm thinking that looks like some sort of bug rather than something cause by this PR.

mattnworb commented 9 years ago

This is great - thank you @dflemstr :raised_hands: