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

Attempt to fix issues with Set-EnvironmentVariable #3456

Closed
wants to merge 26 commits into from

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented May 29, 2024

Description Of Changes

  • Run setx process directly instead of running via PowerShell

Motivation and Context

ruling something out, mainly

Testing

test kitchen 😔

Operating Systems Testing

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #

gep13 and others added 23 commits May 28, 2024 02:13
Now, when you have useEnhancedExitCodes turned on, if you try to set a
pin on a package, that is already set, the exit code will change to be
a 2, giving a clear indication that no action was taken.

This commit adds a Pester test to verify that this works as expected.
Now, when you have useEnhancedExitCodes turned on, if you try to
enable/disable a feature that is already in the desired state, the exit
code will change to be a 2, giving a clear indication that no action was
taken.

This commit adds a Pester test to verify that this works as expected.
Now, when you have useEnhancedExitCodes turned on, if you try to
add an apikey when it is already added the exit code will change to be
a 2, giving a clear indication that no action was taken.

This commit adds a Pester test to verify that this works as expected.
Now, when you have useEnhancedExitCodes turned on, if you try to
unset a config value that doesn't exist, or try to set a config value
where the value is already set to that value, the exit code will change
to be a 2, giving a clear indication that no action was taken.

This commit adds a Pester test to verify that this works as expected.
Now, when you have useEnhancedExitCodes turned on, if you try to
add an already existing source, remove a source that doesn't exist,
disable a source that is already disabled, or enable a source that is
already enabled, the exit code will change to be a 2, giving a clear
indication that no action was taken.

This commit adds a Pester test to verify that this works as expected.
Now, when you have useEnhancedExitCodes turned on, if you try to
upgrade a package, whether directly, or via the all keyword, and there
are no upgrade available, the exit code will change to be a 2, giving a
clear indication that no action was taken.

This commit adds a Pester test to verify that this works as expected.
This commit adds some Pester tests to ensure that any attempts to run
the choco install all command is correctly handled when targeting
an alternative source.  This is simply asserting that there is an
error exit code, and that the correct output is displayed.

Some of the new tests are specifically set to only run on Test-Kitchen,
as there is the potential for changes to happen on the host machine,
and we don't want to impact people.
Remembered arguments can now be displayed when running the choco info
command, using the --local-only option.

This commit adds a test to verify that this is correctly shown.
Something has changed in the output that is coming back from the CCR
when pushing a package, and that package fails. It is not immediately
clear what has changed, but the assertions are being updated to allow
the tests to pass, and we can monitor this going forward to see if
something changes again.
In these release, it is now possible to include already configured
sources, i.e. in the chocolatey.config file, using an option on the
info, install, outdated, search, and upgrade commands.

This commit adds tests to cover these being included.
In the next release, when possible, Chocolatey CLI will now include
package hash validation to ensure that the package being installed is
the one that the server thinks it is. This is a feature flag that needs
to be toggled on.

This commit adds tests to cover that hash validation is being attempted
when it can be.
The next release includes a new choco rule command, that allows
displaying information about the validation rules that are currently in
use by Chocolatey CLI.

This commit adds basic Pester tests for exercising this command, along
with its subcommands.
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
In Test Kitchen, for some reason, the ChocolateyInstall Environment
Variable is not being pulled through to the Testing process's session.
This adds a check to the Common-Helpers Module to force the variable to
be set if it is not set.
Attempting to fix Pester tests on Test-Kitchen during pairing session
with Cory.
update set-environmentvariable test to improve output quality
update update-sessionenvironment test to be testing for the right thing
Weird issues with vars not getting propagated back to current scope.

Let's try something.
@corbob corbob changed the base branch from develop to release/2.3.0 May 29, 2024 21:08
@vexx32
Copy link
Member Author

vexx32 commented May 30, 2024

Investigation here has completed, relevant commits from this investigation will be included in #3452 instead.

@vexx32 vexx32 closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants