Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMD.exe activation test #13159

Merged
merged 7 commits into from
Sep 28, 2023
Merged

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Sep 28, 2023

Description

Looks like git moved on the GitHub runner (?) (or perhaps it changed on conda-forge?) so the CMD.exe test started to fail. Fixed the issue by being more careful with how we "reset" the PATH for the CMD.exe test.

Merging this to the 23.9.x release branch since we need this fix in order to merge #13155 (we will also need this fix for any 23.9.x patches and the upcoming 23.10.x special release).

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@kenodegard kenodegard self-assigned this Sep 28, 2023
@kenodegard kenodegard changed the base branch from main to 23.9.x September 28, 2023 16:21
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Sep 28, 2023
@kenodegard kenodegard changed the base branch from 23.9.x to main September 28, 2023 19:05
@kenodegard kenodegard changed the base branch from main to 23.9.x September 28, 2023 19:06
@kenodegard kenodegard changed the title Debugging cmd activate Fix CMD.exe activation test Sep 28, 2023
@kenodegard kenodegard marked this pull request as ready for review September 28, 2023 19:08
@kenodegard kenodegard requested a review from a team as a code owner September 28, 2023 19:08
self.expect(".*\n")
else:
self.expect("%s\n" % value)
self.expect(f"{value}\r?\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-handle \r\n and \n.

prefix, charizard, _ = shell_wrapper_integration
conda_bat = Path(CONDA_PACKAGE_ROOT, "shell", "condabin", "conda.bat")
monkeypatch.setenv("PATH", STRIPPED_PATH)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monkeypatch.setenv instead of env_vars

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we use conda env_vars because it resets the context? Will that be a problem compared to monkeypatch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been trying to move away from env_var(s)? in general

In this case resetting the context has no impact since the context doesn't do anything with PATH

@kenodegard kenodegard enabled auto-merge (squash) September 28, 2023 21:25
@kenodegard kenodegard merged commit e870cd4 into conda:23.9.x Sep 28, 2023
66 of 67 checks passed
@kenodegard kenodegard deleted the debugging-cmd-activate branch September 28, 2023 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants