Commit d6606a6a authored by Timothy St. Clair's avatar Timothy St. Clair

etcd3 validation showed that several unit tests that depend on apiserver being fully

stood up should be integration tests, not unit tests.
parent ff9980e2
...@@ -200,3 +200,6 @@ test/soak/serve_hostnames ...@@ -200,3 +200,6 @@ test/soak/serve_hostnames
third_party/forked/golang/expansion third_party/forked/golang/expansion
pkg/util/maps pkg/util/maps
pkg/volume/quobyte pkg/volume/quobyte
test/integration/discoverysummarizer
test/integration/examples
test/integration/federation
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"testing" "testing"
"time" "time"
"k8s.io/kubernetes/cmd/kubernetes-discovery/discoverysummarizer"
"k8s.io/kubernetes/examples/apiserver" "k8s.io/kubernetes/examples/apiserver"
) )
...@@ -46,10 +47,10 @@ func testResponse(t *testing.T, serverURL, path string, expectedStatusCode int) ...@@ -46,10 +47,10 @@ func testResponse(t *testing.T, serverURL, path string, expectedStatusCode int)
} }
func runDiscoverySummarizer(t *testing.T) string { func runDiscoverySummarizer(t *testing.T) string {
configFilePath := "../config.json" configFilePath := "../../../cmd/kubernetes-discovery/config.json"
port := "9090" port := "9090"
serverURL := "http://localhost:" + port serverURL := "http://localhost:" + port
s, err := NewDiscoverySummarizer(configFilePath) s, err := discoverysummarizer.NewDiscoverySummarizer(configFilePath)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v\n", err) t.Errorf("unexpected error: %v\n", err)
} }
......
...@@ -27,10 +27,11 @@ import ( ...@@ -27,10 +27,11 @@ import (
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1" "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"k8s.io/kubernetes/examples/apiserver"
"k8s.io/kubernetes/pkg/api/unversioned" "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 var groupVersion = v1.SchemeGroupVersion
...@@ -41,7 +42,7 @@ var groupVersionForDiscovery = unversioned.GroupVersionForDiscovery{ ...@@ -41,7 +42,7 @@ var groupVersionForDiscovery = unversioned.GroupVersionForDiscovery{
func TestRun(t *testing.T) { func TestRun(t *testing.T) {
go func() { 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) t.Fatalf("Error in bringing up the server: %v", err)
} }
}() }()
......
...@@ -29,6 +29,7 @@ import ( ...@@ -29,6 +29,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
fed_v1b1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" 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/federation/cmd/federation-apiserver/app/options"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
...@@ -90,7 +91,7 @@ func TestRun(t *testing.T) { ...@@ -90,7 +91,7 @@ func TestRun(t *testing.T) {
s.ServiceClusterIPRange = *ipNet s.ServiceClusterIPRange = *ipNet
s.StorageConfig.ServerList = []string{"http://localhost:2379"} s.StorageConfig.ServerList = []string{"http://localhost:2379"}
go func() { 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) t.Fatalf("Error in bringing up the server: %v", err)
} }
}() }()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment