Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,50 @@ started:
👩‍⚖️ When contributing code to this project, you may be asked to agree to our
[Contributor License Agreement].

## Testing

The [devcontainer CLI] is used to run the tests in this repository. Install it with:

```bash
npm install -g @devcontainers/cli
```

### Run all tests

To run the tests for **every** Feature in this repository, run the following commands from the root of the repository:

```bash
# Run auto-generated and scenario tests for every Feature
devcontainer features test .

# Run the global test scenarios
devcontainer features test --global-scenarios-only .
```

### Test a specific Feature

To test a specific Feature (e.g. `go`):

```bash
devcontainer features test -f go .
```

### Test against a specific base image

By default tests run against `mcr.microsoft.com/devcontainers/base:ubuntu`. Use the `--base-image` (or `-i`) flag to specify a different image:

```bash
devcontainer features test -f go -i ubuntu:focal .
```

### Run only scenario tests

Use `--skip-autogenerated` to run only the [scenario tests] defined in `test/<feature>/scenarios.json`:

```bash
devcontainer features test -f go --skip-autogenerated .
```

<!-- prettier-ignore-start -->
[our dev container community Slack channel]: https://aka.ms/devcontainer_community
[open an issue]: https://github.com/devcontainers/features/issues/new
Expand All @@ -57,4 +101,6 @@ started:
[contributor license agreement]: https://opensource.microsoft.com/cla/
[Test your changes using `devcontainer features test`]: https://github.com/devcontainers/cli/blob/main/docs/features/test.md
[semver]: https://semver.org/
[devcontainer CLI]: https://github.com/devcontainers/cli
[scenario tests]: https://github.com/devcontainers/cli/blob/main/docs/features/test.md#scenarios
<!-- prettier-ignore-end -->
Loading