-
Notifications
You must be signed in to change notification settings - Fork 916
(maint) Correct some typos and fix some tests #3589
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
Conversation
This PR is draft until I can run the tests through Test Kitchen. I also need to update the testing steps to validate that the test failure is gone, but will need to think on the best way to do that. |
A few things I need to update about this before it's out of WIP. Adding here so I don't forget:
|
@gep13 I was looking at some of these tests, and although I wanted to get a few more things in here, I've paired this down to things that I think will help you with the next release (in particular the upgrade all test fix). (I've added this PR to the document for our weekly meeting if we want to discuss it) |
Sometimes tests in Test Kitchen are run against versions of Chocolatey that are available on the setup repository, and so they are found as part of upgrade testing. The tests don't need these newer Chocolatey versions, nor do we expect to find them. This excludes all of the packages that are known to be on testing environments but not part of the test in question. This is to reduce the number of false positive tests we have, especially as we come up to a release.
The $variables passed to the ForEach for these tests was found to be null, and so these tests weren't actually running. Upon looking at the tests, determined the ForEach variable was unintentional and was removed. The tests get the variable names in one order, and the .Net method to get the names presents them in a different order. Changed this to sort the list for both of them so that the Pester tests were consistent.
We use the Chocolatey Test Environment for testing packages on the Chocolatey Community Repository, so we should probably use it here for testing Chocolatey itself. This also adds a copy of the `testResults.xml` generated by Pester from the test system to the host system so it can be analyzed.
Ignore the file if it's testresult.xml or testresults.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@corbob thank you for getting these updates done! I will get this merged in once the CI builds are finished. |
@corbob thank you for getting these updates done! |
Description Of Changes
choco list -lo
from the NuSpec file.upgrade all
test to ensure that it does not report failure if a newer Chocolatey version is available on internal repositories.PowerShell
instead ofpowershell
.Get-EnvironmentVariableNames
tests to run.chocolatey/test-environment
box.Motivation and Context
list
command was removed in 2.0, and is an error now.2.4.1-beta-20241204
, but because of the way the builds work, CI will have build and published to our repository version2.5.0-alpha-20241204
which is deemed an upgrade for the pre-release version being tested.chocolatey/test-environment
box, so running out tests on it makes sense.Testing
vagrant up
in thetests
directory. (There are some known failures here, the important thing is that the majority of them run successfully)Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
N/A - These are things that I found doing the recent 2.4.1 release.