-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathjustfile
More file actions
131 lines (103 loc) · 4.96 KB
/
Copy pathjustfile
File metadata and controls
131 lines (103 loc) · 4.96 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
poly:
ert gui test-data/ert/poly_example/poly.ert
snake_oil:
ert gui test-data/ert/snake_oil/snake_oil.ert
heat_equation:
ert gui test-data/ert/heat_equation/config.ert
pytest_args := env("ERT_PYTEST_ARGS", "--quiet")
rapid-tests:
OMP_NUM_THREADS=1 pytest -n auto --dist loadgroup tests/ert/unit_tests tests/everest \
--hypothesis-profile=fast \
--benchmark-disable \
-m "not (slow or unreliable or high_utilization)" \
--timeout=10 --session-timeout=120 \
-p no:memray
ert-rapid-tests:
OMP_NUM_THREADS=1 pytest --dist loadgroup tests/ert/unit_tests \
--hypothesis-profile=fast \
--ignore=tests/ert/unit_tests/gui \
--ignore=tests/ert/unit_tests/server \
--ignore=tests/ert/unit_tests/config/test_transfer_functions.py \
--ignore=tests/ert/unit_tests/ensemble_evaluator/test_ensemble_client.py \
-m "not (slow or unreliable or high_utilization or creates_tmpdir)" \
-p no:memray -p no:doctest -p no:benchmark -p no:mpl -p no:cov -p no:pytest-qt
continuous_tests:
fswatch -r -o --event Created --event Updated --event Removed --event Renamed src/ tests/ --exclude="\.egg-info|__pycache__" | while IFS= read -r _; do nice just ert-rapid-tests; done
fuzz:
OMP_NUM_THREADS=1 pytest {{pytest_args}} -m "fuzzing" --hypothesis-profile=fuzz tests/ert
screenshot-comparison-test:
rm -rf /tmp/test_docs_screenshots pytest-mpl_results
pytest --mpl --mpl-results-path=pytest-mpl_results --mpl-results-always -v -m "mpl_image_compare or screenshot_test" tests
pack-updated-screenshots:
#!/bin/bash
staging="updated-screenshots"
mkdir -p "$staging"
shopt -s nullglob
for test_dir in pytest-mpl_results/*/; do
# Filenames from pytest-mpl need a lot of massaging in order to
# reconstruct the directory structure:
full_dotted_name=$(basename "$test_dir")
updated_img="${test_dir}/result.png"
filename="${full_dotted_name##*.}.png"
path_with_test_func_name="${full_dotted_name%.*}"
path_dots="${path_with_test_func_name%.*}"
rel_path="${path_dots//.//}"
target_dir="$staging/$rel_path/baseline"
mkdir -p $staging/$rel_path/baseline
cp "$updated_img" "$target_dir/$filename"
echo "Mapped $full_dotted_name -> $target_dir/$filename"
done
[ -d "/tmp/test_docs_screenshots" ] && cp -r /tmp/test_docs_screenshots/* "$staging"
echo "Files staged for updated screenshots:"
find "$staging" -type f -exec ls -l {} +
ert-gui-tests:
pytest {{pytest_args}} tests/ert/ui_tests/gui -m "not (mpl_image_compare or screenshot_test)"
ert-cli-tests:
pytest {{pytest_args}} tests/ert/ui_tests/cli
ert-memory-tests:
#!/bin/bash
set -e
pytest {{pytest_args}} tests/ert -m "memory_test"
# memray segfaults on Python 3.12 while tearing down its Tracker
# (bloomberg/memray#999). Fixed by bloomberg/memray#1000, but unreleased as
# of memray 1.20.0. Drop this gate once a newer memray is released and
# pinned in uv.lock: equinor/ert#14452.
if python -c 'import sys; sys.exit(0 if sys.version_info >= (3, 13) else 1)'; then
pytest {{pytest_args}} tests/ert -m "limit_memory" --memray
else
echo "Skipping limit_memory tests: memray segfaults on Python 3.12 (equinor/ert#14452)"
fi
ert-unit-tests:
pytest {{pytest_args}} -n 4 --dist loadgroup --benchmark-disable tests/ert/unit_tests tests/ert/performance_tests -m "not (memory_test or limit_memory)"
ert-doc-tests:
pytest {{pytest_args}} --doctest-modules src/ --ignore src/ert/server
everest-tests:
pytest -n 4 --benchmark-disable --dist loadgroup {{pytest_args}} tests/everest
build-everest-docs:
sphinx-build -n -v -E -W ./docs/everest ./everest_docs
fmudesign-tests:
pytest -n 4 --dist loadgroup {{pytest_args}} tests/fmudesign
fetch-screenshot-baselines:
rm -rf .tmp/ert-testdata
git clone --depth 1 --filter=blob:none --sparse https://github.com/equinor/ert-testdata.git .tmp/ert-testdata
cd .tmp/ert-testdata && git sparse-checkout set screenshotbaselines
cp -r .tmp/ert-testdata/screenshotbaselines/. .
rm -rf .tmp/ert-testdata
build-ert-docs: fetch-screenshot-baselines
sphinx-build -n -v -E -W ./docs/ert ./ert_docs
build-docs: build-ert-docs build-everest-docs
check-types:
mypy src
test-all:
parallel -j4 ::: 'just ert-gui-tests' 'just ert-cli-tests' 'just ert-unit-tests' 'just everest-tests' 'just fmudesign-tests'
ert-tests:
parallel -j4 ::: 'just ert-gui-tests' 'just ert-cli-tests' 'just ert-unit-tests'
check-all:
parallel -j8 ::: 'just ert-gui-tests' 'just ert-cli-tests' 'just ert-unit-tests' 'just ert-doc-tests' 'just everest-tests' 'just fmudesign-tests' 'just check-types' 'just build-everest-docs' 'just build-ert-docs'
update-ert-snapshots:
pytest --snapshot-update {{pytest_args}} -m "snapshot_test" tests/ert
update-everest-snapshots:
pytest --snapshot-update {{pytest_args}} -m "snapshot_test" tests/everest
update-snapshots:
just "update-everest-snapshots"
just "update-ert-snapshots"