How to run parallel suites in maven and Testng

前端 未结 2 753
生来不讨喜
生来不讨喜 2021-01-28 15:33

I want to the Test Suites parallel from maven. my pom.xml looks like below:


        
            API_AUTOMATION

        
相关标签:
2条回答
  • 2021-01-28 16:00

    You can try with <threadCountSuites>8</threadCountSuites> property and don't set thread count property or set it as 0.

    0 讨论(0)
  • 2021-01-28 16:08

    Parallelmode "suites" is not supported by TestNG, neither via Surefire nor through any run type of TestNG.

    From the command line options in the documentation:

    -parallel    methods|tests|classes    If specified, sets the default 
                                          mechanism used to determine how 
                                          to use parallel threads when 
                                          running tests. If not set, 
                                          default mechanism is not to use 
                                          parallel threads at all. This can 
                                          be overridden in the suite 
                                          definition.
    

    The proof can be found in the v6.11 sources of XmlSuite:

    public class XmlSuite implements Serializable, Cloneable {
      /** Parallel modes */
      public enum ParallelMode {
        TESTS("tests", false), METHODS("methods"), CLASSES("classes"), INSTANCES("instances"), NONE("none", false),
    
        ...
      }
      ...
    }
    

    This applies to TestNG 6.11 and older versions.

    Consider adding the tests from multiple .xml files into one .xml file with multiple <test> nodes and define the parallelism in the testng.xml to be tests.

    0 讨论(0)
提交回复
热议问题