maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owolabi Legunsen (JIRA)" <>
Subject [jira] [Created] (SUREFIRE-1399) More stable sort when using `-Dsurefire.runOrder`
Date Sat, 29 Jul 2017 06:22:00 GMT
Owolabi Legunsen created SUREFIRE-1399:

             Summary: More stable sort when using `-Dsurefire.runOrder`
                 Key: SUREFIRE-1399
             Project: Maven Surefire
          Issue Type: New Feature
          Components: Maven Surefire Plugin
    Affects Versions: 2.20
            Reporter: Owolabi Legunsen
         Attachments: order.patch

The intent here is to check if a proposed feature that I need would
also be useful for others. The proposed feature (1) maintains a stable
sort when running tests with {{-Dsurefire.runOrder=FAILEDFIRST}}, by
using the position in a test-order file to break ties, and (2) allows
users to provide their own test-order file.

Would this feature be useful for others? Using the attached *draft*
patch, users can optionally specify a test-order file via
{{-Dsurefire.runOrderFile}} (which should eventually be properly added
as {{@Parameter}}), and the comparators that determine test order have
been changed to break ties during sorting by using the position of
tests in the test-order file (new comparators may need to be
added). Would it be worthwhile to further improve this draft patch?

To test this feature, clone Surefire, checkout SHA {{f1f4718e}}, apply the
patch, then run tests in the order specified in a file, e.g.:

$ git clone
$ cd maven
$ sed -i 's;maven-surefire-plugin</artifactId>;maven-surefire-plugin</artifactId>\n<version>2.21-SNAPSHOT</version>;'
$ cd maven-core
$ find -name "*" | grep -v AppTest | sed "sX^./src/test/java/\(.*\).java\$X0,0,dummyMethod\(\1\)X"
| tr / . | shuf >.test-order
$ mvn test -Dsurefire.runOrder=FAILEDFIRST -Dsurefire.runOrderFile=.test-order -Drat.skip

Would it be better to keep changing the code as shown in this draft
patch or to add a new prioritization order which selects from a file?

This message was sent by Atlassian JIRA

View raw message