From 52b853bb28c1d410230b2044e50816362dc352c9 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 20 Mar 2020 18:19:52 +0000 Subject: [PATCH] JAL-3562 exclude testNG groups from a build via -PtestngExcludedGroups=Not-bamboo --- build.gradle | 5 +++++ doc/building.md | 12 +++++++++++- gradle.properties | 1 + test/jalview/gui/AlignmentPanelTest.java | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8dcbc41..2b9cf4e 100644 --- a/build.gradle +++ b/build.gradle @@ -136,6 +136,10 @@ ext { getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}") getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}") jvlChannelName += "_${getdownChannelName}" + // automatically add the test group Not-bamboo for exclusion + if ("".equals(testngExcludedGroups)) { + testngExcludedGroups = "Not-bamboo" + } break case "RELEASE": @@ -845,6 +849,7 @@ test { useTestNG() { includeGroups testngGroups + excludeGroups testngExcludedGroups preserveOrder true useDefaultListeners=true } diff --git a/doc/building.md b/doc/building.md index 33e1fec..0f5ea4c 100644 --- a/doc/building.md +++ b/doc/building.md @@ -333,7 +333,17 @@ You can run different defined groups of tests with gradle test -PtestngGroups=Network ``` -Available groups are Functional (default), Network, External. +Available groups include Functional (default), Network, External. + +#### Excluding some tests + +Some of Jalview's Functional tests don't pass reliably in all environments. We tag these tests with a group like 'Not-bamboo' to mark them for exclusion when we run tests as part of continuous integration. + +To exclude one or more groups of tests, add them as a comma separated list in testngExcludedGroups. + +```bash +gradle test -PtestngExcludedGroups=Not-bamboo +``` ### Installer packaging with *install4j* diff --git a/gradle.properties b/gradle.properties index c473108..81674e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,6 +24,7 @@ jalview_keyalg = SHA1withRSA jalview_keydig = SHA1 testngGroups = Functional +testngExcludedGroups = j8libDir = j8lib j11libDir = j11lib diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 203220a..4f2fafc 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -244,7 +244,7 @@ public class AlignmentPanelTest assertEquals(d.height, 12); } - @Test(groups = "Functional") + @Test(groups = { "Functional", "Not-bamboo" }) public void testGetVisibleWidth() { /* -- 1.7.10.2