Skip to content

Commit

Permalink
Fix broken test: Use global definition "v" instead of "release-" as T…
Browse files Browse the repository at this point in the history
…agPrefix
  • Loading branch information
jwermuth committed Apr 10, 2021
1 parent 1d0a434 commit 9aff1da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class VersionConfig {
@Input
boolean useHighestVersion = false

@Input
boolean useGlobalVersion = false

@Nested
Expand Down
29 changes: 15 additions & 14 deletions src/test/groovy/pl/allegro/tech/build/axion/release/Fixtures.groovy
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
package pl.allegro.tech.build.axion.release

import pl.allegro.tech.build.axion.release.domain.scm.ScmRepository

// Centralize setup for tests. This class is reachable from 'integration' and 'test' source tree.
final class Fixtures {
// Split up Fixtures, so its easier to see what they are used for.
// Shared fixtures can be in the Fixtures class itself (there are none at the hour of writing)
final class FixtureUseGlobalVersion {
static void setupABranchWithHighTagAndBBranchWithLowTag(ScmRepository repository) {
// * (tag: release-2.0.0, high) some commit 2
// | * (HEAD -> low, tag: release-1.0.1) some commit 3
// * (tag: v2.0.0, high) some commit 2
// | * (HEAD -> low, tag: v1.0.1) some commit 3
// |/
// * (tag: release-1.0.0, start) some commit 1
// * (tag: v1.0.0, start) some commit 1
// * (master) initial commit
repository.branch('start')
repository.checkout('start')
repository.commit(['*'], 'some commit 1')
repository.tag('release-1.0.0')
repository.tag("${TagPrefixConf.fullPrefix()}1.0.0")
repository.branch('high')
repository.checkout('high')
repository.commit(['*'], 'some commit 2')
repository.tag('release-2.0.0')
repository.tag("${TagPrefixConf.fullPrefix()}2.0.0")
repository.checkout('start')
repository.branch('low')
repository.checkout('low')
repository.commit(['*'], 'some commit 3')
repository.tag('release-1.0.1')
repository.tag("${TagPrefixConf.fullPrefix()}1.0.1")
}
static void setupABranchWithHighTagsOutOfOrderAndBBranchWithLowTag(ScmRepository repository) {
// * 570120a (HEAD -> high, tag: release-2.0.0) some commit 3
// * 610acf2 (tag: release-3.0.0) some commit 2
// | * b510d23 (tag: release-1.0.1, low) some commit 3
// * 570120a (HEAD -> high, tag: v2.0.0) some commit 3
// * 610acf2 (tag: v3.0.0) some commit 2
// | * b510d23 (tag: v1.0.1, low) some commit 3
// |/
// * 0b4c7ac (tag: release-1.0.0, start) some commit 1
// * 0b4c7ac (tag: v1.0.0, start) some commit 1
// * eeae3d9 (master) initial commit
repository.branch('start')
repository.checkout('start')
repository.commit(['*'], 'some commit 1')
repository.tag('release-1.0.0')
repository.tag("${TagPrefixConf.fullPrefix()}1.0.0")
repository.branch('high')
repository.checkout('high')
repository.commit(['*'], 'some commit 2')
repository.tag('release-3.0.0')
repository.tag("${TagPrefixConf.fullPrefix()}3.0.0")
repository.commit(['*'], 'some commit 3')
repository.tag('release-2.0.0')
repository.tag("${TagPrefixConf.fullPrefix()}2.0.0")
repository.checkout('start')
repository.branch('low')
repository.checkout('low')
repository.commit(['*'], 'some commit 3')
repository.tag('release-1.0.1')
repository.tag("${TagPrefixConf.fullPrefix()}1.0.1")
}
}
}

0 comments on commit 9aff1da

Please sign in to comment.