From 96bd2c9efe1d0530f9d2f0e46bd50cadbfaa9362 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 23 Oct 2018 15:31:27 +0200 Subject: [PATCH] Added tests --- .../src/main/asciidoc/spring-cloud-release-tools.adoc | 1 + .../internal/post/PostReleaseActionsTests.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-release-tools.adoc b/docs/src/main/asciidoc/spring-cloud-release-tools.adoc index 30f9ef90..59746edd 100644 --- a/docs/src/main/asciidoc/spring-cloud-release-tools.adoc +++ b/docs/src/main/asciidoc/spring-cloud-release-tools.adoc @@ -279,6 +279,7 @@ The following properties are used for both meta release and a release of an indi - `releaser.git.spring-project-branch` - Branch to check out for the documentation project. Defaults to `gh-pages`. - `releaser.git.test-samples-project-url` - URL to the test samples to be checked against the given release train. Defaults to `https://github.com/spring-cloud/spring-cloud-core-tests`. - `releaser.git.test-samples-project-branch` - Branch to check out for test samples. Defaults to `master`. +- `releaser.git.run-updated-samples` - If `true` then will update samples and run the the build. Defaults to `true`. - `releaser.git.update-documentation-repo` - If `true` then will update documentation repository with the `current` URL. Defaults to `true`. - `releaser.git.update-spring-guides` - If `true` then will update Spring Guides with the current release train. Defaults to `true`. - `releaser.git.update-spring-project` - If `true` then will update Spring Project page with the current release train values. Defaults to `true`. diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/post/PostReleaseActionsTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/post/PostReleaseActionsTests.java index efb637f0..af6be01c 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/post/PostReleaseActionsTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/post/PostReleaseActionsTests.java @@ -49,6 +49,17 @@ public class PostReleaseActionsTests { FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder); } + @Test + public void should_do_nothing_when_the_switch_is_off() { + this.properties.getGit().setRunUpdatedSamples(false); + PostReleaseActions actions = new PostReleaseActions(this.projectGitHandler, + this.updater, this.builder, this.properties); + + actions.runUpdatedTests(currentGa()); + + BDDAssertions.then(clonedTestSamples).isNull(); + } + @Test public void should_update_project_and_run_tests() { this.properties.getGit().setTestSamplesProjectUrl(tmpFile("spring-cloud-core-tests/").getAbsolutePath() + "/");