Skip to content

Commit

Permalink
Add coverage gathering of everest
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren authored and andreas-el committed Dec 3, 2024
1 parent c686535 commit ec8b5cc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
- name: Upload artifact images
uses: actions/upload-artifact@v4
Expand All @@ -53,18 +53,18 @@ jobs:
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
- name: Unit Test
if: inputs.test-type == 'unit-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
pytest --doctest-modules --cov=ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
- name: Performance Test
if: inputs.test-type == 'performance-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
- name: Test for a clean repository
run: |
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/test_everest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ jobs:
- name: Run Tests Linux
if: ${{ inputs.test-type == 'test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 -m "not integration_test" --dist loadgroup -sv
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test" --dist loadgroup -sv
- name: Run Tests macOS
if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
- name: Run Integration Tests Linux
if: ${{inputs.test-type == 'integration-test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 -m "integration_test" --dist loadgroup -sv
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test" --dist loadgroup -sv
- name: Run Integration Tests macOS
if: ${{inputs.test-type == 'integration-test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
- name: Build Documentation
if: inputs.test-type == 'doc'
Expand All @@ -68,9 +68,37 @@ jobs:
if: inputs.test-type == 'everest-models-test'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
python -m pytest tests/everest -n 4 -m everest_models_test --dist loadgroup
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m everest_models_test --dist loadgroup
- name: Test docs entry point
if: inputs.test-type == 'everest-docs-entry-test'
run: |
python -m everest.docs
- name: Upload coverage to Codecov
id: codecov1
uses: codecov/codecov-action@v4
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: cov1.xml,cov2.xml
flags: ${{ inputs.test-type }}
- name: codecov retry sleep
if: steps.codecov1.outcome == 'failure'
run: |
sleep 30
- name: Codecov retry
uses: codecov/codecov-action@v4
if: steps.codecov1.outcome == 'failure'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cov1.xml,cov2.xml
flags: ${{ inputs.test-type }}
fail_ci_if_error: ${{ github.ref == 'refs/heads/main' }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ fixes:
comment:
# The code coverage is made up of 4 test runs so only after all coverage
# reports have been uploaded will the comparison be sane
after_n_builds: 16
after_n_builds: 21

0 comments on commit ec8b5cc

Please sign in to comment.