Commit Graph

114 Commits (dd88e3f32ec9e4f90a455b711cdc448a60639f0e)

Author SHA1 Message Date
Chao Xu d52cef11a4 add v1 tests to hack/test-go; let default value of Container.SecurityContext to be nil 2015-06-03 09:50:41 -07:00
Kris f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Tim Hockin f8d0060d6e Merge pull request #8388 from pmorie/third-party-tests
Run tests for third-party code
2015-05-28 14:58:26 -07:00
Jeff Grafton bf1de72f4a Revert "Revert "Use native Ginkgo test runner instead of cmd/e2e (attempt N)""
This reverts commit f4bb6aa37d.
2015-05-19 09:13:08 -07:00
Quinton Hoole f4bb6aa37d Revert "Use native Ginkgo test runner instead of cmd/e2e (attempt N)" 2015-05-18 21:04:26 -07:00
Daniel Smith 5e056f119d Merge pull request #6694 from bprashanth/bench
Add a simple master benchmark and a wrapper to run it.
2015-05-18 14:42:24 -07:00
Jeff Grafton b79fae5d71 Revert "Revert "Once again, use native Ginkgo test runner instead of cmd/e2e.""
This reverts commit 67da1ac0c8.
2015-05-18 11:39:21 -07:00
Paul Morie 3b8e4d97a1 Run tests for third-party code 2015-05-16 16:52:23 -04:00
Prashanth Balasubramanian 4200033c0a Add a simple master benchmark and a wrapper to run it. 2015-05-15 17:30:17 -07:00
Jeff Grafton 67da1ac0c8 Revert "Once again, use native Ginkgo test runner instead of cmd/e2e."
This change broke compilation on go 1.3 and running e2e tests on OS X.

This reverts commit 86b023fdd6.
2015-05-15 16:41:55 -07:00
Quinton Hoole c4fa78509d Merge pull request #7653 from ixdy/native-ginkgo-runner
Once again, use native Ginkgo test runner instead of cmd/e2e
2015-05-15 15:29:19 -07:00
Jeff Grafton 86b023fdd6 Once again, use native Ginkgo test runner instead of cmd/e2e.
This commit deletes cmd/e2e and updates hack/ginkgo-e2e.sh to use the
'ginkgo' command instead. All logic from cmd/e2e/e2e.go and
test/e2e/driver.go have been combined into the new file
test/e2e/e2e_test.go.

The test tarball now includes a built version of the test/e2e test
binary, which includes all tests under test/e2e. This was accomplished
by updating the build scripts to use 'go test -c' when a target name
ended with '.test', and adding a dependency on test/e2e/e2e.test.

This prebuilt test binary is passed to the Ginkgo runner in
hack/ginkgo-e2e.sh. In a future change, we can add support to run
Ginkgo against the source tree if it is available.

This change is generally intended to have no externally visible changes,
aside from the following caveats:
 - The -t/--tests flag has been removed
 - Calling cmd/e2e/e2e directly obviously won't work, but that was never
   intended to be supported anyway
 - If the GINKGO_PARALLEL environment variable is set to y, then ginkgo
   will run test specs in parallel. (Currently defaults to n, since some
   tests are broken in this mode.)

Additionally, several tests which made poor assumptions about cwd or
used testContext before it had been set have been fixed.
2015-05-15 11:54:53 -07:00
nikhiljindal 0e9d7d1451 Fixing the number of times our unit tests are run 2015-05-13 09:56:13 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Alex Robinson 1bb76633da Make hack/test-go.sh friendlier to OS X bash by not using a -1 array index.
Without this, everytime I run test-go.sh I get the following error:
./hack/test-go.sh: line 215: apiVersions: bad array subscript
2015-04-30 14:56:02 -07:00
Quinton Hoole bfaf976df7 Revert "Use native Ginkgo test runner instead of cmd/e2e" 2015-04-30 13:45:46 -07:00
Jeff Grafton 57750ccb51 Use native Ginkgo test runner instead of cmd/e2e.
This commit deletes cmd/e2e and updates hack/ginkgo-e2e.sh to use the
'ginkgo' command instead. All logic from cmd/e2e/e2e.go and
test/e2e/driver.go have been combined into the new file
test/e2e/e2e_test.go.

Additionally, several tests which made poor assumptions about cwd or
used testContext before it was set have been fixed.

