JAL-3562 exclude testNG groups from a build via -PtestngExcludedGroups=Not-bamboo
authorJim Procter <jprocter@issues.jalview.org>
Fri, 20 Mar 2020 18:19:52 +0000 (18:19 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 20 Mar 2020 18:19:52 +0000 (18:19 +0000)
build.gradle
doc/building.md
gradle.properties
test/jalview/gui/AlignmentPanelTest.java

index 8dcbc41..2b9cf4e 100644 (file)
@@ -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
   }
index 33e1fec..0f5ea4c 100644 (file)
@@ -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*
index c473108..81674e4 100644 (file)
@@ -24,6 +24,7 @@ jalview_keyalg = SHA1withRSA
 jalview_keydig = SHA1
 
 testngGroups = Functional
+testngExcludedGroups = 
 
 j8libDir = j8lib
 j11libDir = j11lib
index 203220a..4f2fafc 100644 (file)
@@ -244,7 +244,7 @@ public class AlignmentPanelTest
     assertEquals(d.height, 12);
   }
 
-  @Test(groups = "Functional")
+  @Test(groups = { "Functional", "Not-bamboo" })
   public void testGetVisibleWidth()
   {
     /*