Skip to content

Commit

Permalink
Merge pull request #12 from tschulte/feature/jacoco
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
tschulte committed Oct 16, 2015
2 parents 7411bca + facce7b commit 462664c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ before_install:
install:
- echo "skip default gradlew assemble"
script:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew release cobertura -Dorg.ajoberstar.grgit.auth.username=${GH_TOKEN} -Dorg.ajoberstar.grgit.auth.password -Dgradle.publish.key=${GRADLE_KEY} -Dgradle.publish.secret=${GRADLE_SECRET} --info --stacktrace || ./gradlew build cobertura --info --stacktrace'
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew release -Dorg.ajoberstar.grgit.auth.username=${GH_TOKEN} -Dorg.ajoberstar.grgit.auth.password -Dgradle.publish.key=${GRADLE_KEY} -Dgradle.publish.secret=${GRADLE_SECRET} --info --stacktrace || ./gradlew build --info --stacktrace'


after_success:
- ./gradlew coveralls
- ./gradlew jacocoTestReport coveralls
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class SemanticReleaseChangeLogServiceSpec extends Specification {
given:
grgit = Grgit.open()
changeLogService = new SemanticReleaseChangeLogService(grgit, tagStrategy)
String mnemo = changeLogService.mnemo()

when:
def commits = [
Expand All @@ -191,21 +192,21 @@ class SemanticReleaseChangeLogServiceSpec extends Specification {
'feat: baz\n\nCloses #159\n\nBREAKING CHANGE: This and that', 'foo bar']
def expected = """\
<a name="2.0.0"></a>
# [2.0.0](https://github.com/tschulte/gradle-semantic-release-plugin/compare/v1.0.0...v2.0.0) (${
# [2.0.0](https://github.com/$mnemo/compare/v1.0.0...v2.0.0) (${
new java.sql.Date(System.currentTimeMillis())
})
### Bug Fixes
* no component ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #456, #789)
* no component ([1234567](https://github.com/$mnemo/commit/1234567), closes #456, #789)
* **component1:**
* foo ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #123, #124)
* bar ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567))
* **component2:** baz ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #123, #124)
* foo ([1234567](https://github.com/$mnemo/commit/1234567), closes #123, #124)
* bar ([1234567](https://github.com/$mnemo/commit/1234567))
* **component2:** baz ([1234567](https://github.com/$mnemo/commit/1234567), closes #123, #124)
### Features
* baz ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #159)
* baz ([1234567](https://github.com/$mnemo/commit/1234567), closes #159)
### BREAKING CHANGES
Expand All @@ -221,9 +222,12 @@ class SemanticReleaseChangeLogServiceSpec extends Specification {
given:
grgit = Grgit.open()
changeLogService = new SemanticReleaseChangeLogService(grgit, tagStrategy)
changeLogService.github = new MkGithub("tschulte")
changeLogService.github.repos().create(Json.createObjectBuilder().add("name", "gradle-semantic-release-plugin").build())
def coordinates = new Coordinates.Simple("tschulte/gradle-semantic-release-plugin")
String mnemo = changeLogService.mnemo()
String user = mnemo.substring(0, mnemo.indexOf("/"))
String repo = mnemo.substring(mnemo.indexOf("/") + 1)
changeLogService.github = new MkGithub(user)
changeLogService.github.repos().create(Json.createObjectBuilder().add("name", repo).build())
def coordinates = new Coordinates.Simple("$mnemo")
changeLogService.github.repos().get(coordinates).git().references().create("refs/tags/v1.0.0", "affe")
changeLogService.changeLog = { List<Commit> commits, ReleaseVersion version ->
"${'changelog'}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import nebula.test.IntegrationSpec
import spock.lang.Requires
import spock.lang.Unroll

import java.lang.management.ManagementFactory
import java.lang.management.RuntimeMXBean

/**
* Created by tobias on 7/2/15.
*/
Expand All @@ -28,6 +31,7 @@ import spock.lang.Unroll
class SemanticReleasePluginIntegrationSpec extends IntegrationSpec {

def setup() {
setupJvmArguments()
setupGit()
// create the gradle wrapper before the project is setup
setupGradleWrapper()
Expand All @@ -37,6 +41,13 @@ class SemanticReleasePluginIntegrationSpec extends IntegrationSpec {
push()
}

def setupJvmArguments() {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean()
String buildDir = new File('build').canonicalPath
jvmArguments = runtimeMxBean.getInputArguments().collect { it.replaceAll(/([:=])build/, '$1' + buildDir) }
file('gradle.properties') << "org.gradle.jvmargs=${jvmArguments.join(' ')}"
}

/**
* Gradle-git seems to have issues when run using the nebula integration spec.
* This results in the integration spec to publish to the real repo -- even creating tags there.
Expand Down Expand Up @@ -298,7 +309,7 @@ class SemanticReleasePluginIntegrationSpec extends IntegrationSpec {
}
def exitValue = process.waitFor()
if (exitValue != 0)
throw new RuntimeException("failed to execute ${command.join(' ')}")
throw new RuntimeException("failed to execute ${args.join(' ')}")
return lastLine
}

Expand Down

0 comments on commit 462664c

Please sign in to comment.