Skip to content

Commit 0a848a0

Browse files
authored
Merge pull request #47 from codecov/matt/pytest-rootdir
allow run-tests and run-tests-split to set pytest rootdir
2 parents 7e4ab15 + 50d0cf3 commit 0a848a0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/run-tests-split.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
working_directory:
2121
type: string
2222
default: .
23+
pytest_rootdir:
24+
type: string
25+
default: .
2326
outputs:
2427
tests_passed:
2528
# Silly issue with returning job results as workflow outputs
@@ -88,11 +91,11 @@ jobs:
8891
make test_env.check_db
8992
- name: Run unit tests
9093
run: |
91-
make test_env.run_unit GROUP=${{ matrix.group }} SPLIT=${{ inputs.split }}
94+
make test_env.run_unit GROUP=${{ matrix.group }} SPLIT=${{ inputs.split }} PYTEST_ROOTDIR=${{ inputs.pytest_rootdir }}
9295
- name: Run integration tests
9396
if: inputs.run_integration == true
9497
run: |
95-
make test_env.run_integration GROUP=${{ matrix.group }} SPLIT=${{ inputs.split }}
98+
make test_env.run_integration GROUP=${{ matrix.group }} SPLIT=${{ inputs.split }} PYTEST_ROOTDIR=${{ inputs.pytest_rootdir }}
9699
97100
- uses: actions/upload-artifact@v4
98101
if: ${{ !cancelled() }}

.github/workflows/run-tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
working_directory:
1717
type: string
1818
default: .
19+
pytest_rootdir:
20+
type: string
21+
default: .
1922
outputs:
2023
tests_passed:
2124
# Silly issue with returning job results as workflow outputs
@@ -63,11 +66,11 @@ jobs:
6366
make test_env.check_db
6467
- name: Run unit tests
6568
run: |
66-
make test_env.run_unit
69+
make test_env.run_unit PYTEST_ROOTDIR=${{ inputs.pytest_rootdir }}
6770
- name: Run integration tests
6871
if: ${{ !cancelled() && inputs.run_integration == true }}
6972
run: |
70-
make test_env.run_integration
73+
make test_env.run_integration PYTEST_ROOTDIR=${{ inputs.pytest_rootdir }}
7174
7275
- uses: actions/upload-artifact@v4
7376
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)