Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from nebula-plugins/better-error-reporting
Add better error reporting
- Loading branch information
Showing
9 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/integTest/groovy/nebula/plugin/release/ReleasePluginGitStateIntegrationSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package nebula.plugin.release | ||
|
||
import org.gradle.api.plugins.JavaPlugin | ||
|
||
import static org.codehaus.groovy.runtime.StackTraceUtils.extractRootCause | ||
|
||
class ReleasePluginGitStateIntegrationSpec extends GitVersioningIntegrationSpec { | ||
|
||
@Override | ||
def setupBuild() { | ||
buildFile << """ | ||
${applyPlugin(ReleasePlugin)} | ||
${applyPlugin(JavaPlugin)} | ||
""" | ||
} | ||
|
||
def 'test that final and candidate do not work with uncommitted changes'() { | ||
setup: | ||
buildFile << "// force an uncommitted change to file" | ||
|
||
when: | ||
def finalFail = runTasksWithFailure("final") | ||
|
||
then: | ||
extractRootCause(finalFail.failure).message.contains('require all changes to be committed into Git') | ||
|
||
when: | ||
def candidateFail = runTasksWithFailure("candidate") | ||
|
||
then: | ||
extractRootCause(candidateFail.failure).message.contains('require all changes to be committed into Git') | ||
} | ||
|
||
def 'ensure plugin throws error regarding missing tag'() { | ||
setup: | ||
['v1', '1.0.0', 'v0.0'].each { git.tag.add(name: it) } | ||
|
||
when: | ||
def failure = runTasksWithFailure("devSnapshot") | ||
|
||
then: | ||
extractRootCause(failure.failure).message.contains('requires a Git tag to indicate initial version') | ||
} | ||
|
||
def 'ensure plugin does NOT throw an error when a good init tag is present'() { | ||
setup: | ||
['my-feature-branch', 'super-duper', 'v1.0', 'v0.1.0'].each { git.tag.add(name: it) } | ||
|
||
expect: | ||
runTasksSuccessfully("devSnapshot") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters