Test helpers for verifying version information should throw an exception if choco exits non-zero
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### What You Are Seeing?
When testing CCM against invalid licenses, the test was [failing due to restarting the CCM services in the wrong way](https://gitlab.com/chocolatey/build-automation/chocolatey-test-kitchen/-/issues/61). This was determined to be caused by https://github.com/chocolatey/chocolatey-licensed-issues/issues/330, so our script couldn't determine that CCM was greater than version `0.6.2`
### What is Expected?
The helper should throw an exception (or otherwise cause an error) if it can't get package information.
### How Did You Get This To Happen? (Steps to Reproduce)
With Chocolatey CLI 1.2.0 and Chocolatey Licensed Extension 5.0.0 installed:
1. Remove `chocolatey.license.xml`
2. Run `Test-PackageIsEqualOrHigher -Package chocolatey -Version 1.0.0`
3. Note that it returns false
### System Details
* OS Build (In PowerShell run `[System.Environment]::OSVersion.version.tostring()`): Windows Server 2019
* Windows PowerShell version (Run: `$PSVersionTable`): 5.1
* Chocolatey version (Run `choco --version`): 1.2.0
### Output Log
NA
Contributor guide
Research direction
Start with the Test-PackageIsEqualOrHigher helper and reproduce the documented command after removing chocolatey.license.xml. Done means the helper raises an exception or otherwise reports an error when it cannot obtain package information, rather than returning false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100