Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to run integration tests in parallel #27034

Merged
merged 1 commit into from
Jun 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/integration/framework/etcd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/storage"
etcdstorage "k8s.io/kubernetes/pkg/storage/etcd"
"k8s.io/kubernetes/pkg/storage/etcd/etcdtest"
"k8s.io/kubernetes/pkg/util/env"
)

// If you need to start an etcd instance by hand, you also need to insert a key
Expand All @@ -37,9 +38,15 @@ func init() {
RequireEtcd()
}

func GetEtcdURLFromEnv() string {
url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:4001")
glog.V(4).Infof("Using KUBE_INTEGRATION_ETCD_URL=%q", url)
return url
}

func NewEtcdClient() etcd.Client {
cfg := etcd.Config{
Endpoints: []string{"http://127.0.0.1:4001"},
Endpoints: []string{GetEtcdURLFromEnv()},
}
client, err := etcd.New(cfg)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/framework/master_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se
// Returns a basic master config.
func NewMasterConfig() *master.Config {
config := storagebackend.Config{
ServerList: []string{"http://127.0.0.1:4001"},
ServerList: []string{GetEtcdURLFromEnv()},
// This causes the integration tests to exercise the etcd
// prefix code, so please don't change without ensuring
// sufficient coverage in other ways.
Expand Down
3 changes: 2 additions & 1 deletion test/integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import (
"github.com/golang/glog"
"golang.org/x/net/context"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/test/integration/framework"
)

func newEtcdClient() etcd.Client {
cfg := etcd.Config{
Endpoints: []string{"http://127.0.0.1:4001"},
Endpoints: []string{framework.GetEtcdURLFromEnv()},
}
client, err := etcd.New(cfg)
if err != nil {
Expand Down