Skip to content

Commit

Permalink
fixed running tests during builds (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Duin committed Aug 4, 2023
1 parent 8425b1d commit 46a5e1a
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## [3.11.3] - TBD
### Fixed
- Exclude Junit5 dependencies as they clashed with Junit4 and caused maven to stop running the tests.
- Fixed metric(graphite) integration test (was broken since 3.10.12 (spring-boot upgrade).
### Changed
- Exclude jetty-all from core module, because it makes spring start fail and makes `WaggleDanceIntegrationTest` fail.
- Upgrade maven.surefire.plugin.version to 3.1.2 (was 3.0.0-m5).
- Exclude jdk.tools clashes with > java8 JDK.

## [3.11.2] - 2023-07-04
### Changed
Expand Down
26 changes: 24 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -35,6 +36,7 @@

<properties>
<maven.release.plugin.version>2.5.3</maven.release.plugin.version>
<maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
<spring-boot.version>2.7.11</spring-boot.version>
<hadoop.version>2.10.1</hadoop.version>
<hamcrest.version>2.2</hamcrest.version>
Expand Down Expand Up @@ -183,6 +185,26 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
Expand Down Expand Up @@ -244,7 +266,7 @@
<version>${hcommon-hive-metastore.version}</version>
</dependency>
<!-- Jackson dependencies come transitively from different projects,
listing them all here so we get one version deployed -->
listing them all here so we get one version deployed -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down
16 changes: 5 additions & 11 deletions waggle-dance-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@
<exclusion>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-aggdesigner-algorithm</artifactId>
</exclusion>
</exclusion>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -309,16 +313,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2019 Expedia, Inc.
* Copyright (C) 2016-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
3 changes: 1 addition & 2 deletions waggle-dance-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,5 @@
<version>${feign.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2022 Expedia, Inc.
* Copyright (C) 2016-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -390,17 +390,17 @@ public void typicalWithGraphite() throws Exception {

Set<String> metrics = new TreeSet<>(Arrays.asList(new String(graphite.getOutput()).split("\n")));
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.calls.count 2");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.calls;metricattribute=count 2");
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.success.count 2");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.success;metricattribute=count 2");
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.primary.calls.count 1");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.primary.calls;metricattribute=count 1");
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.primary.success.count 1");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.primary.success;metricattribute=count 1");
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.calls.count 1");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.calls;metricattribute=count 1");
assertMetric(metrics,
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.success.count 1");
"graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.success;metricattribute=count 1");
}

private void assertMetric(Set<String> metrics, String partialMetric) {
Expand Down
64 changes: 64 additions & 0 deletions waggle-dance-integration-tests/src/test/resources/log4j.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2016-2023 Expedia, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<!-- WaggleDance Integration Tests (WD_IT) log (through hive dependencies) via log4j (not log4j2.xml which controls the logging of the started WaggleDanceRunner) -->
<param name="ConversionPattern" value="%d{ISO8601} WD_IT %-5p %c:%L - %m%n" />
</layout>
</appender>

<logger name="org.apache.hadoop.hive.metastore.HiveMetaStore.audit">
<level value="ERROR" />
</logger>

<logger name="org.apache.hadoop.hive.metastore.HiveMetaStore">
<level value="WARN" />
</logger>

<logger name="org.apache.hadoop.hive.metastore.MetaStoreDirectSql">
<level value="ERROR" />
</logger>

<logger name="org.apache.hadoop.hive.metastore.ObjectStore">
<level value="ERROR" />
</logger>

<logger name="org.apache.hadoop.util.NativeCodeLoader">
<level value="ERROR" />
</logger>

<logger name="org.apache.hadoop">
<level value="WARN" />
</logger>

<logger name="org.apache.hive">
<level value="WARN" />
</logger>

<logger name="DataNucleus">
<level value="ERROR" />
</logger>

<root>
<level value="INFO" />
<appender-ref ref="CONSOLE" />
</root>

</log4j:configuration>
2 changes: 1 addition & 1 deletion waggle-dance/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-2019 Expedia, Inc.
Copyright (C) 2016-2023 Expedia, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 46a5e1a

Please sign in to comment.