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: Pattern to provide additional files in scenario test #273

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

joshspicer
Copy link
Member

@joshspicer joshspicer commented Nov 8, 2022

tracking: #139

This PR defines a pattern for optionally providing additional files needed at build time for a scenario (eg: Dockerfile, build scripts, etc...).

In a Features test folder (eg: ./test/python/), the contents of a folder with the same name as a given scenario (eg: ./test/python/my-cool-scenario for my-cool-scenario) will be copied into the auto-generated .devcontainer folder used during the build.

For example, given a scenario defined in a scenarios.json:

// ...
	"frowning_with_a_dockerfile": {
		"build": {
			"dockerfile": "Dockerfile"
		},
		"features": {
			"smile": {
				"shouldFrown": true
			}
		}
	}
// ... 

The following file tree will result in a succeeding test

.
├── src
│   └── smile
│       ├── devcontainer-feature.json
│       └── install.sh
└── test
    └── smile
        ├── frowning.sh
        ├── frowning_with_a_dockerfile  <------------ new folder   
        │   └── Dockerfile              <----- gets copied over to generated .devcontainer
        ├── frowning_with_a_dockerfile.sh
        ├── scenarios.json
        ├── smiling.sh
        └── test.sh

image

@joshspicer joshspicer changed the title features test: Pattern to provide additional files in test features test: Pattern to provide additional files in scenario test Nov 8, 2022
@joshspicer joshspicer marked this pull request as ready for review November 8, 2022 23:36
@joshspicer joshspicer requested a review from a team as a code owner November 8, 2022 23:36
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.

👍

@joshspicer joshspicer merged commit d9ee377 into main Nov 14, 2022
@joshspicer joshspicer deleted the joshspicer/test-cmd-additional-files branch November 14, 2022 17:33
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.

2 participants