Server Comparison Tests
The tests.compare_servers package compares live Ephemeris Tools server output (Planet Viewer, Moon Tracker, Ephemeris Generator) against stored “golden” copies, or generates new golden copies from the staging server.
Run as a module:
python -m tests.compare_servers [options]
Or run the script directly:
python tests/compare_servers/compare_servers.py [options]
By default (no special options), the program compares all three tools on the production server against the golden copies in the golden directory and writes results to a log file.
Operations
- Comparison (default)
Fetch HTML, PostScript, and tabular output from the requested server for each test URL. Clean responses and golden files (removing timestamps, server paths, and other non-deterministic content), then compare. Match and mismatch results are written to the log file.
- Golden copy replacement (
--replace) Fetch all outputs for each test URL from the staging server and save them into the golden directory. Each file is keyed by a UUID derived from the URL. Use this to refresh golden copies after intentional server or tool changes.
Command-line options
--run-ephemeris-type{test,current}Which SPICE kernels the server uses. Use
testfor a frozen test set so results are stable across kernel updates; usecurrentfor the kernels currently installed on the server. Default:current.--replaceReplace golden copies instead of comparing. All golden files are generated from the staging server. Use
--test-file-pathsto limit which tools’ golden copies are regenerated.--test-file-pathsPATH [PATH …]Files containing test URLs (one per line). If not set, defaults to
test_files/viewer-test-urls.txt,test_files/tracker-test-urls.txt, andtest_files/ephemeris-test-urls.txt. When specified, only these files are used.--golden-directoryPATHDirectory for golden copies. Default:
golden_copiesin the current working directory.--limit-testsRANGE [RANGE …]Run only a subset of tests. Each range is
start:end(e.g.1:10). Only one test file should be in use when using this option.--server{staging,production,server1,server2}|HOST|URLServer used for comparison (ignored when
--replaceis used). Keywords:staging,production,server1,server2. Otherwise provide a host name or URL prefix. Default:production.--logfile-filenameNAMELog file path. Default:
ephem_tools_unit_test_YYYY-MM-DD-HH-MM-SS.log.--save-failing-testsWrite failing comparison responses into a
failed_testsdirectory for inspection.--hide-known-failuresRANGE [RANGE …]Treat specified test indices as known failures: log a warning instead of an error and do not count as failure. Use
start:endformat. Only one test file should be in use when using this option.