choco
choco copied to clipboard
(#798, #2787, #1185) Add or update tests for side by side installs, pin during install/upgrade, hook scripts
Description Of Changes
Add or update tests for side by side installations being deprecated, pin package during install and upgrade, and hook scripts.
Motivation and Context
- The tests for side by side installation deprecation inadvertently missed restoring the snapshot, this does that restore so the tests past in Test Kitchen.
- The ability to pin a package during installation and upgrade was recently added. This adds tests for that to ensure it's pinning packages as expected.
- The ability to have pre and post action hooks was added. This adds end to end testing to ensure they're working as expected.
Testing
- Pulled down the package build by Team City
- Used that package in Test Kitchen to run these tests.
- Manually ran some
choco installcommands to ensure that there are no warnings about$env:ChocolateyInstall/hooksnot being found.
Change Types Made
- [x] Bug fix (non-breaking change)
- [x] Feature / Enhancement (non-breaking change)
- [ ] Breaking change (fix or feature that could cause existing functionality to change)
- [ ] PowerShell code changes.
Related Issue
Related to:
- #798
- #2787
- #1185
- https://app.clickup.com/t/20540031/ENGTASKS-1480
Change Checklist
- [ ] Requires a change to the documentation
- [ ] Documentation has been updated
- [x] Tests to cover my changes, have been added
- [x] All new and existing tests passed.
- [ ] PowerShell v2 compatibility checked.
Coverage decreased (-0.002%) to 27.578% when pulling 794bf67b80bd1edbc0fbcc80c840cdc3b516dc5b on corbob:a798-pin-package into d08d1f63cc74f3e18e2e653a0a95f4c39d1b7077 on chocolatey:develop.
Task linked: ENGTASKS-1480 Chocolatey CLI
I've fixed up those exit codes @AdmiringWorm so they should all pass now. It seems I forgot which packages were being used where and when to expect 0 and -1 😅
@corbob thank you for getting this added and fixed up 👍