Skip to content

Commit 3c2d030

Browse files
authored
Upgrade testrunner and iDFlakies versions (#22)
* Upgrading testrunner to 1.2 and using upgraded iDFlakies 1.1.0 * Updating documentation and scripts concerning testrunner version 1.2
1 parent b4efdb0 commit 3c2d030

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ in [Automatically setting up the pom.xml for iFixFlakies](#automatically-setting
3939
<plugin>
4040
<groupId>edu.illinois.cs</groupId>
4141
<artifactId>testrunner-maven-plugin</artifactId>
42-
<version>1.0</version>
42+
<version>1.2</version>
4343
<dependencies>
4444
<dependency>
4545
<groupId>edu.illinois.cs</groupId>

pom-modify/PomFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private void addPlugin(Node plugins, Document doc) {
205205
}
206206
{
207207
Node version = doc.createElement("version");
208-
version.setTextContent("1.0");
208+
version.setTextContent("1.2");
209209
plugin.appendChild(version);
210210
}
211211
{

pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,20 @@
7070
</properties>
7171

7272
<dependencies>
73+
<dependency>
74+
<groupId>edu.illinois.cs</groupId>
75+
<artifactId>testrunner-core-plugin</artifactId>
76+
<version>1.2</version>
77+
</dependency>
7378
<dependency>
7479
<groupId>edu.illinois.cs</groupId>
7580
<artifactId>testrunner-maven-plugin</artifactId>
76-
<version>1.0</version>
81+
<version>1.2</version>
7782
</dependency>
7883
<dependency>
7984
<groupId>edu.illinois.cs</groupId>
8085
<artifactId>idflakies</artifactId>
81-
<version>1.0.1</version>
86+
<version>1.1.0</version>
8287
</dependency>
8388

8489
<dependency>

src/main/java/edu/illinois/cs/dt/tools/fixer/CleanerFixerPlugin.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import edu.illinois.cs.dt.tools.utility.OperationTime;
3030
import edu.illinois.cs.testrunner.configuration.Configuration;
3131
import edu.illinois.cs.testrunner.data.results.Result;
32+
import edu.illinois.cs.testrunner.mavenplugin.MavenProjectWrapper;
3233
import edu.illinois.cs.testrunner.mavenplugin.TestPlugin;
3334
import edu.illinois.cs.testrunner.mavenplugin.TestPluginPlugin;
3435
import edu.illinois.cs.testrunner.runner.Runner;
@@ -65,6 +66,7 @@ public class CleanerFixerPlugin extends TestPlugin {
6566
public static final String PATCH_LINE_SEP = "==========================";
6667

6768
private MavenProject project;
69+
private MavenProjectWrapper projectWrapper;
6870
private InstrumentingSmartRunner runner;
6971

7072
private List<Patch> patches;
@@ -106,9 +108,10 @@ private URLClassLoader projectClassLoader() throws DependencyResolutionRequiredE
106108
@Override
107109
public void execute(final MavenProject project) {
108110
this.project = project;
111+
this.projectWrapper = new MavenProjectWrapper(project, TestPluginPlugin.mojo().getLog());
109112

110113
final Option<Runner> runnerOption = RunnerFactory.from(project);
111-
final ErrorLogger logger = new ErrorLogger(project);
114+
final ErrorLogger logger = new ErrorLogger(projectWrapper);
112115

113116
this.patches = new ArrayList<>();
114117

@@ -122,7 +125,7 @@ public void execute(final MavenProject project) {
122125
this.runner = InstrumentingSmartRunner.fromRunner(runnerOption.get());
123126

124127
if (!Files.exists(DetectorPathManager.originalOrderPath()) && MinimizerPlugin.ORIGINAL_ORDER == null) {
125-
Files.write(DetectorPathManager.originalOrderPath(), DetectorPlugin.getOriginalOrder(project));
128+
Files.write(DetectorPathManager.originalOrderPath(), DetectorPlugin.getOriginalOrder(projectWrapper, this.runner.framework()));
126129
}
127130

128131
startTime = System.currentTimeMillis();
@@ -170,7 +173,7 @@ public void execute(final MavenProject project) {
170173
private Stream<MinimizeTestsResult> detect() throws Exception {
171174
if (!Files.exists(DetectorPathManager.detectionFile())) {
172175
if (Configuration.config().getProperty("diagnosis.run_detection", true)) {
173-
new DetectorPlugin(DetectorPathManager.detectionResults(), runner).execute(project);
176+
new DetectorPlugin(DetectorPathManager.detectionResults(), runner).execute(projectWrapper);
174177
} else if (MinimizerPlugin.FLAKY_LIST == null) {
175178
throw new NoSuchFileException("File " + DetectorPathManager.detectionFile() + " does not exist and diagnosis.run_detection is set to false");
176179
}

src/main/java/edu/illinois/cs/dt/tools/minimizer/MinimizerPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import edu.illinois.cs.dt.tools.utility.ErrorLogger;
1313
import edu.illinois.cs.testrunner.configuration.Configuration;
1414
import edu.illinois.cs.testrunner.data.results.Result;
15+
import edu.illinois.cs.testrunner.mavenplugin.MavenProjectWrapper;
1516
import edu.illinois.cs.testrunner.mavenplugin.TestPlugin;
1617
import edu.illinois.cs.testrunner.mavenplugin.TestPluginPlugin;
1718
import edu.illinois.cs.testrunner.runner.Runner;
@@ -52,6 +53,7 @@ public MinimizerPlugin(final InstrumentingSmartRunner runner) {
5253
}
5354

5455
private Stream<TestMinimizer> fromDtList(Path path, MavenProject project) {
56+
MavenProjectWrapper projectWrapper = new MavenProjectWrapper(project, TestPluginPlugin.mojo().getLog());
5557
if (FLAKY_LIST != null) {
5658
path = Paths.get(FLAKY_LIST);
5759
TestPluginPlugin.info("dt.minimizer.flaky.list argument specified: " + FLAKY_LIST);
@@ -101,7 +103,7 @@ private Stream<TestMinimizer> fromDtList(Path path, MavenProject project) {
101103
if (!Files.exists(originalOrderPath) || originalOrder.isEmpty()) {
102104
TestPluginPlugin.info("Original order file not found or is empty. Creating original-order file now at: "
103105
+ originalOrderPath);
104-
originalOrder = DetectorPlugin.getOriginalOrder(project, true);
106+
originalOrder = DetectorPlugin.getOriginalOrder(projectWrapper, this.runner.framework(), true);
105107
Files.write(originalOrderPath, originalOrder);
106108
}
107109

@@ -113,7 +115,7 @@ private Stream<TestMinimizer> fromDtList(Path path, MavenProject project) {
113115
} else if (dependentTestList == null) {
114116
// Run random class method a few times to see if test would be OD
115117
Detector detector = new RandomDetector("random", runner,
116-
DetectorPlugin.moduleRounds(new ErrorLogger(project).coordinates()),
118+
DetectorPlugin.moduleRounds(new ErrorLogger(projectWrapper).coordinates()),
117119
originalOrder);
118120
dependentTestList = new DependentTestList(detector.detect());
119121
}

0 commit comments

Comments
 (0)