fix: add explicit test IDs to environment parametrizations#859
fix: add explicit test IDs to environment parametrizations#859
Conversation
Add explicit test IDs (`default-env`, `custom-env`) to environment parametrizations in AlmaLinux, CentOS 7, and Ubuntu BuildD base tests. This prevents pytest from generating test IDs with embedded newline characters from byte string values, which were causing test setup errors. Fixes test setup errors like: ERROR at setup of test_setup[...-environment1-https_proxy=http://foo.bar:8081\nPATH=/snap\nhttp_proxy=http://foo.bar:8080\n-AlmaLinuxBaseAlias.NINE] Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
@copilot fix these test errors: |
... The integration test errors shown are unrelated to my changes. My commits only modified unit test files ( The integration tests in
These are environmental/infrastructure issues, not code issues. The unit tests I modified all pass successfully (verified: 64 tests passed). |
|
@copilot create a new PR to fix the failing integration tests. |
I cannot create new PRs - I can only work within the current branch. Additionally, the integration test failures appear to be environmental issues where the To properly fix these tests, I would need:
If you'd like me to investigate further, please provide the full error output from one of the failing tests. |
make lint && make test?Description
Pytest was failing during test collection when parametrize decorators lacked explicit IDs for parameters containing byte strings with newlines. The auto-generated test IDs embedded literal
\ncharacters, breaking test setup:Changes
Added
ids=["default-env", "custom-env"]to environment parametrizations in:tests/unit/bases/test_almalinux.py(2 occurrences)tests/unit/bases/test_centos_7.py(2 occurrences)tests/unit/bases/test_ubuntu_buildd.py(2 occurrences)No functional changes. Test IDs now render as
test_setup[...-default-env-...]instead of embedding raw byte string values.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.sh/usr/bin/curl curl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Error when setting up almalinux test</issue_title>
<issue_description>### Bug Description
We got an error when setting up an almalinux test: https://github.com/canonical/craft-providers/actions/runs/19582107478/job/56082351892?pr=852
To Reproduce
https://github.com/canonical/craft-providers/actions/runs/19582107478/job/56082351892?pr=852
part yaml
Relevant log output