Skip to content

Running regression tests locally

P. L. Lim edited this page May 6, 2025 · 15 revisions

Build calxxx and install test dependencies as instructed in https://github.com/spacetelescope/hstcal/blob/main/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 https://github.com/spacetelescope/hstcal/blob/main/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 https://github.com/spacetelescope/jwst/wiki/Maintaining-Regression-Tests .

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[vv] --bigdata --slow --basetemp=/path/to/pytest_output/ &> test_output.log
  • -n 8: Use 8 CPUs. Find out how many you have first using nproc before you set the number, preferably at most 1 less than max.
  • -s: Shows screen output.
  • -v: More verbose. Add more v's for even more.
  • --bigdata: Run tests that need TEST_BIGDATA defined to know where to locate the input FITS files.
  • --slow: Run tests marked as slow.
  • --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 new pytest run.
  • &> test_output.log: Capture stdout and stderr into the given log file. Monitor with tail -f test_output.log, if desired. The & tells it to run in the background.

Clone this wiki locally