Skip to content

Commit

Permalink
ci(tests): Speed up the verify tests with parallel execution
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP committed Nov 22, 2024
1 parent c9ea4a9 commit 385283c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/run_maven_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify -Papitests -Dors.engine.init-threads=5 jacoco:report -DCI=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
run: |
mvn -B verify -Papitests \
-Djunit.jupiter.execution.parallel.enabled=true \
-Djunit.jupiter.execution.parallel.mode.default=concurrent \
-Djunit.jupiter.execution.parallel.config.strategy=fixed \
-Djunit.jupiter.execution.parallel.config.fixed.parallelism=4 \
jacoco:report -DCI=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- name: Rocket.Chat Notification
uses: RocketChat/[email protected]
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
import org.heigit.ors.matrix.MatrixResult;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@SpringBootTest
@ActiveProfiles("unittest")
@Execution(SAME_THREAD)
class MatrixResponseInfoTest {
private static MatrixRequest bareMatrixRequest;
private MatrixResponseInfo responseInformation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
import com.graphhopper.storage.GraphHopperStorage;
import org.heigit.ors.util.ToyGraphCreationUtil;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;

import java.util.concurrent.ExecutorService;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@Execution(SAME_THREAD)
class InertialFlowTest {
private final CarFlagEncoder carEncoder = new CarFlagEncoder();
private final EncodingManager encodingManager = EncodingManager.create(carEncoder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.CleanupMode;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.api.parallel.Execution;
import org.testcontainers.containers.NginxContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import org.testcontainers.junit.jupiter.Container;
Expand All @@ -28,9 +29,11 @@
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.heigit.ors.routing.graphhopper.extensions.manage.RepoManagerTestHelper.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@Testcontainers
@ExtendWith(TestcontainersExtension.class)
@Execution(SAME_THREAD)
class HttpRepoManagerTest {

private static final String LOCAL_PROFILE_NAME = "driving-car";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@Execution(SAME_THREAD)
class CountryBordersReaderTest {
CountryBordersReader _oldReaderSingleton;
CountryBordersReader _reader;
Expand Down

0 comments on commit 385283c

Please sign in to comment.