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

docs(readme): Add more details about bats tags #40

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Available keys](#available-keys)
- [Usage](#usage)
- [Test your DDEV add-on](#test-your-ddev-add-on)
- [`bats` tags and the `test_command` input](#bats-tags-and-the-test_command-input)
- [License](#license)
- [Contribute](#contribute)

Expand Down Expand Up @@ -167,6 +168,8 @@ Not required.

Default: `""`.

For more details, see [below](#bats-tags-and-the-test_command-input).

---

## Usage
Expand Down Expand Up @@ -219,6 +222,30 @@ jobs:
addon_ref: ${{ env.GITHUB_REF }}
```

#### `bats` tags and the `test_command` input

By default, this GitHub action is configured to exclude `release` tagged tests during _push_ and
_pull_request_ workflows by using the `bats tests --filter-tags '!release'` command.

For other workflows, the default command is `bats tests`, meaning all tests, regardless of their tags, will run.

To tag a test with a `release` tag, add `# bats test_tags=release` above the `@test` line in your bats file:

```bash
# bats test_tags=release
@test "install from release" {
...
<run your test here>
...
}
```

This setup keeps release-specific tests out of everyday workflows unless you set a custom `test_command`.

For more information on `bats` tags and filtering tests by tags, refer to the [bats documentation](https://bats-core.readthedocs.io/en/stable/writing-tests.html#tagging-tests).



## License

[Apache](LICENSE)
Expand Down