forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
47 lines (34 loc) · 1.28 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Package testutil provides helpers for running the conduit integration tests.
All helpers are defined as functions on the TestHelper struct, which you should
instantiate once per test, using the NewTestHelper function. Since that function
also parses command line flags, it should be called as part of your test's
TestMain function. For example:
package mytest
import (
"os"
"testing"
"github.com/runconduit/conduit/testutil"
)
var TestHelper *util.TestHelper
func TestMain(m *testing.M) {
TestHelper = util.NewTestHelper()
os.Exit(m.Run())
}
func TestMyTest(t *testing.T) {
// add test code here
}
Calling NewTestHelper adds the following command line flags:
-conduit string
path to the conduit binary to test
-conduit-namespace string
the namespace where conduit is installed (default "conduit")
-integration-tests
must be provided to run the integration tests
Note that the -integration-tests flag must be set when running tests, so that
the tests aren't inadvertently executed when unit tests for the project are run.
TestHelper embeds KubernetesHelper, so all functions defined on KubernetesHelper
are also available to instances of TestHelper. See the individual function
definitions for details on how to use each helper in tests.
*/
package testutil