Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 12 commits into from Jun 20, 2023

Conversation

joshspicer
Copy link
Member

@joshspicer joshspicer commented Jun 14, 2023

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
Copy link
Contributor

@chrmarti chrmarti left a comment

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.

src/spec-node/featuresCLI/testCommandImpl.ts Outdated Show resolved Hide resolved
chrmarti
chrmarti previously approved these changes Jun 16, 2023
@joshspicer joshspicer requested a review from chrmarti June 19, 2023 21:58
@joshspicer joshspicer enabled auto-merge (squash) June 19, 2023 22:12
@joshspicer joshspicer merged commit ca2dec6 into main Jun 20, 2023
37 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants