choco icon indicating copy to clipboard operation
choco copied to clipboard

(#798, #2787, #1185) Add or update tests for side by side installs, pin during install/upgrade, hook scripts

Open corbob opened this issue 3 years ago • 2 comments

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

  1. Pulled down the package build by Team City
  2. Used that package in Test Kitchen to run these tests.
  3. Manually ran some choco install commands to ensure that there are no warnings about $env:ChocolateyInstall/hooks not 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.

corbob avatar Sep 21 '22 01:09 corbob

Coverage Status

Coverage decreased (-0.002%) to 27.578% when pulling 794bf67b80bd1edbc0fbcc80c840cdc3b516dc5b on corbob:a798-pin-package into d08d1f63cc74f3e18e2e653a0a95f4c39d1b7077 on chocolatey:develop.

coveralls avatar Sep 21 '22 01:09 coveralls

Task linked: ENGTASKS-1480 Chocolatey CLI

choco-bot avatar Sep 21 '22 16:09 choco-bot

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 avatar Sep 26 '22 14:09 corbob

@corbob thank you for getting this added and fixed up 👍

AdmiringWorm avatar Sep 26 '22 14:09 AdmiringWorm