Commit Graph

88 Commits

Author SHA1 Message Date
Oscar Utbult
421f142ffc Update shellcheck version (0.7.1 -> 0.7.2) and fix findings 2022-11-01 23:10:44 +01:00
Patrick Ohly
1aa58532c8 test: enable unit tests under test/e2e
The test/e2e directory contains several unit tests that should run as part of
"make test":

./test/e2e/chaosmonkey/chaosmonkey_test.go
./test/e2e/storage/external/external_test.go
./test/e2e/storage/utils/utils_test.go
./test/e2e/framework/log_test.go
./test/e2e/framework/testfiles/testfiles_test.go
./test/e2e/framework/timer/timer_test.go
./test/e2e/framework/node/wait_test.go
./test/e2e/framework/pod/resource_test.go
./test/e2e/framework/config/config_test.go
./test/e2e/framework/ingress/ingress_utils_test.go
./test/e2e/framework/providers/gce/firewall_test.go

Because they were excluded by "./test/e2e/*", some of them became outdated.

./test/e2e/e2e_test.go is the only test that needs to be excluded because it is
the E2E test suite that depends on a functional cluster.
2022-05-11 11:48:58 +02:00
Davanum Srinivas
d20df79545
prune junit xml files in ci harness
Over time the size of our junit xml has exploded to the point where
test-grid fails to process them. We still have the original/full
*.stdout files from where the junit xml files are generated from so the
junit xml files need NOT have the fill/exact output for
processing/display. So let us prune the large messages with an
indicator that we have "[... clipped...]" some of the content so folks
can see that they have to consult the full *.stdout files.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-30 12:58:43 -04:00
Benjamin Elder
69c3e1934c don't search under ./bazel-*, bazel is not in use. 2021-11-02 11:40:59 -07:00
Benjamin Elder
8942cba24d log if we're running with -race 2021-06-18 14:49:53 -07:00
Benjamin Elder
3c44b86ad6 enable race detector by default in make test 2021-06-18 14:49:52 -07:00
Benjamin Elder
14085c50d3 bump KUBE_TIMEOUT to 180s
observed some timeouts with 170s still
2021-06-15 12:25:00 -07:00
Benjamin Elder
77c04d2284 Increase KUBE_TIMEOUT default to a passing default
Next we can stop overriding it in CI, so local and CI runs match more closely, see: https://github.com/kubernetes/kubernetes/issues/102607
2021-06-09 23:33:24 -07:00
Jordan Liggitt
031e1c562c Install gotestsum if needed for junit results 2021-02-01 12:16:07 -05:00
Davanum Srinivas
f981628ce8
move linting dependencies to hack/tools/tools.go
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-20 13:45:38 -04:00
Jordan Liggitt
2a47900620 Remove unused KUBE_TEST_API logic 2020-01-13 09:09:46 -05:00
Jordan Liggitt
424d5e20df Remove testapi 2019-12-13 11:56:29 -05:00
Jordan Liggitt
8618c09369 opt out of module mode for builds 2019-11-06 17:39:05 -05:00
Katharine Berry
a6e25d5e67 Add KUBE_COVER_REPORT_DIR to specify coverage output dir. 2019-09-23 10:36:00 -07:00
Jordan Liggitt
c64d6a39aa Only output json format from tests when building junit reports 2019-08-01 11:03:20 -04:00
Jordan Liggitt
93c02e164f Switch to json test output 2019-07-31 17:43:02 -04:00
Kubernetes Prow Robot
088411f77f
Merge pull request #78978 from sttts/sttts-staging-unit-tests
hack/make-rules/test.sh: run all staging unit tests
2019-06-15 03:46:24 -07:00
Dr. Stefan Schimanski
e2c6bc35a9 hack/make-rules/test.sh: run all staging unit tests 2019-06-13 14:07:37 +02:00
Kohei Toyoda
62d5eb524b
Merge branch 'master' into fix_shellcheck_failure_make-rules 2019-05-17 08:43:08 +09:00
Khaled Henidak(Kal)
205eaed1a7 add legacy cloud providers unit tests to [make test] 2019-05-09 22:55:15 +00:00
toyoda
34a120fc42 fix shellcheck failures in /hack/make-rules/test.sh 2019-05-09 17:47:12 +09:00
toyoda
bbe4a9fdc5 fix shellcheck failures in /hack/make-rules/clean.sh,test.sh,vet.sh 2019-05-09 13:40:35 +09:00
Kubernetes Prow Robot
999e2e0ce8
Merge pull request #73581 from krzysied/test_KUBE_JUNIT_REPORT_DIR_revert
KUBE_JUNIT_REPORT_DIR fixes
2019-02-08 02:39:14 -08:00
Krzysztof Siedlecki
c20262eb33 adding FULL_LOG flag 2019-02-07 12:04:43 +01:00
mattjmcnaughton
2d3ad78cf9 Support make test WHAT=path/to/pkg/...
In 99cdc069e2, we added a check for
whether the directory the user was attempting to test existed or not.
However, adding this check prevented us from running `make test
WHAT=./path/to/pkg/...`, because we believed that `./path/to/pkg/...`
wasn't a valid path to a directory.

