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