Skip to content

Commit

Permalink
Test: Fix running with external cluster
Browse files Browse the repository at this point in the history
Back in #32983 I broke running the integ-test-zip tests against an
external cluster by adding a test that reads the contents of the log
file. This fixes running against an external cluster by explicitly
skipping that test if running against an external cluster.
  • Loading branch information
nik9000 committed Oct 15, 2018
1 parent 67577fc commit 79c735a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions distribution/archives/integ-test-zip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
*/

integTestRunner {
systemProperty 'tests.logfile',
"${ -> integTest.nodes[0].homeDir}/logs/${ -> integTest.nodes[0].clusterName }.log"
/*
* There are two unique things going on here:
* 1. These tests can be run against an external cluster with
* -Dtests.rest.cluster=whatever and -Dtest.cluster=whatever
* 2. *One* of these tests is incompatible with that and should be skipped
* when running against an external cluster.
*/
if (System.getProperty("tests.rest.cluster") == null) {
systemProperty 'tests.logfile',
"${ -> integTest.nodes[0].homeDir}/logs/${ -> integTest.nodes[0].clusterName }.log"
} else {
systemProperty 'tests.logfile', '--external--'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ protected Matcher<String> nodeNameMatcher() {

@Override
protected BufferedReader openReader(Path logFile) {
assumeFalse("Skipping test because it is being run against an external cluster.",
logFile.getFileName().toString().equals("--external--"));
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
try {
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
Expand Down

0 comments on commit 79c735a

Please sign in to comment.