-
Notifications
You must be signed in to change notification settings - Fork 31
Running regression tests locally
Build calxxx and install test dependencies as instructed in INSTALL.md. Additionally, you can also install pytest-xdist (-n) for distributing tests across CPUs, but note that even without this, the CTE correction for ACS and WFC3 would use up all the cores anyway.
Set up environment variables and CRDS as instructed in README.md. Example:
export jref="/grp/crds/cache/references/hst/"
export iref="/grp/crds/cache/references/hst/"
export oref="/grp/crds/cache/references/hst/"
export CRDS_PATH="/path/to/local/crds_cache"
export CRDS_SERVER_URL="https://hst-crds.stsci.edu"Download and configure jfrog as laid out in Maintaining Regression Tests in JWST.
To set up local checkout of "big data" to $HOME (though it is preferable to store them to a disk that is physically close to the CPU, e.g., /internal/1):
$ mkdir ~/test_bigdata
$ mkdir ~/test_bigdata/scsb-hstcal
$ cd ~/test_bigdata/scsb-hstcal
$ jfrog rt dl "scsb-hstcal/dev/*" ./
$ export TEST_BIGDATA=$HOME/test_bigdata/The scsb-hstcal directory layout is as follows:
scsb-hstcal
environment (dev or n.n.n)
instrument (acs | wfc3 | stis)
detector (acs: hrc | sbc | wfc, wfc3: ir | uvis)
input
truth
To run all the tests from hstcal source checkout root directory:
$ pytest tests/ [-n 8] -s -v[v] --bigdata --slow [--run-slow] --basetemp=/path/to/pytest_output/ &> test_output.log-
-n 8: Use 8 CPUs. Find out how many you have first usingnprocbefore you set the number, preferably at most 1 less than max. -
-s: Shows screen output. -
-v: More verbose. Add anothervfor even more. -
--bigdata: Run tests that needTEST_BIGDATAdefined to know where to locate the input FITS files. -
--slow: Run tests marked as slow. -
--run-slow: Need this for--slowto work if you havepytest-astropyinstalled; see https://github.com/spacetelescope/ci_watson/issues/83 -
--basetemp: Write test output files into the given directory instead of/tmp. Files are loaded into this area and processed in subdirectories based on test names. Be careful as this area is destroyed for each newpytestrun. -
&> test_output.log: Capturestdoutandstderrinto the given log file. Monitor withtail -f test_output.log, if desired. The&tells it to run in the background.
If you are adding a totally new reference file type to the test suite, you have to remember to add it to the tests/helpers.py file. Otherwise, the tests will claim they cannot open/read the new file.
Okify currently does not work. Manually copy them over to Artifactory.
This is useful to do when truths have changed in Artifactory and you want to run the tests locally as well.
$ cd ~/test_bigdata/scsb-hstcal
$ jfrog rt dl "scsb-hstcal/dev/*" ./ --sync-deletes dev
If you use Conda/Mamba and installed calxxx within the environment, the executables will be in something like this:
/path/to/miniconda3/envs/CALDP-2025.2.1-4+photutils/bin
The tests in Python are not installed with the executables. By default, they look for calxxx according to your PATH, which includes the Conda/Mamba bin directory already. Alternately, you can have the tests look for calxxx in non-default places (BE CAREFUL), such as:
- hardcoding the full path name to
calxxxin the test being executed; - specifying custom install destination in your
cmakecall (see INSTALL.md) and then prepending that location to your existingPATHenvironment variable (export PATH="MyNewPath:$PATH"); or - copying the executable(s) you created in your original install directory to the
bindirectory of your Conda/Mamba environment.