Is there a way to separate long running (e.g. stress tests) out so they're not run by default in Maven 2?

后端 未结 4 1472
难免孤独
难免孤独 2021-02-02 03:12

We\'ve had an ongoing need here that I can\'t figure out how to address using the stock Maven 2 tools and documentation.

Some of our developers have some very long runni

4条回答
  •  旧巷少年郎
    2021-02-02 03:30

    Use an integration test plugin such as the Super Helpful Integration Test Thingy to separate Integration Tests (long running, systemic) from Unit Test (purists say 30 seconds max for all true unit tests to run). Make two Java packages for your unit tests versus integration tests.

    Then do not bind this plugin to a phase (the normal maven lifecycle) and only run it when it is explicitly called as a target, like so: mvn shitty:clean shitty:install shitty:test

    
      
        org.codehaus.mojo
        shitty-maven-plugin
      
    
    

    This way, your normal developers will not be impacted, and you'll be able to run integration tests on demand.

提交回复
热议问题