Exclude specific tests from being run in parallel in jUnit

后端 未结 3 1145
不思量自难忘°
不思量自难忘° 2020-12-31 07:45

I recently stumbled upon a simple way to parallelize the execute of tests via jUnit by specifying the following in a java project\'s pom.xml file:



        
3条回答
  •  渐次进展
    2020-12-31 08:07

    Exclude those 2 tests in the original test phrase and then create a new execution with those 2 classes running in single thread? :)

    
        org.apache.maven.plugins
        maven-surefire-plugin
        
            
                path/to/your/class/badtestclass1.java
                path/to/your/class/badtestclass2.java
            
            classes
        
    
        
            
                single-thread-test
                test
                
                    test
                
                
                    
                        path/to/your/class/badtestclass1.java
                        path/to/your/class/badtestclass2.java
                    
                    1
                
            
        
      
    

提交回复
热议问题