Fix this by stripping `/...` before checking whether the directory
exists.
2019-02-05 18:57:02 -05:00
Roy Lenferink
b18bc2ea79 Improved some more bash script variable definitions 2019-01-21 23:11:58 +01:00
Roy Lenferink
a5d0616bdc Improving syntax for bash scripts 2019-01-18 19:17:16 +01:00
Kubernetes Prow Robot
152226c557
Merge pull request #71198 from cofyc/go1.11-GOFLAGS-env
No need to pass GOFLAGS to $goflags variables with go 1.11
2019-01-09 23:35:09 -08:00
Christoph Blecker
b19fb0a77e
Clean up artifacts variables in hack scripts 2018-12-19 15:17:13 -08:00
Yecheng Fu
ce22322ef1 No need to pass GOFLAGS to $goflags variables.
In go 1.11, go commands will use `GOFLAGS` as default flags, see
https://golang.org/doc/go1.11#go_command.

There is no need to pass GOFLAGS to $goflags, and if we do, go commands
will fail with "duplicate flags" error, e.g.

```
$ make test-integration WHAT=./test/integration/scheduler GOFLAGS="-v"
...
go test: v flag may be set only once
run "go help test" or "go help testflag" for more information
...
```
2018-11-27 09:53:02 +08:00
Maciej Szulik
e37c63ea71
Add cli-runtime to make tests 2018-10-10 21:07:38 +02:00
junxu
49574c68c9 Fix the "dirname: missing operand" error of "make test" 2018-08-24 06:25:07 -04:00
Kubernetes Submit Queue
8ce536df1a
Merge pull request #62665 from liztio/kubeadm-e2e
Automatic merge from submit-queue (batch tested with PRs 62665, 62194, 63616, 63672, 63450). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubeadm e2e

**What this PR does / why we need it**:

