Skip to content

Commit 9e00016

Browse files
authored
Make test-changed-metadata test the new metadata with all tested-versions, not just the "metadata-version" (#835)
1 parent ccee4d8 commit 9e00016

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/test-changed-metadata.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
name: "🧪 ${{ matrix.coordinates }} (GraalVM for JDK ${{ matrix.version }} @ ${{ matrix.os }})"
5252
if: needs.get-changed-metadata.outputs.relevant-files-changed == 'true' && needs.get-changed-metadata.result == 'success' && needs.get-changed-metadata.outputs.none-found != 'true' && github.repository == 'oracle/graalvm-reachability-metadata'
5353
runs-on: ${{ matrix.os }}
54-
timeout-minutes: 20
54+
timeout-minutes: 120
5555
needs: get-changed-metadata
5656

5757
strategy:
@@ -87,9 +87,29 @@ jobs:
8787
run: |
8888
./gradlew checkMetadataFiles -Pcoordinates=${{ matrix.coordinates }}
8989
90-
- name: "🧪 Run '${{ matrix.coordinates }}' tests"
90+
- name: "🧪 Run '${{ matrix.coordinates }}' tests for all tested versions"
9191
run: |
92-
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
92+
GAV_COORDINATES="${{ matrix.coordinates }}"
93+
94+
# Extract tested versions for the metadata-version from index.json
95+
GROUP_ID=$(echo "$GAV_COORDINATES" | cut -d: -f1)
96+
ARTIFACT_ID=$(echo "$GAV_COORDINATES" | cut -d: -f2)
97+
METADATA_VERSION=$(echo "$GAV_COORDINATES" | cut -d: -f3)
98+
99+
INDEX_FILE="metadata/$GROUP_ID/$ARTIFACT_ID/index.json"
100+
101+
# Build JSON array of tested-version for the metadata-version
102+
VERSIONS_JSON=$(jq -r --arg mv "$METADATA_VERSION" '.[] | select(.["metadata-version"]==$mv) | ."tested-versions"' "$INDEX_FILE")
103+
104+
# Run tests for all previously tested versions
105+
bash ./.github/workflows/scripts/run-consecutive-tests.sh "$GAV_COORDINATES" "$VERSIONS_JSON" 2>&1 | tee test_results.txt || true
106+
107+
# Check if any version tested-version failed tests
108+
if grep -q "^FAILED" test_results.txt; then
109+
FAILED_VERSION=$(grep "^FAILED" test_results.txt | head -n 1 | awk -F'[][]' '{print $4}')
110+
echo "Tests failed for version $FAILED_VERSION"
111+
exit 1
112+
fi
93113
94114
all-metadata-passed:
95115
name: "🧪 All metadata tests have passed"

0 commit comments

Comments
 (0)