Skip to content

Commit

Permalink
Merge pull request #193 from buildkite-plugins/toote_plugin_tester
Browse files Browse the repository at this point in the history
Use Plugin Tester
  • Loading branch information
pzeballos committed Apr 4, 2023
2 parents 3793964 + 826ae5d commit 3bfa5df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
18 changes: 10 additions & 8 deletions .buildkite/pipeline.yml
@@ -1,17 +1,19 @@
steps:
- label: ":bash: Plugin"
plugins:
docker-compose#v4.9.0:
run: plugin
- plugin-tester#v1.0.0: ~

- label: ":ruby: Ruby"
plugins:
docker-compose#v4.9.0:
run: ruby
- docker-compose#v4.11.0:
run: ruby

- label: "✨ Lint"
plugins:
plugin-linter#v3.0.0:
id: junit-annotate
- plugin-linter#v3.1.0:
id: junit-annotate

- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.3.0:
files: hooks/*
- shellcheck#v1.3.0:
files: hooks/*
16 changes: 10 additions & 6 deletions README.md
Expand Up @@ -84,18 +84,22 @@ Default: `ruby:3.1-alpine@sha256:a39e26d0598837f08c75a42c8b0886d9ed5cc862c4b5356

## Developing

To test the plugin hooks (in Bash) and the junit parser (in Ruby):
To run testing, shellchecks and plugin linting use use `bk run` with the [Buildkite CLI](https://github.com/buildkite/cli).

```bash
docker-compose run --rm plugin &&
docker-compose run --rm ruby
bk run
```

Or if you want to run just the plugin tests, you can use the docker [Plugin Tester](https://github.com/buildkite-plugins/buildkite-plugin-tester):

```bash
docker run --rm -ti -v "${PWD}":/plugin buildkite/plugin-tester:latest
```

To test the Ruby parser locally:
To test the Ruby code with `rake` in docker:

```bash
cd ruby
rake
docker-compose run --rm ruby
```

To test your plugin in your builds prior to opening a pull request, you can refer to your fork and SHA from a branch in your `pipeline.yml`.
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.yml
@@ -1,11 +1,5 @@
version: '2'
services:
plugin:
image: buildkite/plugin-tester:v4.0.0
volumes:
- ".:/plugin"
depends_on:
- ruby
ruby:
image: ruby:3.1-alpine@sha256:a39e26d0598837f08c75a42c8b0886d9ed5cc862c4b535662922ee1d05272fca
command: rake
Expand Down

0 comments on commit 3bfa5df

Please sign in to comment.