All commands below are run from the repository root. Running a test file
directly by path (python3 tests/files/load_tests.py) fails with
ModuleNotFoundError: No module named 'estimators', because the repo root is
not on sys.path in that mode.
python3 -m unittest tests.<package>.<module>| Suite | Command | Needs a generated fixture? |
|---|---|---|
| Files - shallow scan | python3 -m unittest tests.files.shallow_estimator_test |
No |
| Files - deep scan load | python3 -m unittest tests.files.load_tests |
Yes |
| Chat | python3 -m unittest tests.chat.estimator_test tests.chat.scanner_test |
No |
| EO in-place archives - sanity | python3 -m unittest tests.eo_in_place_archives.sanity_tests |
No |
| EO in-place archives - load | python3 -m unittest tests.eo_in_place_archives.load_tests |
Yes |
| EO shared mailboxes - sanity | python3 -m unittest tests.eo_shared_mail_boxes.sanity_tests |
No |
| EO shared mailboxes - load | python3 -m unittest tests.eo_shared_mail_boxes.load_tests |
Yes |
| EO group mailboxes - sanity | python3 -m unittest tests.eo_group_mailboxes.sanity_tests |
No |
The load tests replay a large synthetic tenant. That tenant is not checked
in (.gitignore excludes tests/*/test_data/), so it has to be generated
once before the suite can run. Without it the suite fails fast with
FileNotFoundError: Test data not found at ... Please run data_state_creator.py first.
python3 tests/files/data_state_creator.py
python3 tests/eo_in_place_archives/data_state_creator.py
python3 tests/eo_shared_mail_boxes/data_state_creator.pyEach generator writes tests/<suite>/test_data/state.json, which is the path
the matching load test reads by default.
Every generator also computes the expected result alongside the raw tenant
data, so a fixture generated by an older revision of data_state_creator.py
will keep asserting the old expectations. Regenerate the fixture whenever a
generator or the aggregation logic it mirrors changes.
Pass --seed to get a deterministic tenant. The file is then named after the
seed, and the test is pointed at it with TEST_DATA_PATH:
python3 tests/files/data_state_creator.py --seed 7
TEST_DATA_PATH=tests/files/test_data/state_7.json python3 -m unittest tests.files.load_testsNo test may reach the network. EOInPlaceArchiveEstimator authenticates its
auxiliary TokenManager inside __init__, so its tests patch
TokenManager.authenticate_all in setUp before constructing the estimator.
If that patch is dropped, authentication fails against the fake tenant, the
estimator's except branch sets the stop event, and every assertion in the
suite silently collapses to zero rather than erroring out. Apply the same
pattern to any new estimator that authenticates during construction.
| Symptom | Cause | Fix |
|---|---|---|
ModuleNotFoundError: No module named 'estimators' |
Ran the file by path | Run via python3 -m unittest tests.<pkg>.<module> from the repo root |
FileNotFoundError: Test data not found at ... |
Fixture never generated | Run the suite's data_state_creator.py |
A load test reports counts that are all 0 |
The estimator hit the network during construction and set the stop event | Patch the estimator's authentication in setUp |
| A load test is off by a small constant | The fixture's expectations disagree with the estimator | Regenerate the fixture; if it still disagrees, the generator and estimator have genuinely diverged |