Skip to content

Commit

Permalink
added test filtering to workflows (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanAdamovNeon authored Jan 21, 2025
1 parent f563ff1 commit 4c55faa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ on:
type: boolean
default: false
required: false
description: "Flag defining whether cost report should be generated"
description: "Create cost report"
pytest_k:
type: string
default: "test_"
required: false
description: "Filter tests by name: pytest -k ..."
pytest_m:
type: string
default: ""
required: false
description: "Filter tests by mark: pytest -m ..."
env:
NETWORK: ${{ github.event.inputs.network || 'terraform' }}
NUMPROCESSES: ${{ github.event.inputs.numprocesses || 8 }}
Expand Down Expand Up @@ -150,12 +160,12 @@ jobs:
curl -O https://raw.githubusercontent.com/${{ github.repository_owner }}/neon-evm/${{ steps.share.outputs.evm_branch }}/ci/docker-compose-ci.yml
docker-compose -p ${{env.DOCKER_PROJECT_NAME}} -f docker-compose-ci.yml pull
docker-compose -p ${{env.DOCKER_PROJECT_NAME}} -f docker-compose-ci.yml up -d
docker exec -i ${{env.DOCKER_PROJECT_NAME}}-tests-1 bash -c "python3 clickfile.py run evm --numprocesses 8 --network docker_net"
docker exec -i ${{env.DOCKER_PROJECT_NAME}}-tests-1 bash -c "python3 clickfile.py run evm --numprocesses 8 --network docker_net --case \"${{ github.event.inputs.pytest_k}}\" --marker \"${{ github.event.inputs.pytest_m}}\""
- name: Set failed test group to evm
if: failure()
run: echo "FAILED_TEST_GROUP=evm" >> $GITHUB_ENV
- name: "Generate allure report"
if: always() && ${{ env.NETWORK != 'devnet' }}
if: always() && env.NETWORK != 'devnet'
uses: ./.github/actions/generate-allure-report
with:
container: ${{env.DOCKER_PROJECT_NAME}}-tests-1
Expand Down Expand Up @@ -203,7 +213,7 @@ jobs:
- name: Run basic proxy tests
timeout-minutes: 60
run: |
CMD="python3 ./clickfile.py run basic --network ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }}"
CMD="python3 ./clickfile.py run basic --network ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }} --case \"${{ github.event.inputs.pytest_k}}\" --marker \"${{ github.event.inputs.pytest_m}}\""
if [[ "${{ env.GENERATE_COST_REPORT }}" == "true" ]]; then
CMD="$CMD --cost_reports_dir reports/cost_reports"
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/economy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ on:
options:
- terraform
- night-stand
pytest_k:
type: string
default: "test_"
required: false
description: "Filter tests by name: pytest -k ..."
pytest_m:
type: string
default: ""
required: false
description: "Filter tests by mark: pytest -m ..."

env:
NETWORK: ${{ github.event.inputs.network || 'terraform' }}
Expand Down Expand Up @@ -94,7 +104,7 @@ jobs:
/bin/bash
- name: Run economy tests
run: |
docker exec -i ${{ env.CONTAINER }} python3 ./clickfile.py run economy --network ${{ env.NETWORK }}
docker exec -i ${{ env.CONTAINER }} python3 ./clickfile.py run economy --network ${{ env.NETWORK }} --case "${{ github.event.inputs.pytest_k}}" --marker "${{ github.event.inputs.pytest_m}}"
- name: "Generate allure report"
uses: ./.github/actions/generate-allure-report
if: always()
Expand Down

0 comments on commit 4c55faa

Please sign in to comment.