Skip to content

Features Test Cmd: "Duplicate" test mode to test Feature Idempotence - #553

Merged
joshspicer merged 12 commits into
mainfrom
joshspicer/idempotencytest
Jun 20, 2023
Merged

joshspicer merged 12 commits into
mainfrom
joshspicer/idempotencytest

Conversation

@joshspicer

@joshspicer joshspicer commented Jun 14, 2023 •

Copy link
Copy Markdown
Contributor

ref: https://github.com/github/codespaces/issues/14081

This change adds a new mode that will be automatically executed if a duplicate.sh test script is added to a Feature's test directory. This change will generate a dev container where a given Feature is installed twice in a row. This is to allow Feature authors to make assertions about what should happen if the exact Feature (with different options) is executed more than once.

The first Feature installed will have random options based on the information in the devcontainer-feature.json. The second Feature will be installed with the default options. The test script duplicate.sh will have both the random options and the default options available as environment variables to help write an accurate test.

The intention here is is that authors can write tests asserting (1) every Feature that opts-in to this test by adding a duplicate.sh will always succeed when it is installed >1 times and (2) there is predictable behavior (what Feature is on the path?) no matter what combination of options is provided

@joshspicer
joshspicer marked this pull request as ready for review June 14, 2023 21:44
@joshspicer
joshspicer requested a review from a team as a code owner June 14, 2023 21:44

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left one comment.

@joshspicer
joshspicer force-pushed the joshspicer/idempotencytest branch from 4bd2489 to f5e9af8 Compare June 15, 2023 18:28
@joshspicer
joshspicer force-pushed the joshspicer/idempotencytest branch from 8c89409 to fc933f6 Compare June 15, 2023 19:19
@joshspicer
joshspicer enabled auto-merge (squash) June 19, 2023 22:12
@joshspicer
joshspicer merged commit ca2dec6 into main Jun 20, 2023
@joshspicer
joshspicer deleted the joshspicer/idempotencytest branch June 20, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants