BuildTests should not run in Maven builds
They succeed only when run with testframework with access to deployed
content. Thus check for env variable set by maven and skip the tests in
this case.
Change-Id: Iab34466cdd23f0813c31af2199870b13c41eddf6
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.releng/+/190477
Tested-by: Platform Bot <platform-bot@eclipse.org>
Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java b/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
index b8af2e4..db75511 100644
--- a/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
+++ b/bundles/org.eclipse.releng.tests/src/org/eclipse/releng/tests/BuildTests.java
@@ -17,6 +17,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeFalse;
import java.io.BufferedReader;
import java.io.File;
@@ -375,6 +376,7 @@
}
@Test
public void testFeatureFiles() {
+ assumeFalse(isMavenRun());
List<String> result = new ArrayList<>();
String installDir = Platform.getInstallLocation().getURL().getPath();
@@ -396,6 +398,8 @@
}
@Test
public void testPluginFiles() {
+ assumeFalse(isMavenRun());
+ System.out.println(System.getenv());
List<String> result = new ArrayList<>();
String installDir = Platform.getInstallLocation().getURL().getPath();
File pluginDir = new File(installDir, "plugins");
@@ -418,6 +422,10 @@
assertTrue("Plugin directory missing required files: " + aString, result.isEmpty());
}
+ private boolean isMavenRun() {
+ return System.getenv("MAVEN_CMD_LINE_ARGS") != null;
+ }
+
private boolean testPluginFile(File aPlugin) {
// Are we a doc plugin?
@@ -567,6 +575,7 @@
}
@Test
public void testJavadocLogs() throws Exception {
+ assumeFalse(isMavenRun());
String javadocUrls = System.getProperty("RELENGTEST.JAVADOC.URLS");
// Skip this test if there are no logs to check
if (javadocUrls == null) {
@@ -645,7 +654,7 @@
@Test
public void testJarSign() throws Exception {
-
+ assumeFalse(isMavenRun());
String buildId = System.getProperty("buildId");
assertNotNull("buildId property must be specified for testJarSign test", buildId);
String downloadHost = "download.eclipse.org";
@@ -680,6 +689,7 @@
}
@Test
public void testComparatorLogSize() throws Exception {
+ assumeFalse(isMavenRun());
final boolean DEBUG_TEST = true;
// MAX_ALLOWED_BYTES will never be 'zero', even if no unexpected comparator warnings, because the
// report always contains some information, such as identifying which build it was for.