Skip to content

Commit 7391fa5

Browse files
author
OpenShift Bot
authored
Merge pull request #12538 from jim-minter/testdoc
Merged by openshift-bot
2 parents c5b9726 + 13b6746 commit 7391fa5

File tree

2 files changed

+79
-8
lines changed

2 files changed

+79
-8
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ all build:
4545
#
4646
# Example:
4747
# make build-tests
48-
build-tests:
49-
hack/build-go.sh test/extended/extended.test
50-
hack/build-go.sh test/integration/integration.test -tags='integration docker'
48+
build-tests: build-extended-test build-integration-test
5149
.PHONY: build-tests
5250

51+
build-extended-test:
52+
hack/build-go.sh test/extended/extended.test
53+
.PHONY: build-extended-test
54+
55+
build-integration-test:
56+
hack/build-go.sh test/integration/integration.test
57+
.PHONY: build-integration-test
58+
5359
# Run core verification and all self contained tests.
5460
#
5561
# Example:

test/extended/README.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ From the top-level origin directory, run
1212

1313
Where \<some_script\>.sh is one of the bucket scripts such as "core.sh".
1414

15-
You can further narrow the set of tests being run by passing `--ginkgo.focus="some string"` where "some string" corresponds to
16-
the description of the test you want to run. For example one of the s2i tests (sti_incremental.go) defines:
15+
You can further narrow the set of tests being run by passing
16+
`--ginkgo.focus='regex'` where 'regex' is a regular expression matching the
17+
description of the test you want to run. For example one of the s2i tests
18+
(s2i_incremental.go) defines:
1719

18-
var _ = g.Describe("builds: s2i incremental build with push and pull to authenticated registry", func() {
20+
var _ = g.Describe("[builds][Slow] incremental s2i build", func() {
1921

20-
So you can write a focus filter that includes this test by passing `--ginkgo.focus="s2i incremental"`.
22+
So you can write a focus regex that includes this test by passing
23+
`--ginkgo.focus='\[builds\]'` or `--ginkgo.focus='incremental s2i'`.
2124

2225
Prerequisites
23-
-----------
26+
-------------
2427

2528
In order to execute the extended tests, you have to install
2629
[Ginkgo](https://github.com/onsi/ginkgo) framework which is used in extended
@@ -33,6 +36,68 @@ $ go get github.com/onsi/ginkgo/ginkgo
3336
You also need to have the `openshift` binary in the `PATH` if you want to use
3437
the shell script helpers to execute the extended tests.
3538

39+
Rapid local testing
40+
--------------------
41+
42+
If you already have a running OpenShift cluster, e.g. one created using `oc
43+
cluster up`, you can skip having the extended test infrastructure spin up an
44+
OpenShift cluster each time the tests are run by setting the `TEST_ONLY`
45+
environment variable as follows:
46+
47+
```console
48+
$ oc cluster up
49+
$ oc login -u system:admin
50+
$ export KUBECONFIG=${KUBECONFIG-$HOME/.kube/config}
51+
```
52+
53+
Then, for example:
54+
```console
55+
$ make build-extended-test
56+
$ TEST_ONLY=1 test/extended/core.sh --ginkgo.focus='\[builds\]'
57+
```
58+
59+
By default the Kubernetes test framework will remove the project associated with
60+
your test spec when it completes, regardless of whether it fails or not.
61+
Origin's wrapper scripts may also do clean-up. This can be inconvenient when
62+
debugging. To stop this behaviour, set the `SKIP_TEARDOWN` environment variable
63+
and add the argument `--delete-namespace=false`:
64+
65+
```console
66+
$ make build-extended-test
67+
$ SKIP_TEARDOWN=1 TEST_ONLY=1 test/extended/core.sh --delete-namespace=false --ginkgo.focus='\[builds\]'
68+
```
69+
70+
Test labels
71+
-----------
72+
73+
See [kinds of tests](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md#kinds-of-tests)
74+
for a full explanation of the labels used for each test spec. In brief:
75+
76+
- If a test has no labels, it is expected to run fast (under five minutes), be
77+
able to be run in parallel, and be consistent.
78+
79+
- \[Serial\]: If a test cannot be run in parallel with other tests (e.g. it
80+
takes too many resources or restarts nodes), it is labeled \[Serial\], and
81+
should be run in serial as part of a separate suite.
82+
83+
- \[Slow\]: If a test takes more than five minutes to run (by itself or in
84+
parallel with many other tests), it is labeled \[Slow\]. This partition allows
85+
us to run almost all of our tests quickly in parallel, without waiting for the
86+
stragglers to finish.
87+
88+
OpenShift extended tests that run builds should be marked \[Slow\].
89+
90+
- Tests should be marked \[Conformance\] when they provide test coverage for
91+
functionality considered core and critical to a functional cluster (i.e. not
92+
exotic features/configurations) and which is not overlapping with coverage
93+
provided in other conformance tests. Example of a valid conformance test: "Do
94+
builds work." Example of an invalid conformance test: "Do builds work when the
95+
forcePull flag is set."
96+
97+
- In general, accessing the local host (e.g. using the docker socket) in
98+
extended tests should be avoided. If this is unavoidable, the test should be
99+
marked \[local\].
100+
36101
Extended tests structure
37102
------------------------
38103

0 commit comments

Comments
 (0)