Repository navigation
test: declare ops-scenario and ops-tracing test dependencies - #2891
tonyandrewmeyer wants to merge 4 commits into
Conversation
ops-scenario's tests need ops-tracing, but ops-scenario didn't declare it. It was only in the repository root's unit group. Add a unit group to ops-scenario so its tests can run from its own pyproject.toml. ops-tracing's unit group asked for `ops[testing]`. Name ops-scenario directly instead, since that's the package the tests use (ops is already a runtime dependency). ops-tracing is an optional dependency of ops-scenario, so skip test_trace_data when it isn't installed rather than failing. Also skip the benchmark tests when pytest-benchmark isn't installed, since they need its fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The CI failures are due to the current snap store outage, I believe, so should be resolved when that's fixed. |
|
I haven't started reviewing yet. But:
My agent found exactly this problem yesterday - I assume because we're both asking agents to run tests within workshops. FWIW, here's my agent's report. Issue: Suggested fix:
|
dwilding
left a comment
There was a problem hiding this comment.
The uv.lock revision has reverted to 3 (from 5), which I don't think matters. But do you want to regenerate it with a newer uv version, to avoid churn in a future PR?
Resolve the secrets test charm's metadata path relative to the conftest file rather than pytest's rootdir, so the tests pass when testing/tests is run on its own (the rootdir is then testing/). Move the pytest-benchmark comment onto the importorskip line, and regenerate uv.lock from main with a newer uv so it stays at lockfile revision 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
I've made the change minimal here. I'm not sure what to do about these in general. It's annoying to have churn, maybe we need to try to use a consistent uv somehow? One issue at the moment is that the uv snap is quite behind the actual uv version. |
I'm curious how I could reproduce this error. Was it running I could reproduced the
|
tromai
left a comment
There was a problem hiding this comment.
Leaving a small comment on reproducing the fix.
Add testing/tox.ini, matching tracing's, so the testing unit dependency group can be installed and run on its own with `cd testing && tox -e unit`. CI already runs testing/tests through the root unit environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ops-scenario's tests depend on ops-tracing, but ops-scenario doesn't declare it, so the tests only work when installed through the repository root's
unitgroup. This adds aunitgroup to ops-scenario'spyproject.toml, and has ops-tracing'sunitgroup nameops-scenariodirectly rather thanops[testing](ops is already a runtime dependency).test_trace_datais skipped when ops-tracing isn't installed, since it's an optional dependency of ops-scenario.benchmarkfixture.Running
testing/testson its own also gave 17 errors intest_secrets.py, because the secrets test charm's metadata path was resolved relative to pytest's rootdir. The fixture now resolves it relative to the conftest file instead, so the tests pass however pytest is invoked.This is useful when an automated system is figuring out how to run the tests.