Skip to content

Commit

Permalink
Always declare @unroll on the class level
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennestuder committed Jun 25, 2022
1 parent 088ec53 commit 013e93a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package nu.studer.teamcity.buildscan
import spock.lang.Specification
import spock.lang.Unroll

@Unroll
class BuildScanReferencesTest extends Specification {

@Unroll
def "can serialize and deserialize through custom serialization"() {
when:
def bytes = new ByteArrayOutputStream()
Expand Down Expand Up @@ -41,7 +41,6 @@ class BuildScanReferencesTest extends Specification {
!buildScanReferences.isEmpty()
}

@Unroll
def "can get number of elements"() {
expect:
buildScanReferences.size() == expectedSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import static nu.studer.teamcity.buildscan.connection.GradleEnterpriseConnection
import static nu.studer.teamcity.buildscan.connection.GradleEnterpriseConnectionConstants.INSTRUMENT_COMMAND_LINE_BUILD_STEP
import static nu.studer.teamcity.buildscan.connection.GradleEnterpriseConnectionConstants.INSTRUMENT_COMMAND_LINE_BUILD_STEP_CONFIG_PARAM

@Unroll
class GradleEnterpriseParametersProviderTest extends Specification {

BuildParametersProvider buildParametersProvider
Expand Down Expand Up @@ -98,8 +99,7 @@ class GradleEnterpriseParametersProviderTest extends Specification {
parameters.isEmpty()
}

@Unroll
def "sets #configParam config param when #descriptorParam descriptor param is set"(String descriptorParam, String configParam, String value) {
def "sets #configParam config param when #descriptorParam descriptor param is set"() {
given:
descriptorParams[descriptorParam] = value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import spock.lang.Unroll

import java.nio.file.Files

@Unroll
class ArtifactBuildScanDataStoreTest extends Specification {

ArtifactBuildScanDataStore store
Expand Down Expand Up @@ -34,7 +35,6 @@ class ArtifactBuildScanDataStoreTest extends Specification {
store.getBuildScanLinksFile(sbuild).toFile().readLines() == []
}

@Unroll
def "build scans urls are appended to build scan links file line by line"() {
given:
SBuild sbuild = Stub(SBuild)
Expand All @@ -51,7 +51,6 @@ class ArtifactBuildScanDataStoreTest extends Specification {
buildScanUrls << [['http://gradle.com/s/1'], ['http://gradle.com/s/1', 'http://gradle.com/s/2']]
}

@Unroll
def "fetched build scan references contain previously persisted build scan urls"() {
given:
SBuild sbuild = Stub(SBuild)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import static nu.studer.teamcity.buildscan.internal.DefaultBuildScanDisplayArbit
import static nu.studer.teamcity.buildscan.internal.DefaultBuildScanDisplayArbiter.MAVEN_RUNNER
import static nu.studer.teamcity.buildscan.internal.DefaultBuildScanDisplayArbiter.SIMPLE_RUNNER

@Unroll
class DefaultBuildScanDisplayArbiterTest extends Specification {

@Unroll
def "show build scan info if Gradle runner is present and build created a build scan"() {
given:
BuildScanLookup buildScanLookup = Stub(BuildScanLookup)
Expand Down Expand Up @@ -48,7 +48,6 @@ class DefaultBuildScanDisplayArbiterTest extends Specification {
[] | BuildScanReferences.of(new BuildScanReference('someScanId', 'someScanUrl')) | false
}

@Unroll
def "show build scan info if Maven runner is present and build created a build scan"() {
given:
BuildScanLookup buildScanLookup = Stub(BuildScanLookup)
Expand Down Expand Up @@ -80,7 +79,6 @@ class DefaultBuildScanDisplayArbiterTest extends Specification {
[] | BuildScanReferences.of(new BuildScanReference('someScanId', 'someScanUrl')) | false
}

@Unroll
def "show build scan info if CmdLine runner is present and build created a build scan"() {
given:
BuildScanLookup buildScanLookup = Stub(BuildScanLookup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import nu.studer.teamcity.buildscan.TeamCityConfiguration
import spock.lang.Specification
import spock.lang.Unroll

@Unroll
class LogIteratingBuildScanLookupTest extends Specification {

def "iterates build log iff configuration parameter present and set to true"() {
Expand Down Expand Up @@ -127,7 +128,6 @@ class LogIteratingBuildScanLookupTest extends Specification {
buildScans.isEmpty()
}

@Unroll
def "finds one or more build scan publications if preceded by publishing message"() {
given:
LogIteratingBuildScanLookup lookup = new LogIteratingBuildScanLookup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package nu.studer.teamcity.buildscan.internal
import spock.lang.Specification
import spock.lang.Unroll

@Unroll
class UtilTest extends Specification {

@Unroll
def "build scan url detection works for Gradle and Maven builds"() {
expect:
Util.isBuildScanUrl(text) == isScanUrl
Expand All @@ -17,7 +17,6 @@ class UtilTest extends Specification {
'> Task :help' | false
}

@Unroll
def "can get build scan ID"() {
expect:
Util.getBuildScanId(text) == buildScanId
Expand All @@ -28,7 +27,6 @@ class UtilTest extends Specification {
'[INFO] https://gradle.chess.com/s/urh37ke7awlrk' | 'urh37ke7awlrk'
}

@Unroll
def "can get build scan url"() {
expect:
Util.getBuildScanUrl(text) == buildScanUrl
Expand Down

0 comments on commit 013e93a

Please sign in to comment.