Skip to content

Commit 36f143e

Browse files
committed
Expect doubles in CSVs
1 parent c63e453 commit 36f143e

4 files changed

+68
-68
lines changed

src/test/groovy/org/gradle/profiler/AbstractProfilerIntegrationTest.groovy

+13-13
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ genrule(
159159
assert lines.get(1) == "version,Gradle ${gradleVersion}"
160160
assert lines.get(2) == "tasks,${tasks.join(", ")}"
161161
assert lines.get(3) == "value,execution"
162-
assert lines.get(4).matches("warm-up build #1,\\d+")
163-
assert lines.get(9).matches("warm-up build #6,\\d+")
164-
assert lines.get(10).matches("measured build #1,\\d+")
165-
assert lines.get(11).matches("measured build #2,\\d+")
166-
assert lines.get(19).matches("measured build #10,\\d+")
162+
assert lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
163+
assert lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?/)
164+
assert lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?/)
165+
assert lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?/)
166+
assert lines.get(19).matches(/measured build #10,\d+(?:\.\d+)?/)
167167
}
168168

169169
/**
@@ -176,10 +176,10 @@ genrule(
176176
assert lines.get(1) == "version,Gradle ${gradleVersion}"
177177
assert lines.get(2) == "tasks,${tasks.join(", ")}"
178178
assert lines.get(3) == "value,execution"
179-
assert lines.get(4).matches("warm-up build #1,\\d+")
180-
assert lines.get(5).matches("measured build #1,\\d+")
181-
assert lines.get(6).matches("measured build #2,\\d+")
182-
assert lines.get(14).matches("measured build #10,\\d+")
179+
assert lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
180+
assert lines.get(5).matches(/measured build #1,\d+(?:\.\d+)?/)
181+
assert lines.get(6).matches(/measured build #2,\d+(?:\.\d+)?/)
182+
assert lines.get(14).matches(/measured build #10,\d+(?:\.\d+)?/)
183183
}
184184

185185
/**
@@ -192,10 +192,10 @@ genrule(
192192
assert lines.get(1) == "version,Gradle ${gradleVersion}"
193193
assert lines.get(2) == "tasks,${tasks.join(", ")}"
194194
assert lines.get(3) == "value,execution"
195-
assert lines.get(4).matches("warm-up build #1,\\d+")
196-
assert lines.get(5).matches("measured build #1,\\d+")
197-
assert lines.get(6).matches("measured build #2,\\d+")
198-
assert lines.get(14).matches("measured build #10,\\d+")
195+
assert lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
196+
assert lines.get(5).matches(/measured build #1,\d+(?:\.\d+)?/)
197+
assert lines.get(6).matches(/measured build #2,\d+(?:\.\d+)?/)
198+
assert lines.get(14).matches(/measured build #10,\d+(?:\.\d+)?/)
199199
}
200200
}
201201

src/test/groovy/org/gradle/profiler/BenchmarkIntegrationTest.groovy

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class BenchmarkIntegrationTest extends AbstractProfilerIntegrationTest {
2828
lines.get(1) == "version,Gradle ${minimalSupportedGradleVersion},Gradle 5.0"
2929
lines.get(2) == "tasks,assemble,assemble"
3030
lines.get(3) == "value,execution,execution"
31-
lines.get(4).matches("warm-up build #1,\\d+,\\d+")
32-
lines.get(9).matches("warm-up build #6,\\d+,\\d+")
33-
lines.get(10).matches("measured build #1,\\d+,\\d+")
34-
lines.get(11).matches("measured build #2,\\d+,\\d+")
35-
lines.get(12).matches("measured build #3,,\\d+")
36-
lines.get(19).matches("measured build #10,,\\d+")
31+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
32+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
33+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
34+
lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
35+
lines.get(12).matches(/measured build #3,,\d+(?:\.\d+)?/)
36+
lines.get(19).matches(/measured build #10,,\d+(?:\.\d+)?/)
3737
}
3838

3939
def "recovers from failure in warm-up build while running benchmarks"() {
@@ -62,15 +62,15 @@ class BenchmarkIntegrationTest extends AbstractProfilerIntegrationTest {
6262
lines.get(1) == "version,Gradle ${minimalSupportedGradleVersion},Gradle 5.0"
6363
lines.get(2) == "tasks,assemble,assemble"
6464
lines.get(3) == "value,execution,execution"
65-
lines.get(4).matches("warm-up build #1,\\d+,\\d+")
66-
lines.get(5).matches("warm-up build #2,\\d+,\\d+")
67-
lines.get(6).matches("warm-up build #3,\\d+,\\d+")
68-
lines.get(7).matches("warm-up build #4,,\\d+")
69-
lines.get(8).matches("warm-up build #5,,\\d+")
70-
lines.get(9).matches("warm-up build #6,,\\d+")
71-
lines.get(10).matches("measured build #1,,\\d+")
72-
lines.get(11).matches("measured build #2,,\\d+")
73-
lines.get(19).matches("measured build #10,,\\d+")
65+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
66+
lines.get(5).matches(/warm-up build #2,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
67+
lines.get(6).matches(/warm-up build #3,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
68+
lines.get(7).matches(/warm-up build #4,,\d+(?:\.\d+)?/)
69+
lines.get(8).matches(/warm-up build #5,,\d+(?:\.\d+)?/)
70+
lines.get(9).matches(/warm-up build #6,,\d+(?:\.\d+)?/)
71+
lines.get(10).matches(/measured build #1,,\d+(?:\.\d+)?/)
72+
lines.get(11).matches(/measured build #2,,\d+(?:\.\d+)?/)
73+
lines.get(19).matches(/measured build #10,,\d+(?:\.\d+)?/)
7474
}
7575

7676
def "recovers from failure to run any builds while running benchmarks"() {
@@ -99,12 +99,12 @@ class BenchmarkIntegrationTest extends AbstractProfilerIntegrationTest {
9999
lines.get(1) == "version,Gradle ${minimalSupportedGradleVersion},Gradle 5.0"
100100
lines.get(2) == "tasks,assemble,assemble"
101101
lines.get(3) == "value,execution,execution"
102-
lines.get(4).matches("warm-up build #1,,\\d+")
103-
lines.get(5).matches("warm-up build #2,,\\d+")
104-
lines.get(6).matches("warm-up build #3,,\\d+")
105-
lines.get(10).matches("measured build #1,,\\d+")
106-
lines.get(11).matches("measured build #2,,\\d+")
107-
lines.get(19).matches("measured build #10,,\\d+")
102+
lines.get(4).matches(/warm-up build #1,,\d+(?:\.\d+)?/)
103+
lines.get(5).matches(/warm-up build #2,,\d+(?:\.\d+)?/)
104+
lines.get(6).matches(/warm-up build #3,,\d+(?:\.\d+)?/)
105+
lines.get(10).matches(/measured build #1,,\d+(?:\.\d+)?/)
106+
lines.get(11).matches(/measured build #2,,\d+(?:\.\d+)?/)
107+
lines.get(19).matches(/measured build #10,,\d+(?:\.\d+)?/)
108108
}
109109

110110
def brokenBuild(int successfulIterations) {

src/test/groovy/org/gradle/profiler/BuildOperationInstrumentationIntegrationTest.groovy

+12-12
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ class BuildOperationInstrumentationIntegrationTest extends AbstractProfilerInteg
4040
lines.get(1) == "version,Gradle ${gradleVersion},Gradle ${gradleVersion}"
4141
lines.get(2) == "tasks,assemble,assemble"
4242
lines.get(3) == "value,execution,task start"
43-
lines.get(4).matches("warm-up build #1,\\d+,\\d+")
44-
lines.get(9).matches("warm-up build #6,\\d+,\\d+")
45-
lines.get(10).matches("measured build #1,\\d+,\\d+")
43+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
44+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
45+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
4646

4747
and:
48-
def taskStart = lines.get(10) =~ /measured build #1,\d+,(\d+)/
48+
def taskStart = lines.get(10) =~ /measured build #1,\d+(?:\.\d+)?,(\d+(?:\.\d+)?)/
4949
taskStart.matches()
50-
Long.valueOf(taskStart[0][1]) > 0
50+
Double.valueOf(taskStart[0][1]) > 0
5151

5252
where:
5353
gradleVersion | configurationCache
@@ -98,12 +98,12 @@ class BuildOperationInstrumentationIntegrationTest extends AbstractProfilerInteg
9898
lines.get(3) == "value,execution,SnapshotTaskInputsBuildOperationType"
9999

100100
def firstWarmup = lines.get(4)
101-
def snapshottingDuration = firstWarmup =~ /warm-up build #1,\d+,(\d+)/
101+
def snapshottingDuration = firstWarmup =~ /warm-up build #1,\d+(?:\.\d+)?,(\d+(?:\.\d+)?)/
102102
snapshottingDuration.matches()
103-
Long.valueOf(snapshottingDuration[0][1]) > 0
103+
Double.valueOf(snapshottingDuration[0][1]) > 0
104104

105-
lines.get(9).matches("warm-up build #6,\\d+,\\d+")
106-
lines.get(10).matches("measured build #1,\\d+,\\d+")
105+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
106+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
107107

108108
where:
109109
[via, commandLine, scenarioConfiguration, gradleVersion, configurationCache] << [
@@ -167,9 +167,9 @@ class BuildOperationInstrumentationIntegrationTest extends AbstractProfilerInteg
167167
lines.get(1) == "version,Gradle ${gradleVersion},Gradle ${gradleVersion},Gradle ${gradleVersion}"
168168
lines.get(2) == "tasks,assemble,assemble,assemble"
169169
lines.get(3) == "value,execution,task start,SnapshotTaskInputsBuildOperationType"
170-
lines.get(4).matches("warm-up build #1,\\d+,\\d+,\\d+")
171-
lines.get(9).matches("warm-up build #6,\\d+,\\d+,\\d+")
172-
lines.get(10).matches("measured build #1,\\d+,\\d+,\\d+")
170+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
171+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
172+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
173173

174174
and:
175175
def buildLines = lines.subList(10, 19).collect { it.tokenize(',') }

src/test/groovy/org/gradle/profiler/ProfilerIntegrationTest.groovy

+22-22
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,11 @@ println "<daemon: " + gradle.services.get(org.gradle.internal.environment.Gradle
622622
lines.get(1) == "version,Gradle ${minimalSupportedGradleVersion}"
623623
lines.get(2) == "tasks,help"
624624
lines.get(3) == "value,execution"
625-
lines.get(4).matches("warm-up build #1,\\d+")
626-
lines.get(9).matches("warm-up build #6,\\d+")
627-
lines.get(10).matches("measured build #1,\\d+")
628-
lines.get(11).matches("measured build #2,\\d+")
629-
lines.get(19).matches("measured build #10,\\d+")
625+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
626+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?/)
627+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?/)
628+
lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?/)
629+
lines.get(19).matches(/measured build #10,\d+(?:\.\d+)?/)
630630
}
631631

632632
def "runs benchmarks using single scenario defined in scenario file"() {
@@ -699,8 +699,8 @@ println "<dry-run: " + gradle.startParameter.dryRun + ">"
699699
lines.get(1) == "version,Gradle 3.0,Gradle ${minimalSupportedGradleVersion},Gradle ${minimalSupportedGradleVersion}"
700700
lines.get(2) == "tasks,assemble,assemble,clean assemble"
701701
lines.get(3) == "value,execution,execution,execution"
702-
lines.get(4).matches("warm-up build #1,\\d+,\\d+,\\d+")
703-
lines.get(5).matches("measured build #1,\\d+,\\d+,\\d+")
702+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
703+
lines.get(5).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
704704
}
705705

706706
def "can define system property when benchmarking using tooling API"() {
@@ -1110,11 +1110,11 @@ help {
11101110
lines.get(1) == "version,buck,buck,buck"
11111111
lines.get(2) == "tasks,,//some/target,"
11121112
lines.get(3) == "value,execution,execution,execution"
1113-
lines.get(4).matches("warm-up build #1,\\d+,\\d+,\\d+")
1114-
lines.get(9).matches("warm-up build #6,\\d+,\\d+,\\d+")
1115-
lines.get(10).matches("measured build #1,\\d+,\\d+,\\d+")
1116-
lines.get(11).matches("measured build #2,\\d+,\\d+,\\d+")
1117-
lines.get(19).matches("measured build #10,\\d+,\\d+,\\d+")
1113+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
1114+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
1115+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
1116+
lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
1117+
lines.get(19).matches(/measured build #10,\d+(?:\.\d+)?,\d+(?:\.\d+)?,\d+(?:\.\d+)?/)
11181118
}
11191119

11201120
def "cannot profile a buck build"() {
@@ -1210,11 +1210,11 @@ buildTarget {
12101210
lines.get(1) == "version,bazel"
12111211
lines.get(2) == "tasks,some:assemble"
12121212
lines.get(3) == "value,execution"
1213-
lines.get(4).matches("warm-up build #1,\\d+")
1214-
lines.get(9).matches("warm-up build #6,\\d+")
1215-
lines.get(10).matches("measured build #1,\\d+")
1216-
lines.get(11).matches("measured build #2,\\d+")
1217-
lines.get(19).matches("measured build #10,\\d+")
1213+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
1214+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?/)
1215+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?/)
1216+
lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?/)
1217+
lines.get(19).matches(/measured build #10,\d+(?:\.\d+)?/)
12181218
}
12191219

12201220
def "cannot profile a bazel build"() {
@@ -1305,11 +1305,11 @@ buildGoal {
13051305
lines.get(1) == "version,maven"
13061306
lines.get(2) == "tasks,-v"
13071307
lines.get(3) == "value,execution"
1308-
lines.get(4).matches("warm-up build #1,\\d+")
1309-
lines.get(9).matches("warm-up build #6,\\d+")
1310-
lines.get(10).matches("measured build #1,\\d+")
1311-
lines.get(11).matches("measured build #2,\\d+")
1312-
lines.get(19).matches("measured build #10,\\d+")
1308+
lines.get(4).matches(/warm-up build #1,\d+(?:\.\d+)?/)
1309+
lines.get(9).matches(/warm-up build #6,\d+(?:\.\d+)?/)
1310+
lines.get(10).matches(/measured build #1,\d+(?:\.\d+)?/)
1311+
lines.get(11).matches(/measured build #2,\d+(?:\.\d+)?/)
1312+
lines.get(19).matches(/measured build #10,\d+(?:\.\d+)?/)
13131313
}
13141314

13151315
def "clears build cache when asked"() {

0 commit comments

Comments
 (0)