Skip to content

Commit

Permalink
Only run integration tests on correct file changes (#3230)
Browse files Browse the repository at this point in the history
* Only run integration tests on correct file changes

Signed-off-by: Jamie Hale <jamiehalebc@gmail.com>

* Run tests on poetry.lock changes

Signed-off-by: Jamie Hale <jamiehalebc@gmail.com>

---------

Signed-off-by: Jamie Hale <jamiehalebc@gmail.com>
  • Loading branch information
jamshale authored Sep 16, 2024
1 parent 33542c6 commit 1de2178
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/bdd-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,31 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check changed files
id: check-changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
src:
- aries_cloudagent/**/*
- poetry.lock
demo: "demo/**/*"
- name: Check if demo or src files changed
id: check-if-demo-or-src-changed
run: |
if [ "${{ steps.check-changed-files.outputs.demo_any_changed }}" != "true" ] && [ "${{ steps.check-changed-files.outputs.src_any_changed }}" != "true" ] && [ '${{ github.event_name }}' == 'pull_request' ]; then
echo "No demo or src files changed..."
echo run_tests=false >> $GITHUB_OUTPUT
fi
- name: Check if PR is a release
if: steps.check-if-demo-or-src-changed.outputs.run_tests != 'false'
uses: ./.github/actions/is-release
id: check_if_release
- name: Run PR or Nightly Integration Tests
if: (steps.check_if_release.outputs.is_release != 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
uses: ./.github/actions/run-integration-tests
if: (steps.check_if_release.outputs.is_release != 'true')
- name: Run Release Integration Tests
if: (steps.check_if_release.outputs.is_release == 'true')
if: (steps.check_if_release.outputs.is_release == 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
uses: ./.github/actions/run-integration-tests
with:
TEST_SCOPE: "-t @Release -t ~@BBS"
22 changes: 20 additions & 2 deletions .github/workflows/bdd-interop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,35 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check changed files
id: check-changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
src:
- aries_cloudagent/**/*
- poetry.lock
- name: Check if src files changed
id: check-if-src-changed
run: |
if [ "${{ steps.check-changed-files.outputs.src_any_changed }}" != "true" ] && [ '${{ github.event_name }}' == 'pull_request' ]; then
echo "No src files changed..."
echo run_tests=false >> $GITHUB_OUTPUT
fi
- name: Check if PR is a release
if: steps.check-if-src-changed.outputs.run_tests != 'false'
uses: ./.github/actions/is-release
id: check_if_release
- name: Request GitHub API for PR data
if: steps.check-if-src-changed.outputs.run_tests != 'false'
uses: octokit/request-action@v2.x
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: get_pr_data
with:
route: GET /repos/${{ github.event.repository.full_name }}/pulls/${{ github.event.number }}
- name: Prepare Interop Tests
if: steps.check-if-src-changed.outputs.run_tests != 'false'
run: |
# Get AATH
git clone https://github.com/hyperledger/aries-agent-test-harness.git
Expand All @@ -54,12 +72,12 @@ jobs:
cd aries-agent-test-harness
./manage build -a acapy-main
- name: Run PR Interop Tests
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request')
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request' && steps.check-if-src-changed.outputs.run_tests != 'false')
run: |
cd aries-agent-test-harness
NO_TTY=1 LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -d acapy-main -t @critical -t ~@wip -t ~@T004-RFC0211 -t ~@DidMethod_orb -t ~@Transport_NoHttpOutbound
- name: Run Release or Nightly Interop Tests
if: (steps.check_if_release.outputs.is_release == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
if: (steps.check_if_release.outputs.is_release == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' && steps.check-if-src-changed.outputs.run_tests != 'false')
run: |
cd aries-agent-test-harness
NO_TTY=1 LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -d acapy-main -t @AcceptanceTest -t ~@wip -t ~@T004-RFC0211 -t ~@DidMethod_orb -t ~@Transport_NoHttpOutbound
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/scenario-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,33 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check changed files
id: check-changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
scenarios: "scenarios/**/*"
src:
- aries_cloudagent/**/*
- poetry.lock
- name: Check if scenarios or src files changed
id: check-if-scenarios-or-src-changed
run: |
if [ "${{ steps.check-changed-files.outputs.scenarios_any_changed }}" != "true" ] && [ "${{ steps.check-changed-files.outputs.src_any_changed }}" != "true" ] && [ '${{ github.event_name }}' == 'pull_request' ]; then
echo "No scenarios or src files changed..."
echo run_tests=false >> $GITHUB_OUTPUT
fi
- name: Install poetry
if: steps.check-if-scenarios-or-src-changed.outputs.run_tests != 'false'
run: pipx install poetry
id: setup-poetry
- uses: actions/setup-python@v5
if: steps.check-if-scenarios-or-src-changed.outputs.run_tests != 'false'
with:
python-version: "3.12"
cache: "poetry"
- name: Run Scenario Tests
if: steps.check-if-scenarios-or-src-changed.outputs.run_tests != 'false'
run: |
# Build the docker image for testing
docker build -t acapy-test -f docker/Dockerfile.run .
Expand Down

0 comments on commit 1de2178

Please sign in to comment.