chocolatey / chocolatey/choco

Clarify the Snapshots used in Tests

Open
#2,715 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog Tests
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

## Is Your Feature Request Related To A Problem? Please describe.

For the Pester Tests, we have a few `ChocolateySnapshot` helper functions. It's not immediately clear what they're for, or which case warrants which function.

## Describe The Solution. Why is it needed?

It seems that most times we don't need the `New-ChocolateySnapshot` function and instead should be using `Restore-ChocolateySnapshot`. If there are no cases where we would actually need to move up the stack of snapshots, then the proposal would be to remove the `Restore-ChocolateySnapshot` function and update `New-ChocolateySnapshot` to do the removal of previous snapshots first...

At the very least we should better document what the snapshotting is doing, and how to make use of it in tests.

## Additional Context.

Working on adding tests for the licensed extension and we ran into some confusion as to which one to use when.

## Related Issues

https://gitlab.com/chocolatey/build-automation/chocolatey-test-kitchen/-/issues/16

Contributor guide

Open the contributing guide

Research direction

Start by locating the Pester test helpers named New-ChocolateySnapshot and Restore-ChocolateySnapshot and read their current behavior. Document what each snapshot function is for and which test situations require it; if the proposed simplification is valid, record the expected helper changes and update affected tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
documentation, testing-qa
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.