Coyote is a test agent. It uses a yml configuration file with commands to setup (stdin, env vars, etc) and run. It checks the output for errors and may further search for the presence or absence of specific regular expressions. Finally it creates a html report with the tests, their outputs and some statistics.
Part of Landoop™ test suite
The only requirement is the Go Programming Language, at least version 1.10+.
$ go get -u github.com/landoop/coyote
This command will install the Coyote in $PATH (setup your $GOPATH/bin if you didn't already).
Getting your tests ran by the
coyote -c command.
$ coyote -c my-test.yml -c my-second-test.yml # or -c ./my-tests-folder to load all yaml tests from a particular folder
The above command will run against those tests described in the passed test files and will generate a rich report inside the
./coyote.html template file before exit. The exit code of coyote is the number of failed tests, up to 254 failed tests.
For 255 or more failed tests, the exit code will remain at 255.
coyote.html template file needs a web server to be displayed correctly, you can use any web server to achieve this, like iris or python's httpserver module, it's up to you, i.e
cd ./my-tests-folder && python -m http.server 8000, open a new browser tab and navigate to the http://localhost:8000/coyote.html.
Note that coyote stores the stderr and stdout of each command in memory, so it isn't suitable for testing commands with huge outputs
Sample entry in configuration yml file, overview of workdir, nolog and partially match of the standard output:
- name: Test 1 entries: - name: Command 1 command: ls / stdout: - match: ["my-folder", "my-file.txt"] partial: true - name: Command 2 command: ls workdir: /home - command: ls /proc nolog: true
nameis the test's group name,
entriescontains the tests under that group, groups are seen separated in the report page (
commandis the shell command that we want to test its output, it's required,
stdoutwill compare the command's output with the slice of text inside it, you can add more than one expected output,
partial: trueunder the
stdoutwill tell the tester that we don't want to do an exact matching, just check if "my-folder" or "my-file.txt" is part of the command's output.
nologtells the tester that we don't want to log anything from that particular command in the
Timeout will stop the command's execution when duration passed.
- name: Test 2 entries: - name: Long running command command: cat timeout: 300s stdin: hello
An option you may add to your groups or per command is
skip. This option will
skip the test if set to (case insensitive)
true. Please note that this isn't
a boolean option but rather a string.
The idea behind it is that you can have a test like this:
- name: test 1 skip: _test1_ entries: ... ... - name: test 2 skip: _test2_ entries: ... ...
And then you can easily switch off parts of the test using sed or other tools.
Read more about Semantic Versioning 2.0.0
Distributed under GPLv3, See COPYING for more information.