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

Improving docs about test script creation #560

Merged
merged 5 commits into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [render, r \- Render gossfile after importing all referenced gossfiles](#render-r---render-gossfile-after-importing-all-referenced-gossfiles)
* [serve, s \- Serve a health endpoint](#serve-s---serve-a-health-endpoint)
* [validate, v \- Validate the system](#validate-v---validate-the-system)
* [Goss test creation](#goss-test-creation)
* [Important note about goss file format](#important-note-about-goss-file-format)
* [Available tests](#available-tests)
* [addr](#addr)
Expand Down Expand Up @@ -322,6 +323,29 @@ $ echo $?
2
```

## Goss test creation
Goss tests can be created by using either of following methods.
1. goss autoadd <resource to test>
2. goss add <resource to test>
3. manually create YAML/JSON test file by hand.

To customize the parameters generated by `goss add` and `goss autoadd` YAML file you need to manually edit it.

`goss add package nginx` will generate below YAML
```
package:
nginx:
installed: true
versions:
- 1.17.8
```
To test uninstall scenario you would need to manually edit it and set it as below.
```
package:
nginx:
installed: false
```

## Important note about goss file format
It is important to note that both YAML and JSON are formats that describe a nested data structure.

Expand Down