Closed taldcroft closed 7 months ago
I note that the failure this references looks like
(ska3-masters) jeanconn-fido> kadi_validate_states --out-dir test-masters --stop=2023:311 --days 3.5
2023-11-21 22:41:45,692 get_index_page_html: Validating pitch
Traceback (most recent call last):
File "/fido.real/conda/envs/ska3-masters/bin/kadi_validate_states", line 33, in <module>
sys.exit(load_entry_point('kadi==7.7.0', 'console_scripts', 'kadi_validate_states')())
File "/fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/kadi/scripts/validate_states.py", line 74, in main
html = validate.get_index_page_html(opt.stop, opt.days, opt.states, opt.no_exclude)
File "/fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/kadi/commands/validate.py", line 795, in get_index_page_html
validator: Validate = cls(stop=stop, days=days, no_exclude=no_exclude)
TypeError: Can't instantiate abstract class ValidatePitch with abstract method update_tlm
@jeanconn - I've fixed the description to show the correct command for functional testing.
kadi.commands.validate
does exist but I'm confused because I don't think it has a main so it doesn't appear to do anything with the updated cmdline either.
@jeanconn - sorry, brain misfiring there.
(ska3-perf) ➜ kadi git:(validate-unit-test) ✗ python -m kadi.scripts.validate_states --help
usage: validate_states.py [-h] [--stop STOP] [--days DAYS] [--log-level LOG_LEVEL] [--out-dir OUT_DIR] [--state STATES]
[--no-exclude] [--in-work] [--version]
Validate kadi command states
options:
-h, --help show this help message and exit
--stop STOP Stop date for update (default=Now)
--days DAYS Lookback days (default=14 days)
--log-level LOG_LEVEL
Logging level (DEBUG | INFO | WARNING, default=INFO)
--out-dir OUT_DIR Output directory for index.html (default='.')
--state STATES State(s) to validate (default=ALL)
--no-exclude Do not apply exclude intervals from validation (for testing)
--in-work Include in-work events in validation (for checking new events)
--version show program's version number and exit
Description
This is a critical fix that reverts a change made in #268. Unfortunately I did not appreciate what this actually meant and our testing does not cover this code at all. Without the fix the
kadi_validate_states
script fails to run at all.I plan to add a unit test that does a regression test of the
validate
code, but in the meantime this PR uses functional testing.Interface impacts
None
Testing
Unit tests
kadi/commands/tests/test_commands.py ........................................................................... [ 37%] kadi/commands/tests/test_states.py ......................x.............................................x............. [ 78%] .......... [ 83%] kadi/tests/test_events.py .......... [ 88%] kadi/tests/test_occweb.py ...................... [100%]
======================================== 197 passed, 2 xfailed in 101.15s (0:01:41) =========================================
python -m kadi.scripts.validate_states --out-dir test-revert --stop=2023:311 --days 3.5 >& test-revert.log
kadi_validate_states --out-dir test-flight --stop=2023:311 --days 3.5 >& test-flight.log
(ska3-perf) ➜ kadi git:(revert-abstract-method) diff test-flight.log test-revert.log 86c86 < **** get_cmds: Getting commands from 815400069.5749999 to 815702469.175 for scenario=None