A Busser runner plugin that runs bash scripts as integration tests.
Busser installs this plugin on the machine under test and hands it every file in
the suite's bash directory. Each script is run with bash, and its exit code
decides whether the test passed — so any script that already uses set -e, or
ends in a command whose status you care about, is a working test with no
framework to learn.
This software project is no longer under active development as it has no active maintainers. The software may continue to work for some or all use cases, but issues filed in GitHub will most likely not be triaged. If a new maintainer is interested in working on this project please come chat with us in #test-kitchen on Chef Community Slack.
Ruby 3.2 or newer, and busser 0.9.0 or newer.
Busser installs the plugin for you when Test Kitchen runs the suite, so there is usually nothing to do. To install it by hand:
busser plugin install busser-bashPut your scripts in the bash directory of a suite:
test
`-- integration
`-- default # suite name
`-- bash
|-- my_test.sh
`-- other_spec.bash
Only files matching *_{test,spec}.{sh,bash} are picked up. A file named
helper.sh sitting alongside them is ignored, which is a convenient way to keep
shared setup out of the run.
A script passes when it exits 0:
#!/usr/bin/env bash
set -euo pipefail
test -f /usr/local/foobar.txt
grep -q "hello" /usr/local/foobar.txtTest Kitchen picks the plugin up from the suite directory name — no verifier configuration is needed beyond the default busser verifier.
This is how most people run it, and it needs no Busser commands of your own.
Select the verifier in kitchen.yml:
verifier:
name: busser
suites:
- name: defaultThen put your tests in a bash directory inside the suite:
test/integration/default/bash/smoke_test.sh
kitchen verify installs Busser and this plugin on the instance and runs them.
The directory name is what selects this plugin -- there is nothing else to
configure.
If the suite files do not match what this plugin looks for, the run prints one
line and exits 0:
-----> Running bash test suite
No tests ran, and nothing said so. Work through these in order:
- Is the directory named
bash? That name alone selects this plugin.bashs/,tests/or anything else is not picked up. - Do the filenames match? Only
*_test.sh,*_test.bash,*_spec.shand*_spec.bashare run --mytest.shis not picked up. - Is the plugin installed?
busser plugin listshows what is available. - Is
BUSSER_ROOTwhat you think?busser suite pathprints where suites are actually being looked for.
Bug reports and pull requests are welcome. See CONTRIBUTING.md for how to set up the project, run the test suite, and format your commits.
Apache License 2.0. See LICENSE.
Originally created by Fletcher Nichol.