Skip to content

Commit

Permalink
Merge pull request #30634 from timothysc/etcd3_shouldbe_intergration_…
Browse files Browse the repository at this point in the history
…tests

Automatic merge from submit-queue

Move UTs that block on apiserver to integration tests. 

In validating etcd.v3client we had uncovered that a change in the behavior of the client etcd-io/etcd#6162 , caused a number of unit tests to fail.  These test failures were due to the fact that the unit tests were trying to standup a apiserver even though there was no etcd backend stood up.  

This PR simply shuffles those tests to integration tests, which is where they should be. 

/cc @kubernetes/sig-scalability @wojtek-t @hongchaodeng @xiang90
  • Loading branch information
Kubernetes Submit Queue committed Aug 19, 2016
2 parents 57ad590 + d6606a6 commit c5e3b79
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions hack/.linted_packages
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,6 @@ test/soak/serve_hostnames
third_party/forked/golang/expansion
pkg/util/maps
pkg/volume/quobyte
test/integration/discoverysummarizer
test/integration/examples
test/integration/federation
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"testing"
"time"

"k8s.io/kubernetes/cmd/kubernetes-discovery/discoverysummarizer"
"k8s.io/kubernetes/examples/apiserver"
)

Expand All @@ -46,10 +47,10 @@ func testResponse(t *testing.T, serverURL, path string, expectedStatusCode int)
}

func runDiscoverySummarizer(t *testing.T) string {
configFilePath := "../config.json"
configFilePath := "../../../cmd/kubernetes-discovery/config.json"
port := "9090"
serverURL := "http://localhost:" + port
s, err := NewDiscoverySummarizer(configFilePath)
s, err := discoverysummarizer.NewDiscoverySummarizer(configFilePath)
if err != nil {
t.Errorf("unexpected error: %v\n", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import (
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1"

"github.com/stretchr/testify/assert"
"k8s.io/kubernetes/examples/apiserver"
"k8s.io/kubernetes/pkg/api/unversioned"
)

var serverIP = fmt.Sprintf("http://localhost:%d", InsecurePort)
var serverIP = fmt.Sprintf("http://localhost:%d", apiserver.InsecurePort)

var groupVersion = v1.SchemeGroupVersion

Expand All @@ -41,7 +42,7 @@ var groupVersionForDiscovery = unversioned.GroupVersionForDiscovery{

func TestRun(t *testing.T) {
go func() {
if err := Run(NewServerRunOptions()); err != nil {
if err := apiserver.Run(apiserver.NewServerRunOptions()); err != nil {
t.Fatalf("Error in bringing up the server: %v", err)
}
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/stretchr/testify/assert"

fed_v1b1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
"k8s.io/kubernetes/federation/cmd/federation-apiserver/app"
"k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1"
Expand Down Expand Up @@ -90,7 +91,7 @@ func TestRun(t *testing.T) {
s.ServiceClusterIPRange = *ipNet
s.StorageConfig.ServerList = []string{"http://localhost:2379"}
go func() {
if err := Run(s); err != nil {
if err := app.Run(s); err != nil {
t.Fatalf("Error in bringing up the server: %v", err)
}
}()
Expand Down

0 comments on commit c5e3b79

Please sign in to comment.