← Back to issue list

fix(test): remove env var set by snapped testing programs

View original Github issue

Metadata

Project
craft-application
Number
#564
Type
pull request
State
merged
Author
bepri
Labels
Created
Updated
Closed

Current evaluation

Merged a fix for test failures caused by the SNAP_INSTANCE_NAME environment variable during snapped execution. The change removes it before tests to ensure consistent behavior. Approved by two reviewers and passed CI checks.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the guidelines for contributing? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `tox`? ----- Two particular tests would, down the line, run a check against `os.getenv("SNAP_INSTANCE_NAME")` and default to a known value if it was unset. If these tests were ran directly in a standard ("non-snapped") program, this was fine. However, when running it using a snapped program (in my case, snapped VS Code's integrated testing tools), `SNAP_INSTANCE_NAME` will be set to the name of that program (again, in my case, `code`). Since the known value was never assigned, the test could not know what string to look for, causing this test to fail. To avoid this failure, this PR removes that potentially confusing environment variable before running the test.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged a fix for test failures caused by the SNAP_INSTANCE_NAME environment variable during snapped execution. The change removes it before tests to ensure consistent behavior. Approved by two reviewers and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 Merged a fix for test failures caused by SNAP_INSTANCE_NAME being set in snapped environments. The change clears the variable before test execution to ensure consistent behavior. Unrelated linter warnings were addressed separately.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2130 tests: remove obsolete env var snapcraft merged Merged removal of the obsolete SNAPCRAFT_SEND_ERROR_DATA environment variable from tests following underlying logic deletion. Approved by one reviewer with passing CI checks, the update deletes four lines across one file.
74%
#2352 tests: use valid snap names in unit tests snapcraft merged Merged updates to unit tests that replace invalid snap names with valid ones, ensuring compatibility with snap pack --check-skeleton. The author approved and merged the minor change directly without external review.
71%