forked from kroxylicious/kroxylicious
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (129 loc) · 5.31 KB
/
integration-tests.yaml
File metadata and controls
132 lines (129 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
name: "Run Kroxylicious Proxy Integration Tests"
on:
pull_request:
types: [ opened, synchronize, reopened ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
discover_integration_test_chunks:
runs-on: ubuntu-latest
outputs:
test_chunks: ${{ steps.discover.outputs.test_chunks }}
steps:
- name: 'Check out repository'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 'Discover ITs'
working-directory: kroxylicious-integration-tests
id: discover
run: |
TESTS_PER_CHUNK=5
TEST_CHUNKS="[$(find . -type f -name "*IT.java" -exec basename {} .java \; | xargs -L ${TESTS_PER_CHUNK} | tr ' ' , | sed 's/.*/"&"/' | sed -z 's/\n/,/g;s/,$/\n/')]"
echo "test_chunks=$TEST_CHUNKS" >> $GITHUB_OUTPUT
run_integration_tests:
needs: discover_integration_test_chunks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tests: ${{ fromJson(needs.discover_integration_test_chunks.outputs.test_chunks) }}
steps:
- name: Log tests to run
run: echo "Running tests on classes '${{ matrix.tests }}'"
- name: 'Check out repository'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 'Set up Java'
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
- name: 'Cache Maven packages'
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: 'Build Kroxylicious proxy integration tests'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B install -DskipTests -Dmaven.javadoc.skip=true -DskipDocs=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Djapicmp.skip=true -pl :kroxylicious-bom,:kroxylicious-integration-tests,:kroxylicious-filter-archetype -am
- name: 'Run proxy Kroxylicious integration tests'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# These variables/secrets support the Fortanix/KMS integration tests. If the secrets are absent, the
# tests will be skipped.
KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT: ${{ vars.KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT }}
KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY }}
KROXYLICIOUS_KMS_FORTANIX_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_API_KEY }}
working-directory: kroxylicious-integration-tests
run: mvn -B verify -DskipUTs -Dit.test="${{ matrix.tests }}"
integration_test_proxy:
runs-on: ubuntu-latest
needs: run_integration_tests
if: always()
permissions:
actions: read
steps:
- name: 'Check all matrix builds'
env:
GH_TOKEN: ${{ github.token }}
run: |
FAILED_JSON=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs \
--jq '.jobs[] | select(.conclusion=="failure") | {name: .name, url: .html_url}')
if [ -z "$FAILED_JSON" ]; then
echo "All jobs passed!" >> $GITHUB_STEP_SUMMARY
echo "No failures detected."
exit 0
fi
echo "Failed Matrix Jobs" >> $GITHUB_STEP_SUMMARY
echo "The following instances failed:"
echo "$FAILED_JSON" | jq -r '"* [\(.name)](\(.url))"' >> $GITHUB_STEP_SUMMARY
echo "$FAILED_JSON" | jq -r '"\(.name): \(.url)"'
exit 1
integration_test_filter_archetype:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 'Set up Java'
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
- name: 'Cache Maven packages'
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: 'Build Kroxylicious archetype'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B install -DskipTests -Dmaven.javadoc.skip=true -DskipDocs=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Djapicmp.skip=true -pl :kroxylicious-bom,:kroxylicious-filter-archetype -am
- name: 'run filter archetype integration tests'
working-directory: kroxylicious-filter-archetype
run: mvn -B verify