Skip to content

Commit

Permalink
test(ors-test-scenarios): Create workflow for the new ors-test-scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP committed Nov 11, 2024
1 parent 52e87ae commit 007a0e0
Showing 1 changed file with 66 additions and 29 deletions.
95 changes: 66 additions & 29 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}

0 comments on commit 007a0e0

Please sign in to comment.