This change is generally intended to have no externally visible changes,
aside from the following caveats:
- The -t/--tests flag has been removed
- Calling cmd/e2e/e2e directly obviously won't work, but that was never
  supported anyway
- If the GINKGO_PARALLEL environment variable is set to y, then ginkgo
  will run test specs in parallel. (Currently defaults to n, since some
  tests are broken in this mode.)
2015-04-28 18:42:37 -07:00
Karl Beecher a7623ca6cc Adds ability to define a prefix for etcd paths
The API server can be supplied (via a command line flag) with a custom
prefix that is prepended to etcd resources paths.

Refs: #3476
2015-04-24 12:12:39 +02:00
Jeff Grafton fafd1df7a6 Revert "Continue after failed unit test"
This reverts commit f70752d9e1.

This change caused Travis and Shippable to report success on all test
runs, even if any tests failed or timed out.
2015-04-20 11:59:18 -07:00
Eric Tune 14eb70b1dc Merge pull request #6899 from nak3/fix-unittest-after-fail
Continue after failed unit test
2015-04-16 13:21:45 -07:00
Kenjiro Nakayama f70752d9e1 Continue after failed unit test 2015-04-16 16:53:07 +09:00
Kenjiro Nakayama 1d804629b6 Escape integration test codes from unit tests 2015-04-16 15:41:03 +09:00
nikhiljindal f56aa58741 Some improvements to #5687 2015-03-26 15:36:41 -07:00
nikhiljindal 6b69ebda5b Fixing broken hack/test-go.sh 2015-03-25 18:04:59 -07:00
nikhiljindal 5e4ab8e045 Updating test-go.sh to be able to run tests twice - for v1beta1 and 3 2015-03-25 12:51:22 -07:00
Brendan Burns 2b7ae7fcd4 Fix coverage testing to work on OS X, where xargs is different. 2015-03-07 11:01:41 +01:00
Jeff Grafton fbd11a1a23 Renable code coverage collection in unit tests, including on Travis.
When code coverage is not being collected, just issue a single 'go test'
command, as is already done. Go will internally parallize execution.

When code coverage is being collected, it is necessary to issue separate
'go test' commands for each package, since Go does not support
collecting coverage across packages. Using xargs -P will parallelize
these invocations, however, speeding up test execution.
The number of simultaneous processes to use can be specified with
KUBE_COVERPROCS.

Update Travis config to pass along the number of CPUs to use for running
tests.
2015-03-02 13:04:13 -08:00
Jeff Grafton 0f2e9dbac8 Revert "Use goveralls to report coverage results from Travis."
Revert "Produce a combined coverage report when running Go unit tests."

These caused unit tests to run very slowly, causing problems with
Travis.
2015-02-23 14:35:48 -08:00
Jeff Grafton 26addee75b Produce a combined coverage report when running Go unit tests.
The Go coverage tool does not currently support recording a coverage
data profile across packages, so we must manually combine these coverage
profiles and use it to produce an HTML report when KUBE_COVER is
nonempty. The exact value of KUBE_COVER is now ignored; KUBE_COVERMODE
can be used to set the coverage mode from the default of "atomic".

