@@ -37,34 +37,34 @@ public void testListClusters() {
37
37
}
38
38
39
39
public void testUseClusterByOne () {
40
- BuildResult result = getTestClustersRunner ("user1" ).build ();
40
+ BuildResult result = getTestClustersRunner (": user1" ).build ();
41
41
assertTaskSuccessful (result , ":user1" );
42
42
assertStartedAndStoppedOnce (result );
43
43
}
44
44
45
45
public void testUseClusterByOneWithDryRun () {
46
- BuildResult result = getTestClustersRunner ("--dry-run" , "user1" ).build ();
46
+ BuildResult result = getTestClustersRunner ("--dry-run" , ": user1" ).build ();
47
47
assertNull (result .task (":user1" ));
48
48
assertNotStarted (result );
49
49
}
50
50
51
51
public void testUseClusterByTwo () {
52
- BuildResult result = getTestClustersRunner ("user1" , "user2" ).build ();
52
+ BuildResult result = getTestClustersRunner (": user1" , ": user2" ).build ();
53
53
assertTaskSuccessful (result , ":user1" , ":user2" );
54
54
assertStartedAndStoppedOnce (result );
55
55
}
56
56
57
57
public void testUseClusterByUpToDateTask () {
58
58
// Run it once, ignoring the result and again to make sure it's considered up to date.
59
59
// Gradle randomly considers tasks without inputs and outputs as as up-to-date or success on the first run
60
- getTestClustersRunner ("upToDate1" , "upToDate2" ).build ();
61
- BuildResult result = getTestClustersRunner ("upToDate1" , "upToDate2" ).build ();
60
+ getTestClustersRunner (": upToDate1" , ": upToDate2" ).build ();
61
+ BuildResult result = getTestClustersRunner (": upToDate1" , ": upToDate2" ).build ();
62
62
assertTaskUpToDate (result , ":upToDate1" , ":upToDate2" );
63
63
assertNotStarted (result );
64
64
}
65
65
66
66
public void testUseClusterBySkippedTask () {
67
- BuildResult result = getTestClustersRunner ("skipped1" , "skipped2" ).build ();
67
+ BuildResult result = getTestClustersRunner (": skipped1" , ": skipped2" ).build ();
68
68
assertTaskSkipped (result , ":skipped1" , ":skipped2" );
69
69
assertNotStarted (result );
70
70
}
@@ -82,17 +82,44 @@ public void testUseClusterBySkippedAndWorkingTask() {
82
82
}
83
83
84
84
public void testMultiProject () {
85
- BuildResult result = GradleRunner .create ()
86
- .withProjectDir (getProjectDir ("testclusters_multiproject" ))
87
- .withArguments ("user1" , "user2" , "-s" , "-i" , "--parallel" , "-Dlocal.repo.path=" + getLocalTestRepoPath ())
88
- .withPluginClasspath ()
89
- .build ();
90
- assertTaskSuccessful (result , ":user1" , ":user2" );
85
+ BuildResult result = getTestClustersRunner (
86
+ "user1" , "user2" , "-s" , "-i" , "--parallel" , "-Dlocal.repo.path=" + getLocalTestRepoPath ()
87
+ ).build ();
88
+
89
+ assertTaskSuccessful (
90
+ result ,
91
+ ":user1" , ":user2" , ":alpha:user1" , ":alpha:user2" , ":bravo:user1" , ":bravo:user2"
92
+ );
93
+ assertStartedAndStoppedOnce (result );
94
+ assertOutputOnlyOnce (
95
+ result .getOutput (),
96
+ "Starting `node{:alpha:myTestCluster}`" ,
97
+ "Stopping `node{::myTestCluster}`"
98
+ );
99
+ assertOutputOnlyOnce (
100
+ result .getOutput (),
101
+ "Starting `node{::myTestCluster}`" ,
102
+ "Stopping `node{:bravo:myTestCluster}`"
103
+ );
104
+ }
105
+
106
+ public void testIncremental () {
107
+ BuildResult result = getTestClustersRunner ("clean" , ":user1" ).build ();
108
+ assertTaskSuccessful (result , ":user1" );
109
+ assertStartedAndStoppedOnce (result );
110
+
111
+ result = getTestClustersRunner (":user1" ).build ();
112
+ assertTaskSuccessful (result , ":user1" );
113
+ assertStartedAndStoppedOnce (result );
114
+
115
+ result = getTestClustersRunner ("clean" , ":user1" ).build ();
116
+ assertTaskSuccessful (result , ":user1" );
117
+ assertStartedAndStoppedOnce (result );
91
118
assertStartedAndStoppedOnce (result );
92
119
}
93
120
94
121
public void testUseClusterByFailingOne () {
95
- BuildResult result = getTestClustersRunner ("itAlwaysFails" ).buildAndFail ();
122
+ BuildResult result = getTestClustersRunner (": itAlwaysFails" ).buildAndFail ();
96
123
assertTaskFailed (result , ":itAlwaysFails" );
97
124
assertStartedAndStoppedOnce (result );
98
125
assertOutputContains (
@@ -103,7 +130,7 @@ public void testUseClusterByFailingOne() {
103
130
}
104
131
105
132
public void testUseClusterByFailingDependency () {
106
- BuildResult result = getTestClustersRunner ("dependsOnFailed" ).buildAndFail ();
133
+ BuildResult result = getTestClustersRunner (": dependsOnFailed" ).buildAndFail ();
107
134
assertTaskFailed (result , ":itAlwaysFails" );
108
135
assertNull (result .task (":dependsOnFailed" ));
109
136
assertStartedAndStoppedOnce (result );
@@ -115,7 +142,7 @@ public void testUseClusterByFailingDependency() {
115
142
}
116
143
117
144
public void testConfigurationLocked () {
118
- BuildResult result = getTestClustersRunner ("illegalConfigAlter" ).buildAndFail ();
145
+ BuildResult result = getTestClustersRunner (": illegalConfigAlter" ).buildAndFail ();
119
146
assertTaskFailed (result , ":illegalConfigAlter" );
120
147
assertOutputContains (
121
148
result .getOutput (),
0 commit comments