Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make failsafe plugin in the root pom to trigger all test cases end with suffix IT #31670

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions kernel/sql-federation/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,6 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk8</id>
Expand Down
17 changes: 0 additions & 17 deletions kernel/sql-federation/executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,6 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk8</id>
Expand Down
17 changes: 0 additions & 17 deletions kernel/sql-federation/optimizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,6 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk8</id>
Expand Down
17 changes: 0 additions & 17 deletions parser/sql/dialect/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,6 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk8</id>
Expand Down
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<jandex-maven-plugin.version>3.1.3</jandex-maven-plugin.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
Expand Down Expand Up @@ -870,6 +871,19 @@
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
Expand Down Expand Up @@ -1001,6 +1015,9 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>

<extensions>
Expand Down
17 changes: 0 additions & 17 deletions test/e2e/agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,4 @@
<artifactId>awaitility</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
17 changes: 0 additions & 17 deletions test/e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,4 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
17 changes: 0 additions & 17 deletions test/it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,4 @@
<module>rewriter</module>
<module>pipeline</module>
</modules>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@

package org.apache.shardingsphere.test.it.yaml;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.mode.tuple.RepositoryTuple;
import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlGlobalRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
import org.apache.shardingsphere.mode.tuple.annotation.RepositoryTupleEntity;
import org.apache.shardingsphere.mode.tuple.RepositoryTuple;
import org.apache.shardingsphere.mode.tuple.RepositoryTupleSwapperEngine;
import org.apache.shardingsphere.mode.tuple.annotation.RepositoryTupleEntity;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand All @@ -44,6 +46,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Slf4j
public abstract class RepositoryTupleSwapperEngineIT {

private final File yamlFile;
Expand Down Expand Up @@ -82,7 +85,11 @@ private boolean isSimpleObject(final Object expectedValue) {

@Test
void assertSwapToYamlRuleConfiguration() throws IOException {
assertThat(getActualYamlContent(), is(getExpectedYamlContent()));
String actualYamlContent = getActualYamlContent();
String expectedYamlContent = getExpectedYamlContent();
if (!sameYamlContext(actualYamlContent, expectedYamlContent)) {
assertThat(actualYamlContent, is(expectedYamlContent));
}
}

private String getActualYamlContent() throws IOException {
Expand All @@ -108,4 +115,12 @@ private String getExpectedYamlContent() throws IOException {
.filter(each -> !each.contains("#") && !each.isEmpty()).collect(Collectors.joining(System.lineSeparator())) + System.lineSeparator();
return YamlEngine.marshal(YamlEngine.unmarshal(content, Map.class));
}

private boolean sameYamlContext(final String actualYamlContext, final String expectedYamlContext) {
char[] actualArray = actualYamlContext.toCharArray();
char[] expectedArray = expectedYamlContext.toCharArray();
Arrays.sort(actualArray);
Arrays.sort(expectedArray);
return Arrays.equals(actualArray, expectedArray);
}
}