Skip to content

Commit b2e9990

Browse files
committed
misc: Address review comments
1 parent e722b59 commit b2e9990

7 files changed

Lines changed: 91 additions & 246 deletions

File tree

.github/actions/docker-run/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ runs:
4343
done <<< "$ENV_INPUT"
4444
# Remove the leading space from the first concatenation
4545
ENV_STRING="${ENV_STRING# }"
46-
echo "env=$ENV_STRING" >> "$GITHUB_OUTPUT"
46+
echo "docker_environment_args=$ENV_STRING" >> "$GITHUB_OUTPUT"
4747
4848
- id: dockerrun
4949
name: "Run command ${{ inputs.command }} in ${{ inputs.tag }} docker container"
@@ -56,6 +56,6 @@ runs:
5656
${{ inputs.args }} \
5757
--name "ci-${NAME:-${{ inputs.tag }}}-${{ inputs.uid }}" \
5858
--env-file=docker/coverage.env \
59-
${{ steps.processenv.outputs.env }} \
59+
${{ steps.processenv.outputs.docker_environment_args }} \
6060
"${{ inputs.tag }}_${{ inputs.uid }}" \
6161
${{ inputs.command }}

.github/workflows/docker-devito.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
run: |
179179
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
180180
devitocodes/devito:${{ matrix.tag }}-dev \
181-
pytest ${{ matrix.test }}
181+
pytest -v ${{ matrix.test }}
182182
183183
deploy-devito-manifest:
184184
needs: deploy-devito
@@ -292,4 +292,4 @@ jobs:
292292
run: |
293293
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
294294
devitocodes/devito:${{ matrix.tag }}-dev \
295-
pytest ${{ matrix.test }}
295+
pytest -v ${{ matrix.test }}

.github/workflows/examples-mpi.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@ jobs:
7171
ipcluster start --profile=mpi --engines=mpi -n 4 --daemonize
7272
# A few seconds to ensure workers are ready
7373
sleep 10
74-
py.test --nbval examples/mpi
74+
pytest -v --nbval examples/mpi
7575
ipcluster stop --profile=mpi
7676
7777
- name: Test seismic examples
7878
run: |
79-
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/tti/tti_example.py
80-
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/elastic/elastic_example.py
81-
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
82-
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/viscoelastic/viscoelastic_example.py
79+
mpirun ${{ matrix.mpiarg }} \
80+
pytest -v \
81+
examples/seismic/tti/tti_example.py \
82+
examples/seismic/elastic/elastic_example.py \
83+
examples/seismic/viscoacoustic/viscoacoustic_example.py \
84+
examples/seismic/viscoelastic/viscoelastic_example.py
8385
8486
- name: Test fwi examples with mpi
8587
run: |

.github/workflows/pytest-core-mpi.yaml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@ jobs:
4747
- name: Test with pytest
4848
run: |
4949
python3 scripts/clear_devito_cache.py
50-
python3 -m pytest --cov --cov-config=.coveragerc --cov-report=xml -m parallel tests/
50+
python3 -m pytest \
51+
-v \
52+
--cov \
53+
--cov-config=.coveragerc \
54+
--cov-report=xml \
55+
-m parallel \
56+
tests/
5157
5258
- name: Test examples with MPI
5359
run: |
5460
python3 scripts/clear_devito_cache.py
55-
DEVITO_MPI=1 mpirun -n 2 python3 -m pytest examples/seismic/acoustic
56-
DEVITO_MPI=1 mpirun -n 2 python3 -m pytest examples/seismic/tti
61+
DEVITO_MPI=1 mpirun -n 2 \
62+
python3 -m pytest \
63+
-v \
64+
examples/seismic/acoustic \
65+
examples/seismic/tti
5766
5867
- name: Upload coverage to Codecov
5968
uses: codecov/codecov-action@v5
@@ -104,27 +113,22 @@ jobs:
104113
env: |
105114
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
106115
OMP_NUM_THREADS=1
107-
command: "pytest tests/test_mpi.py"
116+
command: "pytest -v tests/test_mpi.py"
108117

