Commit 73e7b94
committed
pkg/sanity: support sanity testing in another Ginkgo suite
This was not possible before:
- Ginkgo only supports one set of Before/AfterSuite calls,
which might be in use already in the existing suite (for
example, the Kubernetes e2e framework).
- When nesting the sanity test inside a Ginkgo spec there
is no testing.T pointer that could be passed to
the Test method.
Now all global variables are replaced with a test context that gets
passed into the specs explicitly. For this to work, specs must be set
up with SanityDescribe instead of the previous Describe call.
The Test and Config API are unchanged, but there is one slight change
of behavior: previously it was possible to define two tests with
different configs in the same test binary and then running each test
would execute the sanity tests for that config. That no longer works
because running one test changes the global Ginkgo suite and running
the second test would then also run the specs from the first one.
This usage could be supported by having one test function which takes
multiple configs, then runs one suite that contains tests for all of
them.
Probably it is easier to just use a Ginkgo suite, because there
multiple different configs can be handled already normally via
different Describe specs: calling the new GinkgoTest API will add all
sanity test cases for one configuration to the spec in which the API
is called.1 parent 5f55e22 commit 73e7b94
File tree
6 files changed
+289
-181
lines changed- pkg/sanity
6 files changed
+289
-181
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | | - | |
20 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
24 | 61 | | |
25 | 62 | | |
0 commit comments