Skip to content

Commit

Permalink
Merge pull request coreos#1490 from endocode/kayrus/specific_test_readme
Browse files Browse the repository at this point in the history
tests: added description on how to run specific tests
  • Loading branch information
jonboulle committed Mar 16, 2016
2 parents 8e1dd44 + aa35b4d commit 2e03edd
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ Since the tests utilize [`systemd-nspawn`][systemd-nspawn], this needs to be inv

If the tests are aborted partway through, it's currently possible for them to leave residual state as a result of the `systemd-nspawn` operations. This can be cleaned up using the `clean.sh` script.

### Using go flags in functional tests

`fleet/functional` scripts forwards all arguments directly to the `go` binary. This allows you to pass `-run regexp` argument to the `./test` script and run specific test functions. The example below shows how to run only `TestSchedule*` test functions:

```sh
$ sudo fleet/functional/test -run TestSchedule*
```

The test functions list could be printed using `grep` command:

```sh
$ cd fleet/functional
$ grep -r 'func Test' .
```

You can find a detailed description of the available test flags in the [Go documentation][golang-test-flags].

### Run tests in Vagrant

The recommended way to run the tests is to use the provided Vagrantfile, which will set up a single CoreOS instance with a one-member etcd cluster (configuration is applied using `user-data` [Cloud-Config][cloud-config] file located in this directory).
Expand Down Expand Up @@ -108,7 +125,8 @@ sudo yum install -y VirtualBox-5.0
#sudo yum install -y VirtualBox-4.3
```

[test-in-vagrant]: #run-tests-in-vagrant
[cloud-config]: https://github.com/coreos/coreos-cloudinit/blob/master/Documentation/cloud-config.md
[configure-vagrant]: #configure-host-environment-to-run-vagrant
[golang-test-flags]: https://golang.org/cmd/go/#hdr-Description_of_testing_flags
[systemd-nspawn]: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
[cloud-config]: https://github.com/coreos/coreos-cloudinit/blob/master/Documentation/cloud-config.md
[test-in-vagrant]: #run-tests-in-vagrant

0 comments on commit 2e03edd

Please sign in to comment.