From 007a0e0bcf7624a416c4078e8ed00384f10685fe Mon Sep 17 00:00:00 2001 From: Julian Psotta Date: Mon, 11 Nov 2024 20:18:29 +0100 Subject: [PATCH] test(ors-test-scenarios): Create workflow for the new ors-test-scenarios --- .github/workflows/integration-tests.yml | 95 +++++++++++++++++-------- 1 file changed, 66 insertions(+), 29 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5b54498947..894f891987 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,9 +5,9 @@ name: Integration test suite on: push: - branches: [ "main" ] + branches: [ "main", "feat/**" ] pull_request: - branches: [ "main" ] + branches: [ "main", "feat/**" ] jobs: maven-build-cache: @@ -25,44 +25,77 @@ jobs: java-version: '17' cache: 'maven' cache-dependency-path: ./pom.xml - - name: Build the podman image for changes + - name: Cache Maven dependencies for the ors maven project run: | echo "Caching the maven dependencies" - mvn -B package --file pom.xml - scenario-debian-12-tomcat-war-systemd: - name: Run Debian 12 Tomcat WAR systemd integration tests + mvn -pl ors-test-scenarios package -B dependency:go-offline -q + container-build-cache-first-pass: + name: Build the Docker image cache for the first time runs-on: ubuntu-latest needs: - maven-build-cache + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + id: buildx + with: + install: true + - name: Cache image ors-test-scenarios-maven-bare + uses: docker/build-push-action@v4 + with: + context: . + push: false + load: false + tags: ors-test-scenarios-maven-bare:latest + file: ors-test-scenarios/src/test/resources/Dockerfile + cache-from: type=gha + cache-to: type=gha,mode=max + container-build-cache-second-pass: + name: Build the Docker image cache for the second time + runs-on: ubuntu-latest + needs: + - maven-build-cache + - container-build-cache-first-pass strategy: matrix: - test_case: [ '0_*.sh', '1_*.sh', '2_*.sh', '3_*.sh' ] - image: [ ubuntu-latest ] + docker_image: [ 'ors-test-scenarios-war-bare','ors-test-scenarios-jar-bare','ors-test-scenarios-maven','ors-test-scenarios-war','ors-test-scenarios-jar' ] steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + id: buildx with: - distribution: 'temurin' - java-version: '17' - cache: 'maven' - cache-dependency-path: ./pom.xml - - name: Run integration tests - run: | - echo "Running integration tests ${{ matrix.test_case }}" - ./.integration-scenarios/debian-12-tomcat-war-systemd/run.sh -t -g '${{ matrix.test_case }}' - - debian-12-jar-mvn-run-tests: + install: true + - name: Cache images + uses: docker/build-push-action@v4 + with: + context: . + push: false + load: false + tags: ${{ matrix.docker_image }}:latest + file: ors-test-scenarios/src/test/resources/Dockerfile + cache-from: type=gha + cache-to: type=gha,mode=max + ors-test-scenarios: + name: Run the ors-test-scenarios integration tests + runs-on: ubuntu-latest needs: - maven-build-cache - name: Run Debian 12 Maven JAR integration tests - runs-on: ubuntu-latest + - container-build-cache-second-pass strategy: matrix: - runtype: [ '-m' , '-j' ] - testgroup: [ build-all-graphs*, arg-overrides*, check*, config-json*, config-yml*, lookup*, missing*, ors-config*, specify-json*, specify-yml*, profile-default* ] + test_class: [ 'ConfigEnvironmentTest','ConfigFileTest','ConfigLookupTest','GeoToolsTest','GraphRepoTest' ] steps: - uses: actions/checkout@v4 with: @@ -74,8 +107,12 @@ jobs: java-version: '17' cache: 'maven' cache-dependency-path: ./pom.xml - - name: Run test group with run type + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + id: buildx + with: + install: true + - name: Run integration tests run: | - echo "Scenario: ${{ matrix.runtype }} - ${{ matrix.testgroup }}" - echo "Parameters: ${{ matrix.parameters }}" - .integration-scenarios/debian-12-jar-mvn/run.sh -b ${{ matrix.runtype }} -t ${{ matrix.testgroup }} + echo "Running integration tests ${{ matrix.test_class }}" + mvn -pl ors-test-scenarios test -Dtest=${{ matrix.test_class }} \ No newline at end of file