Skip to content

features test: Pattern to provide additional files in scenario test - #273

Merged
joshspicer merged 3 commits into
mainfrom
joshspicer/test-cmd-additional-files
Nov 14, 2022
Merged

joshspicer merged 3 commits into
mainfrom
joshspicer/test-cmd-additional-files

Conversation

@joshspicer

@joshspicer joshspicer commented Nov 8, 2022 •

Copy link
Copy Markdown
Contributor

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 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

@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.

👍

@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

2 participants