Skip to content

test(tests): give the runtime folder directly in two tests - #6538

Merged
dan-petty merged 2 commits into
mainfrom
test/6533-runtime-folder-tests
Nov 20, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/6533-runtime-folder-tests

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

platformdirs 4.14.8 (#6506) accepts XDG_RUNTIME_DIR only below parents that no other user can replace. In the Service image test container the parents of tmp_path fail that check, so platformdirs gives its own folder, and two tests of tests/core/test_process.py fail on Service Image Tests shard 6. The code of devops-cli is right: it uses the folder that platformdirs gives. The two tests now set platformdirs.user_runtime_path, as the test of a runtime folder in the current folder does, so they test devops-cli and not the checks of platformdirs.

Closes #6533

Change: openspec/changes/archive/2026-11-20-6533-runtime-folder-tests/

…6533)

platformdirs 4.14.8 accepts XDG_RUNTIME_DIR only below parents that no other user can replace. In the Service image test container the parents of tmp_path fail that check, so platformdirs falls back and the two tests fail. The tests now set user_runtime_path, as the test of a runtime folder in the current folder does, so they test the code of devops-cli and not the checks of platformdirs.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/tests The test suite, its fixtures, fakes and floor labels Nov 20, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Proof. Service Image Tests do not run on this pull request (the paths filter skips a change of tests only), so the failure condition was made locally: a pytest base folder with mode 0777 and no sticky bit, so the parents of tmp_path are replaceable, as in the Service image test container.

  • main version of the two tests: 2 failed. platformdirs refused the runtime folder of the test and gave its own folder (/run/user/1000/devops-cli-gh-.../hosts.yml, which the host-path guard of the suite stops). In CI the same refusal gave the temp folder (job 136415787802).
  • This branch: 2 passed.
  • uv run devops ci test tests/core/test_process.py: 52 passed. CI on 25b95d2: 19 success, 4 skipped, 0 failed.

@dan-petty
dan-petty marked this pull request as ready for review November 20, 2026 17:06
@dan-petty
dan-petty merged commit 908ff3c into main Nov 20, 2026
23 checks passed
@dan-petty
dan-petty deleted the test/6533-runtime-folder-tests branch November 20, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(core): token folder tests fail in the Service image

1 participant