Skip to content

Commit

Permalink
Merge pull request #162 from launchableinc/ST-821-behave-doc
Browse files Browse the repository at this point in the history
[ST-821] add documentation for behave
  • Loading branch information
awilkes authored Mar 10, 2021
2 parents cda0ad7 + 20e23b3 commit 9f57f93
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/optimizing-test-execution/subsetting-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ launchable subset \
See the following sections for how to fill the `...(test runner specific part)...` in the above example:

* [Bazel](subsetting-tests.md#bazel)
* [Behave](subsetting-tests.md#behave)
* [CTest](subsetting-tests.md#ctest)
* [Cypress](subsetting-tests.md#cypress)
* [GoogleTest](subsetting-tests.md#googletest)
Expand Down Expand Up @@ -56,6 +57,23 @@ You can now invoke Bazel with it:
bazel test $(cat launchable-subset.txt)
```

### Behave

To select a meaningful subset of tests, first pipe a list of all test files to the Launchable CLI:

```bash
find ./features/ | launchable subset \
--build <BUILD NAME> \
--target <TARGET> \
behave > launchable-subset.txt
```

The file will contain the subset of tests that should be run. You can now invoke your test executable to run exactly those tests:

```bash
behave -i "$(cat launchable-subset.txt)"
```

### CTest

To select a meaningful subset of tests, have CTest list your test cases to a JSON file \([documentation](https://cmake.org/cmake/help/latest/manual/ctest.1.html)\), then feed that JSON into the Launchable CLI:
Expand Down
1 change: 1 addition & 0 deletions docs/resources/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The Launchable CLI includes pre-built integrations with the following test runners/build tools:

* [Bazel](https://bazel.build/)
* [Behave](https://pypi.org/project/behave/)
* [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html#id13)
* [Cypress](https://www.cypress.io/)
* [GoogleTest](https://github.com/google/googletest)
Expand Down
20 changes: 20 additions & 0 deletions docs/training-a-model/recording-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ You'll need to disable this feature so that Launchable has enough test results t
{% endhint %}

* [Bazel](recording-test-results.md#bazel)
* [Behave](recording-test-results.md#behave)
* [Cypress](recording-test-results.md#cypress)
* [CTest](recording-test-results.md#ctest)
* [GoogleTest](recording-test-results.md#googletest)
Expand Down Expand Up @@ -41,6 +42,25 @@ To make sure that `launchable record tests` always runs even if the build fails,

For more information and advanced options, run `launchable record tests bazel --help`

### Behave

Behave provides a JUnit report option: see [Using behave](https://behave.readthedocs.io/en/stable/behave.html?highlight=junit#cmdoption-junit).

After running tests, point to files that contains all the generated test report XML files:

```bash
# run the tests however you normally do
behave --junit

launchable record tests --build <BUILD NAME> behave ./reports/*.xml
```

{% hint style="warning" %}
To make sure that `launchable record tests` always runs even if the build fails, see [Always record tests](recording-test-results.md#always-record-tests).
{% endhint %}

For more information and advanced options, run `launchable record tests behave --help`

### CTest

Have CTest run tests and produce XML reports in its native format. Launchable CLI supports the CTest format; you don't need to convert to JUnit. By default, this location is `Testing/{date}/Test.xml`.
Expand Down

0 comments on commit 9f57f93

Please sign in to comment.