Improve examples test (#9467)
This PR moves the examples test to where it belongs and also include the following improvements: - Removed test cases defined for non-existent files; - Add guard against ineffective tests against missing files; - Remove the special case for scheduler-policy-config which is no longer an example, the dependency on the related go module is thus eliminated; - Updated the .tavis.yml file to use the new test case: the instruction sequence is adjusted to ensure the correct version of kubernetes is fully prepared before we do `go get -v -t`. - The examples_test.go is formatted using `gofmt`; - Verbose output during test has been added. - A separate test case is added for CN translation. Related: #9285
This commit is contained in:
+7
-7
@@ -7,16 +7,16 @@ install:
|
||||
- export PATH=$GOPATH/bin:$PATH
|
||||
- mkdir -p $HOME/gopath/src/k8s.io
|
||||
- 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
|
||||
- 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.11 && popd
|
||||
|
||||
# Simplified deduplication of dependencies.
|
||||
# Make sure we are testing against the correct branch
|
||||
- pushd $GOPATH/src/k8s.io && git clone https://github.com/kubernetes/kubernetes && popd
|
||||
- pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.11 && popd
|
||||
- cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/
|
||||
- rm -r $GOPATH/src/k8s.io/kubernetes/vendor/
|
||||
|
||||
# Fetch additional dependencies to run the tests in examples/examples_test.go
|
||||
- go get -t -v k8s.io/website/content/en/examples
|
||||
|
||||
script:
|
||||
# TODO(bep)
|
||||
- go test -v k8s.io/website/test #fixed by https://github.com/kubernetes/website/pull/8388
|
||||
- go test -v k8s.io/website/content/en/examples
|
||||
#- ./verify-docs-format.sh
|
||||
|
||||
Reference in New Issue
Block a user