Skip to content

test_which: do not mutate os.environ (#41215)#41215

Merged
tgamblin merged 1 commit intospack:developfrom
haampie:fix/os-dot-environ
Nov 22, 2023
Merged

test_which: do not mutate os.environ (#41215)#41215
tgamblin merged 1 commit intospack:developfrom
haampie:fix/os-dot-environ

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Nov 22, 2023

closes #41214

Uncovered by xdist reordering test execution, there's (at least?) one test that modifies os.environ globally.

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality tests General test capability(ies) labels Nov 22, 2023
alalazo
alalazo previously approved these changes Nov 22, 2023
@haampie haampie force-pushed the fix/os-dot-environ branch 3 times, most recently from ea73fc3 to 272d23e Compare November 22, 2023 16:21
@tgamblin
Copy link
Copy Markdown
Member

What's the goal of removing working_env?

@haampie
Copy link
Copy Markdown
Member Author

haampie commented Nov 22, 2023

The PR is about fixing unit test failures in GitHub Actions that seemingly all have to do with environment variables being empty / unset.

The only thing @alalazo found was an xdist upgrade that maybe changes the order in which tests are scheduled, so there's likely an pre-existing issue

@haampie
Copy link
Copy Markdown
Member Author

haampie commented Nov 22, 2023

@alalazo actually rhel is failing now, probably due to PYTHONPATH not being set, but there we don't even use xdist

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 22, 2023

Can we use this #41214 and add a revert commit to this PR (to be merged when ready?)

@haampie
Copy link
Copy Markdown
Member Author

haampie commented Nov 22, 2023

Pretty confident the issue is fixed now, I accidentally broke unrelated tests previously.

@tgamblin tgamblin changed the title tests: os.environ fixes tests: fix os.environ pollution in test_which Nov 22, 2023
@tgamblin tgamblin changed the title tests: fix os.environ pollution in test_which test_which: do not mutate os.environ (#41215) Nov 22, 2023
@tgamblin tgamblin enabled auto-merge (rebase) November 22, 2023 21:50
@tgamblin tgamblin changed the title test_which: do not mutate os.environ (#41215) test_which: do not mutate os.environ (#41215) Nov 22, 2023
@haampie
Copy link
Copy Markdown
Member Author

haampie commented Nov 22, 2023

There are a few other cases but they just add an env variable which is not very disruptive... will submit a separate cleanup pr tomorrow.

@tgamblin tgamblin merged commit 61055d9 into spack:develop Nov 22, 2023
@haampie haampie added this to the v0.21.1 milestone Nov 23, 2023
@haampie haampie deleted the fix/os-dot-environ branch November 23, 2023 07:19
@haampie haampie mentioned this pull request Nov 23, 2023
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands core PR affects Spack core functionality tests General test capability(ies) utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants