Commit 5e4a53a1 authored by Willi Rath's avatar Willi Rath

Add optional large tests

parent b70ca3fd
Pipeline #1553 passed with stage
in 21 minutes and 3 seconds
......@@ -35,11 +35,24 @@ cd ${sources_dir}/scientific-computing-use-cases
with `${path_to_output_dir}` pointing to the file system that should be tested.
## Modifying the timeout
## Modifying the timeout (removed)
_ Timeouts are buggy in pytest. The use of `pytest.mark.timeout` has been
removed. _
## Including the large tests
Setting an environment variable `PYTEST_LARGE_TESTS` to `TRUE`, will include
tests up to arrays of `256^4` double-precision numbers. This will amount to
about 34 GiB written to and read from disk:
```bash
cd ${sources_dir}/scientific-computing-use-cases
PYTEST_LARGE_TESTS=TRUE ./run.sh ${path_to_output_dir}
```
## Reading the output
Sample output (from a well-sized Linux workstation) is in
......
......@@ -13,7 +13,15 @@ source ${mc3_target_dir}/bin/activate py3_std || \
echo "Please run set_up_environment.sh first.";
exit; }
# If we're running the large tests, allow for 24GB virtual memory instead of 8
if [ $PYTEST_LARGE_TESTS == "TRUE" ]; then
vlim=32
else
vlim=8
fi
ulimit -v "$(expr ${vlim} \* 1000 \* 1000)"
# run all tests using a local tmp dir and monitor
# timing of all tests
ulimit -v "$(expr 8 \* 1000 \* 1000)"
pytest -v -s --basetemp=${tmp_dir} --durations=0 tests/
......@@ -11,6 +11,11 @@ import os
np.random.seed(137)
# do we want to run the large tests?
def _run_large_tests():
return (os.environ.get("PYTEST_LARGE_TESTS", "false").upper() == "TRUE")
def _get_xr_data_array(array):
dims = tuple("dim_{:02d}".format(m)
for m in range(array.ndim))
......@@ -24,15 +29,15 @@ def temp_dir(tmpdir_factory):
temp_dir.remove()
@pytest.mark.parametrize(
"ndim",
[3,
pytest.mark.xfail(reason="Expect out-of-memory errors")(4)])
@pytest.mark.parametrize("ndim", [3, 4])
@pytest.mark.parametrize(
"N",
list(2 ** n for n in range(5, 6)) +
list(pytest.mark.xfail(reason="Expect out-of-memory errors")(2 ** n)
for n in range(6, 8)))
list(2 ** n for n in range(5, 8)) +
list(pytest.mark.xfail(reason="Expect out-of-memory errors")(
pytest.mark.skipif(
not _run_large_tests(),
reason="User did not ask for the large tests")(2 ** n))
for n in [8]))
@pytest.mark.parametrize("num_chunks", [2, 8])
@pytest.mark.parametrize("use_zarr_or_nc4", ["zarr", "nc4"])
@pytest.mark.parametrize("only_write", [False, True])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment