-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport of [NET-10737] Add CI Checks for Generated Testdata into rel…
…ease/1.19.x (#21615) * backport of commit 4e64069 * backport of commit ebafd9b * backport of commit b5faaaf * backport of commit 6f84348 * backport of commit 31539a2 * backport of commit 3008a45 * backport of commit 7620360 * backport of commit e9f7fe9 * backport of commit 945b452 * backport of commit be49ab5 --------- Co-authored-by: jm96441n <[email protected]>
- Loading branch information
1 parent
45abe96
commit 94e3ae7
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: BUSL-1.1 | ||
|
||
set -euo pipefail | ||
|
||
# check if there is a diff in the xds testdata directory after running `make envoy-regen` | ||
echo "regenerating xds files" | ||
make envoy-regen &>/dev/null | ||
|
||
echo "calculating changed files" | ||
changed_xds_files=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/$GITHUB_BRANCH_REF")" | egrep "agent/xds/testdata/.*" || true) | ||
# If we do not find a file in .changelog/, we fail the check | ||
if [ -z "$changed_xds_files" ]; then | ||
# pass status check if no changes were found for xds files | ||
echo "Found no changes to xds golden files" | ||
exit 0 | ||
else | ||
echo "Found diffs with xds golden files run 'make envoy-regen' to update them and check that output is expected" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
# This workflow checks that are no changes necessary to golden files for xds | ||
# tests ensuring they are up to date | ||
|
||
name: Golden File Checker | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, labeled] | ||
# Runs on PRs to main and all release branches | ||
branches: | ||
- main | ||
- release/* | ||
|
||
jobs: | ||
# checks that there is no diff between the existing golden files | ||
goldenfile-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 # by default the checkout action doesn't checkout all branches | ||
- name: Check for golden file xds tests in diff | ||
run: ./.github/scripts/goldenfile_checker.sh | ||
env: | ||
GITHUB_BRANCH_REF: ${{ github.event.pull_request.head.ref }} |