109-
- name: Test acoustic example with MPI
118+
- name: Test acoustic and TTI examples with MPI
110119
uses: ./.github/actions/docker-run
111120
with:
112121
uid: ${{ steps.build.outputs.unique }}
113122
tag: ${{ matrix.name }}
114123
env: |
115124
DEVITO_MPI=1
116125
OMP_NUM_THREADS=1
117-
command: "mpiexec -n 2 pytest examples/seismic/acoustic"
118-
119-
- name: Test tti example with MPI
120-
uses: ./.github/actions/docker-run
121-
with:
122-
uid: ${{ steps.build.outputs.unique }}
123-
tag: ${{ matrix.name }}
124-
env: |
125-
DEVITO_MPI=1
126-
OMP_NUM_THREADS=1
127-
command: "mpiexec -n 2 pytest examples/seismic/tti"
126+
command: >
127+
mpiexec -n 2
128+
pytest
129+
-v
130+
examples/seismic/acoustic
131+
examples/seismic/tti
128132
129133
- name: Cleanup docker image
130134
if: always()

.github/workflows/pytest-core-nompi.yaml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
- name: Test with pytest
162162
run: |
163163
pytest \
164+
-v \
164165
-k "${{ matrix.test-set }}" \
165166
-m "not parallel" \
166167
--cov \
@@ -235,39 +236,21 @@ jobs:
235236
tag: ${{ matrix.name }}
236237
base: devitocodes/bases:cpu-${{ matrix.arch }}
237238

238-
- name: Get the Docker image Python version
239-
uses: ./.github/actions/docker-run
240-
with:
241-
uid: ${{ steps.build.outputs.unique }}
242-
tag: ${{ matrix.name }}
243-
command: >
244-
python3 --version | grep "Python " | cut -d' ' -f2 | cut -d'.' -f1,2 > dockerpythonversion.txt
245-
246-
- name: Check Docker image Python version
247-
run: |
248-
declared_pyver="${{ matrix.python-version }}"
249-
actual_pyver=$(cat dockerpythonversion.txt)
250-
echo "Declared Python version: $declared_pyver"
251-
echo "Actual Python version: $actual_pyver"
252-
if [ "$declared_pyver" != "$actual_pyver" ]; then
253-
echo "Python version mismatch: declared $declared_pyver, image has $actual_pyver"
254-
exit 1
255-
fi
256-
257239
- name: Test with pytest
258240
uses: ./.github/actions/docker-run
259241
with:
260242
uid: ${{ steps.build.outputs.unique }}
261243
tag: ${{ matrix.name }}
262244
env: |
263245
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
264-
command: |
265-
pytest \
266-
-k "${{ matrix.test-set }}" \
267-
-m "not parallel" \
268-
--cov \
269-
--cov-config=.coveragerc \
270-
--cov-report=xml \
246+
command: >
247+
pytest
248+
-v
249+
-k "${{ matrix.test-set }}"
250+
-m "not parallel"
251+
--cov
252+
--cov-config=.coveragerc
253+
--cov-report=xml
271254
tests/
272255
273256
- name: Cleanup docker image

.github/workflows/pytest-gpu.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,18 @@ jobs:
9595
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
9696
DEVITO_LOGGING=DEBUG
9797
PYTHONFAULTHANDLER=1
98-
command: |
99-
pytest \
100-
-vvv \
101-
--capture=no \
102-
--showlocals \
103-
--log-cli-level=DEBUG \
104-
-o log_cli=true \
105-
--full-trace \
106-
--durations=10 \
107-
--cov \
108-
--cov-config=.coveragerc \
109-
--cov-report=xml \
98+
command: >
99+
pytest
100+
-vvv
101+
--capture=no
102+
--showlocals
103+
--log-cli-level=DEBUG
104+
-o log_cli=true
105+
--full-trace
106+
--durations=10
107+
--cov
108+
--cov-config=.coveragerc
109+
--cov-report=xml
110110
${{ matrix.test_files }}
111111
112112
- name: Test examples
@@ -116,7 +116,7 @@ jobs:
116116
tag: ${{ matrix.name }}
117117
args: ${{ matrix.dockerflags }}
118118
env: |
119-
command: pytest ${{ matrix.test_examples }}
119+
command: pytest -v ${{ matrix.test_examples }}
120120

121121
- name: Test examples with MPI
122122
uses: ./.github/actions/docker-run
@@ -127,7 +127,7 @@ jobs:
127127
env: |
128128
DEVITO_LOGGING=DEBUG
129129
DEVITO_MPI=1
130-
command: mpiexec -n 2 pytest ${{ matrix.test_examples }}
130+
command: mpiexec -n 2 pytest -v ${{ matrix.test_examples }}
131131

132132
- name: Cleanup docker image
133133
if: always()

0 commit comments

Comments
 (0)