Run k/k's e2e suite via new kubetest2 make target

This commit is contained in:
Peter Rifel 2020-12-27 13:25:27 -06:00
parent 72a4797341
commit 38215210c6
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
5 changed files with 614 additions and 11 deletions

View File

@ -185,6 +185,23 @@ test: ${BINDATA_TARGETS} # Run tests locally
test-windows: ${BINDATA_TARGETS} # Run tests locally
go test -v $(go list ./... | grep -v /nodeup/)
.PHONY: test-e2e
test-e2e:
cd /home/prow/go/src/k8s.io/kops/tests/e2e && \
export GO111MODULE=on && \
go get sigs.k8s.io/kubetest2@latest && \
go get sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest && \
go install ./kubetest2-kops
kubetest2 kops \
-v 2 \
--build --up --down \
--cloud-provider=aws \
--kops-binary-path=/home/prow/go/src/k8s.io/kops/bazel-bin/cmd/kops/linux-amd64/kops \
--test=ginkgo \
-- \
--test-package-version=v1.19.0 \
--skip-regex=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[HPA\]|Dashboard|Services.*functioning.*NodePort
.PHONY: ${DIST}/linux/amd64/nodeup
${DIST}/linux/amd64/nodeup: ${BINDATA_TARGETS}
mkdir -p ${DIST}

View File

@ -5,6 +5,6 @@ go 1.15
require (
github.com/octago/sflags v0.2.0
github.com/spf13/pflag v1.0.5
k8s.io/klog/v2 v2.3.0
sigs.k8s.io/kubetest2 v0.0.0-20200930205053-4e57931be178
k8s.io/klog/v2 v2.4.0
sigs.k8s.io/kubetest2 v0.0.0-20201130212850-d9dad7c8699c
)

File diff suppressed because it is too large Load Diff

View File

@ -64,11 +64,6 @@ func (d *deployer) Provider() string {
return Name
}
func (d *deployer) DumpClusterLogs() error {
klog.Warning("DumpClusterLogs is not implemented")
return nil
}
// New implements deployer.New for kops
func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
// create a deployer object and set fields that are not flag controlled

View File

@ -0,0 +1,46 @@
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package deployer
import (
"strings"
"k8s.io/klog/v2"
"sigs.k8s.io/kubetest2/pkg/exec"
)
func (d *deployer) DumpClusterLogs() error {
args := []string{
d.KopsBinaryPath, "toolbox", "dump",
"--name", d.ClusterName,
"--dir",
"--yes",
}
klog.Info(strings.Join(args, " "))
cmd := exec.Command(args[0], args[1:]...)
if err := runWithOutput(cmd); err != nil {
return err
}
return nil
}
func runWithOutput(cmd exec.Cmd) error {
exec.InheritOutput(cmd)
return cmd.Run()
}