Commit Graph

84 Commits (dd81bf9f9da53256f9cd0150bf3c8fd30e21b54d)

Author SHA1 Message Date
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