Additionally, if KUBE_GOVERALLS_BIN is set, hack/test-go.sh will attempt
to report coverage results to Coveralls.io. This is intended to be used
with the Travis build.
2015-02-19 17:49:36 -08:00
Satnam Singh c29d89a534 Merge pull request #3357 from proppy/fix-podex
contrib/podex: fix ordering and manifest generation
2015-01-30 12:02:15 -08:00
Paul Morie 8917c669d1 Make it possible to test a single package w/o cover report 2015-01-25 21:26:36 -05:00
Johan Euphrosine 363ce1b39a contrib: fix name and readability, exclude from test 2015-01-16 11:54:11 +01:00
Clayton Coleman dcd11761e7 Reenable Coverage and Race detection for travis and integration test 2015-01-09 13:16:30 -05:00
Eric Tune 7d5ac856c5 Make Reflector helpers reusable.
Scheduler uses Reflector from pkg/client/cache.
It defines some helper classes.
I'd like to use those helpers with pkg/client/cache
in kube-proxy and kubelet too.
2015-01-07 13:49:37 -08:00
Brendan Burns d3e48c9525 Add the container API to our dependencies.
Update google-api-go-client
2014-11-14 10:38:22 -08:00
Joe Beda 5d33ce46cc Rework hack/ and build/ directories.
* Rewrite a bunch of the hack/ directory with modular reusable bash libraries.
* Have 'build/*' build on 'hack/*'.  The stuff in build now just runs hack/* in a docker container.
* Use a docker data container to enable faster incremental builds.
* Standardize output to _output/{local,dockerized}/bin/OS/ARCH/*.  This regularized placement makes cross compilation work.
* Move travis specific scripts under hack/travis

With new dockerized incremental builds, I can do a no-op `make quick-release` in ~30s.  This is a significant improvement.
2014-11-01 17:56:41 -07:00
Joe Beda 96c1bc17ca Set shell options for reliability.
Tweak a few other small things in our shell scripts.
2014-10-10 12:33:36 -07:00
Joe Beda d43a6ec5a3 Standardize how we refer to the kubernetes root.
Now use $KUBE_ROOT as the variable pretty much everywhere.
2014-10-10 12:33:36 -07:00
Clayton Coleman 54e0af8b96 Allow -race to be disabled in test-go.sh 2014-09-19 14:09:42 -04:00
Clayton Coleman 27bbd7df56 Increase the hack/test-go.sh timeout to account for more fuzzing
We fuzz v1beta1 and v1beta2 now, so fuzzer takes twice as long.
2014-09-18 14:17:32 -04:00
Daniel Smith d397d64b9e go test -cover -race is fixed now 2014-09-09 14:06:23 -07:00
Brendan Burns 4a934427db Exclude vendored etcd. 2014-09-04 12:05:34 -07:00
Brendan Burns 78df593c57 Fix a shell typo. 2014-09-04 10:03:49 -07:00
Tim Hockin 512b0ab90a Merge pull request #1176 from brendandburns/travis
Re-enable travis for Go tip
2014-09-04 09:57:14 -07:00
Brendan Burns 53e3bff464 Re-enable travis for Go tip 2014-09-04 09:56:28 -07:00
Filipe Brandenburger 8effbdc63f In `hack/test-go.sh` treat arguments that start with a dash as go flags.
This fixes `hack/test-go.sh pkg/apiserver -test.run=<a_specific_test_name>`
which was broken by PR #1116.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-09-03 14:57:19 -07:00
Tim Hockin 640a1d323d Improve test script
add usage
verify flag value for -i is numeric
allow multiple targets on the command line
actually capture coverage output
fix lingering GOFLAGS undef issue
fix issue with -i not working at all: ((x++)) returns 1 when x is 0, which is
  incompatible with "set -e"
2014-09-03 09:40:20 -07:00
Joe Beda 843ae1fbe2 Rename `output/` directory to `_output/`
go build ./... will ignore any directory starting with an underscore.
2014-08-29 14:44:55 -07:00
Tim Hockin f0c3896281 Build tweaks
Wrap long lines.
Add GOFLAGS support to build and test.
Comments.
2014-08-28 22:56:00 -07:00
Brendan Burns 9fce47ac68 Add the ability to multiple test iterations without rebuilding.
Address comments.
2014-08-27 22:07:40 -07:00
Filipe Brandenburger 6e25f60288 Move go detection and environment setup into its own function
This way hack/config-go.sh can be used in environments where Go is not
available, such as running release/build-release.sh for Vagrant.

(The intention is to make config-go.sh a general library of helper
functions and import it from most other shell scripts.)

Fixes Issue #1057.

Tested:
- Built it and made sure it works.
  $ hack/build-go.sh
  $ output/go/bin/kubelet -version
  Kubernetes version 0.1+, build 0766e7a411c7-dirty

- Ran unit tests.
  $ hack/test-go.sh
  ok      github.com/GoogleCloudPlatform/kubernetes/examples      1.105s  coverage: 0.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/api       6.188s  coverage: 86.1% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors        1.015s  coverage: 81.8% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver 1.806s  coverage: 85.1% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/client    1.211s  coverage: 67.2% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache      1.115s  coverage: 95.5% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/gce 1.052s  coverage: 7.3% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/vagrant     1.045s  coverage: 76.8% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/constraint        1.038s  coverage: 100.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/controller        1.559s  coverage: 78.8% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/conversion        3.440s  coverage: 72.4% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/election  1.034s  coverage: 71.4% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/health    1.043s  coverage: 94.5% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/healthz   1.034s  coverage: 100.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/httplog   1.027s  coverage: 82.4% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/kubecfg   6.081s  coverage: 58.5% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet   1.400s  coverage: 72.2% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/config    1.139s  coverage: 90.1% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/labels    1.041s  coverage: 98.7% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/master    1.033s  coverage: 33.3% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/proxy     1.095s  coverage: 86.5% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/proxy/config      1.038s  coverage: 39.2% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/binding  1.046s  coverage: 100.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller       1.039s  coverage: 43.6% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint 1.029s  coverage: 25.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/etcd     1.110s  coverage: 79.5% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/minion   1.048s  coverage: 72.3% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/pod      1.052s  coverage: 62.1% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/registry/service  1.054s  coverage: 80.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/scheduler 1.030s  coverage: 90.4% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/service   1.363s  coverage: 83.8% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/tools     1.136s  coverage: 81.9% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/util      1.049s  coverage: 83.9% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/util/config       1.036s  coverage: 92.9% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait 1.029s  coverage: 86.7% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/volume    1.032s  coverage: 83.3% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/pkg/watch     1.040s  coverage: 100.0% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler  1.026s  coverage: 90.9% of statements
  ok      github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/factory  1.075s  coverage: 85.4% of statements
  ?       github.com/GoogleCloudPlatform/kubernetes/test/integration      [no test files]

- Ran release/build-release.sh without go or godep in my $PATH.
  $ PATH=...
  $ which go
  $ which godep
  $ release/build-release.sh MYTEST
  Building release tree
  ~/devel/kubernetes ~/devel/kubernetes
  ~/devel/kubernetes
  Packaging release
  $ cat output/release/master-release/src/saltbase/pillar/common.sls
  instance_prefix: MYTEST-minion
  go_opt: -ldflags "-X
  github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitCommit '0766e7a411c7-dirty'"
  $ find output/release/master-release/ | wc -l
  598

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-08-27 17:04:19 -07:00
Tim Hockin 5f21ff5b45 Whitespace 2014-08-20 20:17:16 -07:00
Clayton Coleman d573d81306 Let coverage and timeout be overriden in hack/test-go.sh
As usual, shell review / test gratefully accepted.  Tested on OSX and
F20
2014-08-19 01:13:03 -04:00
Nan Monnand Deng eb462eba06 changed scripts to use godep 2014-08-13 15:02:14 -04:00
Clayton Coleman 67166e581b Run all go tests in parallel (6x speedup)
Currently hack/test-go.sh runs in serial in independent executions of
go test.  By running all tests at once, we get parallel execution.
However, we cannot use -coverprofile with this mode, which seems worthwhile.

On a 4-core mac, runs tests in 15s that ran in 80s before. Tested on F20 and
OSX Mavericks.
2014-08-04 13:39:34 -04:00
Clayton Coleman f7948015bd The quotes around the file should not be necessary
In Go 1.2 on the Mac they result in a file created with actual
quotes.
2014-07-25 13:11:45 -04:00
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Clayton Coleman 9a9d140a8a -cover causes races in Go 1.2
Make -covermode=atomic the default until we drop 1.2 support
Enable Go 1.2 in Travis
2014-07-11 15:48:31 -04:00
Clayton Coleman 8b06cd8e01 Allow hack/test-go.sh to support flags
Pass arguments after the package directly to go test

    hack/test-go.sh pkg/util -v -test.run=TestNewStringSet

And also allow global flags

    hack/test-go.sh "" -v
2014-07-07 09:30:44 -04:00
Nan Deng 903c4a957c remove 1.2 2014-07-02 23:27:00 -07:00
Nan Deng e444bf23f6 turn off code cover. 2014-07-02 23:23:14 -07:00
Nan Deng 0a97e514b3 turn on race detector by default 2014-07-02 23:22:09 -07:00
Brendan Burns 9010ef954c Update tests 2014-06-09 07:16:43 -07:00
Joe Beda 894a7e3282 Move everything out of src and reorganize scripts.
Fixed up some scripts to be more robust.  Changed the e2e test setup to use g1-small instances.  Fixed up documentation to reflect the new script locations.  Disabled the "curl | bash" cluster launch as it hasn't been well tested and doesn't include the cloudcfg tool yet.
2014-06-06 21:41:19 -07:00