-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve e2e documentation and small clean up (#683)
* refactor(test): remove documentation to test scan abort manually since this is now covered by e2e tests * refactor(test): remove init services from test environment * refactor(test): rename docker compose file in documentation * docs(test): add short e2e test readme file * ci(test): rename test job to e2e * docs(test): mention new e2e readme file in contributing
- Loading branch information
Showing
7 changed files
with
48 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# E2E tests | ||
|
||
VMClarity's end-to-end tests use the [Ginkgo](https://onsi.github.io/ginkgo/) test framework and the [Gomega](https://onsi.github.io/gomega/) matcher/assertion library to leverage behavior driven testing (BDD). | ||
|
||
This test module is composed by: | ||
|
||
* a `testenv.go` file where the test environment is configured, | ||
* a `docker-compose.override.yml` file which will merge and override the installation compose file to run end-to-end tests, | ||
* a `suite_test.go` file where the steps to perform the setup and cleanup of the Ginkgo test suite are defined, | ||
* a `helper.go` file where common methods are defined, | ||
* and test case files. | ||
|
||
## Run test | ||
|
||
To run all end-to-end tests, use the following command: | ||
|
||
``` | ||
go test -v -failfast -test.v -test.paniconexit0 -timeout 2h -ginkgo.v . | ||
``` | ||
|
||
To run a particular end-to-end test file, use: | ||
|
||
``` | ||
go test -v -failfast -test.v -test.paniconexit0 -timeout 2h -ginkgo.v --ginkgo.focus-file <go test file> . | ||
``` | ||
|
||
## Write a new test | ||
|
||
To add a new test, create a new `<test_name>_test.go` file in the current directory and use the following template: | ||
|
||
```go | ||
var _ = ginkgo.Describe("<add a brief test case description>", func() { | ||
ginkgo.Context("<describe conditions or inputs>", func() { | ||
ginkgo.It("<describe the behaviour or feature being tested>", func(ctx ginkgo.SpecContext) { | ||
<implement test code> | ||
}) | ||
}) | ||
}) | ||
``` | ||
|
||
Additionally, check the available test cases (e.g. `basic_scan_test.go`) to get started. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters