forked from equinor/ert
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (134 loc) · 4.59 KB
/
Copy pathtest_ert.yml
File metadata and controls
152 lines (134 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
on:
workflow_call:
inputs:
os:
type: string
python-version:
type: string
test-type:
type: string
permissions:
contents: read
env:
ERT_SHOW_BACKTRACE: 1
ERT_PYTEST_ARGS: '--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_main.xml --junit-xml=junit.xml -o junit_family=legacy -v --durations=25 --benchmark-disable'
UV_FROZEN: true
OMP_NUM_THREADS: 1
jobs:
tests-ert:
name: Run ert tests
runs-on: ${{ inputs.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
submodules: true
lfs: true
- if: ${{ runner.os == 'macOS' }}
run: echo "ERT_TESTS_RUN_ON_MAC_CI=true" >> "$GITHUB_ENV"
- uses: ./.github/actions/install_dependencies_qt
with:
os: ${{ inputs.os }}
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
id: setup_python
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
prune-cache: false
python-version: ${{ inputs.python-version }}
- name: Install ert
run: |
uv sync --group dev
# Randomizes test ordering (and reseeds RNGs) to detect order-dependent
# flaky tests. The chosen seed is printed in
# the test output so failures can be reproduced with --randomly-seed=N.
- name: Enable randomized test ordering (Python 3.14)
if: inputs.python-version == '3.14'
run: |
uv pip install pytest-randomly
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
touch storage
chmod 000 storage
uv run just ert-gui-tests
chmod 700 storage
rm storage
- name: Fuzzing
if: inputs.test-type == 'fuzz'
run: |
touch storage
chmod 000 storage
uv run just fuzz
chmod 700 storage
rm storage
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
touch storage
chmod 000 storage
uv run just ert-cli-tests
chmod 700 storage
rm storage
- name: Unit Test
if: inputs.test-type == 'performance-and-unit-tests'
run: |
touch storage
chmod 000 storage
uv run just ert-unit-tests
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_docs.xml --junit-xml=junit-doc.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' uv run just ert-doc-tests
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_mem.xml --junit-xml=junit-mem.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' uv run just ert-memory-tests
chmod 700 storage
rm storage
- name: Upload coverage to Codecov
id: codecov1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: cov_main.xml,cov_docs.xml,cov_mem.xml
flags: ${{ inputs.test-type }}
- name: codecov retry sleep
if: steps.codecov1.outcome == 'failure'
run: |
sleep 30
- name: Codecov retry
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
if: steps.codecov1.outcome == 'failure'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cov_main.xml,cov_docs.xml,cov_mem.xml
flags: ${{ inputs.test-type }}
fail_ci_if_error: ${{ github.ref == 'refs/heads/main' }}
- uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2.6
if: ${{ !cancelled() }}
continue-on-error: true
with:
paths: junit*.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
files: junit.xml,junit-doc.xml,junit-mem.xml
- name: Test CLI
run: |
uv run ert --help
- name: Test for a clean repository
run: |
# Remove things we have generated on purpose:
ls -la
rm -rf .coverage
rm -f coverage.xml cov_main.xml cov_docs.xml cov_mem.xml junit*.xml
rm -f ert.*.whl
rm -f codecov.SHA*
rm -f codecov
rm -f .coverage.*
git status --porcelain
test -z "$(git status --porcelain)"