Skip to content

Commit

Permalink
chore(doc): Update tests sections (#512)
Browse files Browse the repository at this point in the history
Specify Goss expected yaml ext
  • Loading branch information
Thibaut-gauvin authored Apr 19, 2024
1 parent 9e0dc7b commit 2d5f6c2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@ To get started with goss tests, follow the steps below:

Follow the procedure from the [official docs](https://github.com/goss-org/goss#installation)

1. Ensure the goss tests are enabled in configuration:
2. Ensure the goss tests are enabled in configuration:
```yaml
# .dib.yaml
include_tests:
- goss
```
1. Create a `goss.yml` file next to the Dockerfile of the image to test
3. Create a `goss.yaml` file next to the Dockerfile of the image to test
```
debian/
├── Dockerfile
└── goss.yml
└── goss.yaml
```

1. Add some assertions in the `goss.yml`
4. Add some assertions in the `goss.yaml`
Basic Example:
```yaml
command:
'echo "Hello World !"':
'check "hello-world" version':
exec: 'hello-world --version'
exit-status: 0
stdout:
- 'Hello World !'
- '/^hello-world version [0-9]+\.[0-9]+\.[0-9]+ linux\/amd64$/'
```

Read the [Goss documentation](https://github.com/goss-org/goss#full-documentation) to learn all possible assertions.

0 comments on commit 2d5f6c2

Please sign in to comment.