diff --git a/buildSrc/src/main/groovy/net/corda/testing/Properties.java b/buildSrc/src/main/groovy/net/corda/testing/Properties.java index cb1e6ca628..b8813e787f 100644 --- a/buildSrc/src/main/groovy/net/corda/testing/Properties.java +++ b/buildSrc/src/main/groovy/net/corda/testing/Properties.java @@ -84,4 +84,8 @@ public class Properties { static String getTargetGitBranch() { return getProperty("git.target.branch").replace('/', '-'); } + + static boolean getPublishJunitTests() { + return ! getProperty("publish.junit").isEmpty(); + } } diff --git a/buildSrc/src/main/groovy/net/corda/testing/TestDurationArtifacts.java b/buildSrc/src/main/groovy/net/corda/testing/TestDurationArtifacts.java index 103bae6939..c29809c4e9 100644 --- a/buildSrc/src/main/groovy/net/corda/testing/TestDurationArtifacts.java +++ b/buildSrc/src/main/groovy/net/corda/testing/TestDurationArtifacts.java @@ -204,11 +204,12 @@ public class TestDurationArtifacts { */ @NotNull public static Task createZipTask(@NotNull final Project project, @NotNull final String name, @Nullable final Task task) { - final Task zipJunitTask = createJunitZipTask(project, name); final Task csvTask = createCsvTask(project, name); - csvTask.dependsOn(zipJunitTask); - // For debugging - can be removed - this simply gathers junit xml and uploads them to artifactory - // so that we can inspect them. + + if (Properties.getPublishJunitTests()) { + final Task zipJunitTask = createJunitZipTask(project, name); + csvTask.dependsOn(zipJunitTask); + } if (task != null) { csvTask.dependsOn(task); diff --git a/buildSrc/src/test/groovy/net/corda/testing/PropertiesTest.java b/buildSrc/src/test/groovy/net/corda/testing/PropertiesTest.java index 3d22c320b1..599c5f8d4a 100644 --- a/buildSrc/src/test/groovy/net/corda/testing/PropertiesTest.java +++ b/buildSrc/src/test/groovy/net/corda/testing/PropertiesTest.java @@ -53,4 +53,11 @@ public class PropertiesTest { public void getTargetGitBranch() { Assert.assertEquals(targetBranch, Properties.getTargetGitBranch()); } + + @Test + public void getPublishJunitTests() { + Assert.assertFalse(Properties.getPublishJunitTests()); + System.setProperty("publish.junit", "true"); + Assert.assertTrue(Properties.getPublishJunitTests()); + } } \ No newline at end of file