Provides in-tree E2E tests for the Kubeadm subproject

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes [kubeadm#456](https://github.com/kubernetes/kubeadm/issues/456)

**Special notes for your reviewer**:

The weird way tests are executed mirrors `e2e_node`. A future pull request will add a frontend for these tests to kubetest, which will abstract away much of this detail.

**Release note**:
```release-note
NONE
```
2018-05-10 12:56:12 -07:00
Kubernetes Submit Queue
b5f61ac129
Merge pull request #62657 from matthyx/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update all script shebangs to use /usr/bin/env interpreter instead of /bin/interpreter

This is required to support systems where bash doesn't reside in /bin (such as NixOS, or the *BSD family) and allow users to specify a different interpreter version through $PATH manipulation.
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html
```release-note
Use /usr/bin/env in all script shebangs to increase portability.
```
2018-05-02 19:44:32 -07:00
liz
a80b5454af
Generated artefacts 2018-04-30 10:00:13 -04:00
Matthias Bertschy
9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Tim Hockin
46146f6f3d Remove 'teststale'
As of go 1.10, go's own build cache will ensure we do not rebuild or
relink tests.
2018-04-10 20:38:08 -07:00
Jordan Liggitt
ae7dccf2e9
Revert "Kubelet flags take precedence over config from files/ConfigMaps"
This reverts commit cbebb61450.
2017-11-21 23:55:43 -05:00
Michael Taufen
cbebb61450 Kubelet flags take precedence over config from files/ConfigMaps
Changes the Kubelet configuration flag precedence order so that flags
take precedence over config from files/ConfigMaps.

See issue #56171 for more details.

Also modifies e2e node test suite to transform all relevant Kubelet
flags into a config file before starting tests when the
KubeletConfigFile feature gate is true, and turns on the
KubeletConfigFile gate for all e2e node tests. This allows the alpha
dynamic Kubelet config feature to continue to work in tests after
the precedence change.
2017-11-21 16:02:27 -08:00
Maru Newby
adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
Solly Ross
55e1f6a541 [make-rules] test grep should treat binary as text
The output of `go test` is passed throug a grep filter that's used when
producing junit output.  Unfortunately, when testing round-trip
conversions with random strings, grep can become convinced that the test
output is binary, and will truncate a failed test before any output is
displayed, showing "binary file (standard input) matches".

This forces grep to consider test output to be text, so that we always
see test results.
2017-10-19 13:21:03 -04:00
Kubernetes Submit Queue
6a02660fbf Merge pull request #52165 from mattjmcnaughton/mattjmcnaughton/52025-more-descriptive-make-test-error-message
Automatic merge from submit-queue (batch tested with PRs 53101, 53158, 52165). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

More descriptive error message for `make test`

**Which issue this PR fixes**
Fix #52025

**What this PR does / why we need it**:

The `[packages]` argument to `go test` can be confusing. If the
`package` does not begin with `./`, `go test` considers it relative to
`$GOPATH/src`. If it does begin with `./`, `go test` considers it
relative to `pwd`. `hack/make-rules/test.sh`, and thus `make test`, use
`go test`.

This commit adds a verify step to `hack/make-rules/test.sh`. Before we
run `go test`, we check the packages under test exist. If the user
specified the package path in the incorrect format - for example they
didn't prepend with `./` when they should have, the check logs a
suggestion of the alternative path they should use.

Running the test suites for a package is an activity many all first time
contributors will take. Hopefully including a more descriptive error
message, with a suggestion for a fix if applicable, will make this an
easier experience.

Signed-off-by: mattjmcnaughton <mattjmcnaughton@gmail.com>

```release-note
NONE
```
2017-09-29 14:36:22 -07:00
shashidharatd
a570d316b8 Move k/test/integration/federation to k/federation/test/integration 2017-09-28 11:43:35 +05:30
mattjmcnaughton
99cdc069e2 More descriptive error message for make test
Fix #52025

The `[packages]` argument to `go test` can be confusing. If the
`package` does not begin with `./`, `go test` considers it relative to
`$GOPATH/src`. If it does begin with `./`, `go test` considers it
relative to `pwd`. `hack/make-rules/test.sh`, and thus `make test`, use
`go test`.

This commit adds a verify step to `hack/make-rules/test.sh`. Before we
run `go test`, we check the packages under test exist. If the user
specified the package path in the incorrect format - for example they
didn't prepend with `./` when they should have, the check logs a
suggestion of the alternative path they should use.

Running the test suites for a package is an activity many all first time
contributors will take. Hopefully including a more descriptive error
message, with a suggestion for a fix if applicable, will make this an
easier experience.

Signed-off-by: mattjmcnaughton <mattjmcnaughton@gmail.com>
2017-09-26 19:52:33 -04:00
Dr. Stefan Schimanski
e3a3d108fb Fixup after k8s.io/{kube-gen -> code-generator} rename 2017-08-17 17:55:12 +02:00
Dr. Stefan Schimanski
edfbb9aa64 Fixup go2idl references 2017-07-20 07:41:37 +02:00
Davanum Srinivas
823e26ddbf Remove unnecessary wrapper flags
Drop KUBE_GOFLAGS, KUBE_GOGCFLAGS, KUBE_GOLDFLAGS references
from the build infrastructure. There are some usages still
for KUBE_GOFLAGS, so we should print a deprecation message
until all those are fixed. If both KUBE_GOFLAGS and GOFLAGS
are just then we just bail out.
2017-06-07 12:31:01 -04:00
Dr. Stefan Schimanski
33e50da9f4 Rename {kube- ->}apiextensions-{-> api}server 2017-06-06 12:06:31 +02:00
Monis Khan
a13f026fd0
Panic server on watch errors in test environment
This change makes it so that errors during watch decoding panic the
server if it is in a test environment.  This allows us to catch coder
errors related to storing incompatible types at the same location in
etcd.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-05-25 13:54:56 -04:00
Cao Shufeng
726d720c78 Fix invalid bash script in unit test.
This change fix such error when we run "make test":
    "find: invalid expression; you have used a binary operator '-o' with
     nothing before it."
2017-05-15 15:36:27 +08:00