Skip to content

Commit 1d54532

Browse files
authored
Makefile: change make test to run just unit tests (#1151)
* Makefile: change make test to run just unit tests While working on the operator-sdk, I often type make test expecting to run unit tests to do a quick verification. Sadly it would run ALL tests causing a very long turn around time. I updated the docs to let folks know to run make test for unit tests. And removed the unit.sh script as it wasn't doing anything helpful. * remove unit script from doc * feedback: fix missing link for unit tests * address review comment
1 parent e4c1258 commit 1d54532

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ build/%.asc:
7171

7272
.PHONY: install release_x86_64 release
7373

74-
test: dep test/markdown test/sanity test/unit install test/subcommand test/e2e
74+
test: test/unit
75+
76+
test-ci: test/markdown test/sanity test/unit install test/subcommand test/e2e
7577

7678
test/ci-go: test/subcommand test/e2e/go
7779

@@ -83,7 +85,8 @@ test/sanity:
8385
./hack/tests/sanity-check.sh
8486

8587
test/unit:
86-
./hack/tests/unit.sh
88+
$(Q)go test -count=1 -short ./commands/...
89+
$(Q)go test -count=1 -short ./pkg/...
8790

8891
test/subcommand: test/subcommand/test-local test/subcommand/scorecard
8992

@@ -110,7 +113,7 @@ test/e2e/helm: image/build/helm
110113
test/markdown:
111114
./hack/ci/marker --root=doc
112115

113-
.PHONY: test test/sanity test/unit test/subcommand test/e2e test/e2e/go test/e2e/ansible test/e2e/ansible-molecule test/e2e/helm test/ci-go test/ci-ansible test/ci-helm test/markdown
116+
.PHONY: test test-ci test/sanity test/unit test/subcommand test/e2e test/e2e/go test/e2e/ansible test/e2e/ansible-molecule test/e2e/helm test/ci-go test/ci-ansible test/ci-helm test/markdown
114117

115118
image: image/build image/push
116119

doc/dev/developer_guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ The SDK includes many tests that are run as part of CI.
3434
To build the binary and run all tests (assuming you have a correctly configured environment),
3535
you can simple run:
3636

37+
```sh
38+
$ make test-ci
39+
```
40+
41+
If you simply want to run the unit tests, you can run:
42+
3743
```sh
3844
$ make test
3945
```

doc/dev/testing/travis-build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ The Go, Ansible, and Helm tests then differ in what tests they run.
3232
2. Check that all source files have a license.
3333
3. Check that all error messages start with a lower case alphabetical character and do not end with punctuation, and log messages start with an upper case alphabetical character.
3434
4. Make sure the repo is in a clean state (this is particularly useful for making sure the `Gopkg.lock` file up to date after `dep ensure`).
35-
2. Run [unit tests][unit].
35+
2. Run unit tests.
36+
1. Run `make test`.
3637
3. Run [subcommand tests][subcommand].
3738
1. Run `test local` with no flags enabled.
3839
2. Run `test local` with most configuration flags enabled.
@@ -112,7 +113,6 @@ The markdown test does not create a new cluster and runs in a barebones Travis V
112113
[pr-builds]: https://travis-ci.org/operator-framework/operator-sdk/pull_requests
113114
[script]: ../../../hack/ci/setup-openshift.sh
114115
[sanity]: ../../../hack/tests/sanity-check.sh
115-
[unit]: ../../../hack/tests/unit.sh
116116
[subcommand]: ../../../hack/tests/test-subcommand.sh
117117
[go-e2e]: ../../../hack/tests/e2e-go.sh
118118
[tls-tests]: ../../../test/e2e/tls_util_test.go

hack/tests/unit.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)