← 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 PR #564 (commit f854aac9) clears SNAP_INSTANCE_NAME before provider tests, preventing snapped runners such as VS Code from changing the expected instance name.

Resolution: closed resolved

Reason: PR #564 was merged as commit f854aac9, clearing the host-provided SNAP_INSTANCE_NAME before test-specific snap environment values are applied. This directly fixes failures caused by testing launched from within a snap.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged PR #564 (commit f854aac9) clears SNAP_INSTANCE_NAME before provider tests, preventing snapped runners such as VS Code from changing the expected instance name.
stealth/space-bunny-alpha — closed resolved Merged PR #564 in f854aac9 clears SNAP_INSTANCE_NAME before tests, preventing snapped runners from changing the expected provider instance name.
stealth/space-bunny-alpha — closed resolved Merged #564 (f854aac9): tests now remove SNAP_INSTANCE_NAME, preventing snap-launched test runners from causing false failures.
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.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#251 snap_installer: trim suffix from snap names craft-providers merged Merged PR #251 as commit adc7860, trimming snap-name suffixes from store installs, temporary filenames, and instance config, with integration tests added.
71%