TM-80 Do not publish the junit zip file to Artifactory automatically. (#5667)

This functionality was only in place for debugging purposes, to switch
it back on, set -Dpublish.junit=true in the Jenkinsfile.
This commit is contained in:
Barry 2019-11-04 17:37:43 +00:00 committed by Stefano Franz
parent 6bf49bc4b7
commit 4a7a9a56be
3 changed files with 16 additions and 4 deletions

View File

@ -84,4 +84,8 @@ public class Properties {
static String getTargetGitBranch() {
return getProperty("git.target.branch").replace('/', '-');
}
static boolean getPublishJunitTests() {
return ! getProperty("publish.junit").isEmpty();
}
}

View File

@ -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);
if (Properties.getPublishJunitTests()) {
final Task zipJunitTask = createJunitZipTask(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 (task != null) {
csvTask.dependsOn(task);

View File

@ -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());
}
}