Skip to content
Permalink
Browse files
Added the Framework version check before the test runs (#574)
It is useful when analyzing Jenkins test job results
  • Loading branch information
agozhiy authored and Agirish committed Apr 13, 2019
1 parent 457c4be commit 7ea28bac8d10286b5472f562de00a7806ceb10f6
Showing 5 changed files with 56 additions and 2 deletions.
@@ -12,6 +12,7 @@ conf/drillTestConfig.properties
*.class
**/target/*
logs/*
git.properties
framework/resources/Datasources/s3minio/minio/minio_data/.minio.sys
framework/resources/Datasources/s3minio/minio/minio_data/tstbucket/tmp/ppruning/
framework/resources/Datasources/s3minio/minio/minio_data/tstbucket/tmp/gitignore
@@ -34,7 +34,7 @@ done
# use the following line when testing apache drill JDBC driver
if [[ $HADOOP_VERSION == *"mapr"* ]]
then
java $DRILL_TEST_FRAMEWORK_JAVA_OPTS -Xss40m -cp conf/:${DRILL_HOME}/jars/jdbc-driver/drill-jdbc-all-${DRILL_VERSION}.jar:framework/target/framework-1.0.0-SNAPSHOT-shaded.jar -Dfs.mapr.bailout.on.library.mismatch=false -Djava.io.tmpdir=/tmp/drill/tests -Djava.security.auth.login.config=/opt/mapr/conf/mapr.login.conf -Dzookeeper.sasl.client=false org.apache.drill.test.framework.TestDriver "${ARGS[@]}"
java $DRILL_TEST_FRAMEWORK_JAVA_OPTS -Xss40m -cp .:conf/:${DRILL_HOME}/jars/jdbc-driver/drill-jdbc-all-${DRILL_VERSION}.jar:framework/target/framework-1.0.0-SNAPSHOT-shaded.jar -Dfs.mapr.bailout.on.library.mismatch=false -Djava.io.tmpdir=/tmp/drill/tests -Djava.security.auth.login.config=/opt/mapr/conf/mapr.login.conf -Dzookeeper.sasl.client=false org.apache.drill.test.framework.TestDriver "${ARGS[@]}"
else
java $DRILL_TEST_FRAMEWORK_JAVA_OPTS -Xss40m -cp conf/:${DRILL_HOME}/jars/jdbc-driver/drill-jdbc-all-${DRILL_VERSION}.jar:framework/target/framework-1.0.0-SNAPSHOT-shaded.jar org.apache.drill.test.framework.TestDriver "${ARGS[@]}"
java $DRILL_TEST_FRAMEWORK_JAVA_OPTS -Xss40m -cp .:conf/:${DRILL_HOME}/jars/jdbc-driver/drill-jdbc-all-${DRILL_VERSION}.jar:framework/target/framework-1.0.0-SNAPSHOT-shaded.jar org.apache.drill.test.framework.TestDriver "${ARGS[@]}"
fi
@@ -204,6 +204,31 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.5</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>

<configuration>
<dotGitDirectory>${project.basedir}/../.git</dotGitDirectory>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.basedir}/../git.properties</generateGitPropertiesFilename>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
<gitDescribe>
<always>false</always>
<forceLongFormat>true</forceLongFormat>
</gitDescribe>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
@@ -106,6 +106,12 @@ public static void main(String[] args) throws Exception {
}

public int runTests() throws Exception {

LOG.info(DrillTestDefaults.LINE_BREAK +
"\nDRILL TEST FRAMEWORK VERSION\n" +
DrillTestDefaults.LINE_BREAK + "\n" +
Utils.getFrameworkVersion() + "\n" +
DrillTestDefaults.LINE_BREAK + "\n");

List<List<DrillTest>> executionFailureExceptions=Lists.newArrayList();
for(int ii=0;ii<DrillTestDefaults.DRILL_EXCEPTION_REGEXES.length;ii++){
@@ -53,6 +53,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Resources;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
@@ -1070,4 +1071,25 @@ public static boolean matches(String actual, String expected) {
}
return true;
}

public static String getFrameworkVersion() {
String commitID = "";
String commitAuthor = "";
String commitEmail = "";
String commitMessage = "";
try {
URL u = Resources.getResource("git.properties");
if (u != null) {
Properties p = new Properties();
p.load(Resources.asByteSource(u).openStream());
commitID = p.getProperty("git.commit.id");
commitAuthor = p.getProperty("git.commit.user.name");
commitEmail = p.getProperty("git.commit.user.email");
commitMessage = p.getProperty("git.commit.message.short");
}
} catch (IOException | IllegalArgumentException e) {
LOG.warn("Failure while trying to load \"git.properties\" file.", e);
}
return String.format("Commit: %s\nAuthor: %s <%s>\n\n%s", commitID, commitAuthor, commitEmail, commitMessage);
}
}

0 comments on commit 7ea28ba

Please sign in to comment.