Run tests against the current stable k8s version (#8122)

So far we have been running tests against the master branch of
kubernetes/kubernetes. This is creating quite some problems because the
master branch is always moving. We are actually checking the YAML files
against a version between 1.10 and 1.11.

This PR is attempting to fix the problem by checking out the
'release-1.10' branch before running the tests. We are supposed to
change the branch to be used when release-1.11 is out. With this PR
(hopefully it works), we will only need to fix the gate every time a new
release is out.
This commit is contained in:
Qiming
2018-04-27 05:05:27 +08:00
committed by k8s-ci-robot
parent aa52cbb7ec
commit b855bd1d52
2 changed files with 11 additions and 9 deletions
+6 -4
View File
@@ -1,20 +1,22 @@
language: go language: go
go: go:
- 1.8.3 - 1.9.3
# Don't want default ./... here: # Don't want default ./... here:
install: install:
- export PATH=$GOPATH/bin:$PATH - export PATH=$GOPATH/bin:$PATH
- mkdir -p $HOME/gopath/src/k8s.io - mkdir -p $HOME/gopath/src/k8s.io
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/website - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/website && cd $HOME/gopath/src/k8s.io/website
# Fetch dependencies for us to run the tests in test/examples_test.go
# (1) Fetch dependencies for us to run the tests in test/examples_test.go
- go get -t -v k8s.io/website/test - go get -t -v k8s.io/website/test
# Make sure we are testing against the correct branch
- pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.10 && popd
# Simplified deduplication of dependencies. # Simplified deduplication of dependencies.
- cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/ - cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/
- rm -r $GOPATH/src/k8s.io/kubernetes/vendor/ - rm -r $GOPATH/src/k8s.io/kubernetes/vendor/
script: script:
# Run test
- go test -v k8s.io/website/test - go test -v k8s.io/website/test
- ./verify-docs-format.sh - ./verify-docs-format.sh
+5 -5
View File
@@ -173,8 +173,8 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
} }
errors = ext_validation.ValidateIngress(t) errors = ext_validation.ValidateIngress(t)
case *policy.PodSecurityPolicy: case *extensions.PodSecurityPolicy:
errors = policy_validation.ValidatePodSecurityPolicy(t) errors = ext_validation.ValidatePodSecurityPolicy(t)
case *extensions.ReplicaSet: case *extensions.ReplicaSet:
if t.Namespace == "" { if t.Namespace == "" {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
@@ -317,9 +317,9 @@ func TestExampleObjectSchemas(t *testing.T) {
"nginx-deployment": {&extensions.Deployment{}}, "nginx-deployment": {&extensions.Deployment{}},
}, },
"../docs/concepts/policy": { "../docs/concepts/policy": {
"privileged-psp": {&policy.PodSecurityPolicy{}}, "privileged-psp": {&extensions.PodSecurityPolicy{}},
"restricted-psp": {&policy.PodSecurityPolicy{}}, "restricted-psp": {&extensions.PodSecurityPolicy{}},
"example-psp": {&policy.PodSecurityPolicy{}}, "example-psp": {&extensions.PodSecurityPolicy{}},
}, },
"../docs/concepts/services-networking": { "../docs/concepts/services-networking": {
"curlpod": {&extensions.Deployment{}}, "curlpod": {&extensions.Deployment{}},