mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
component tests as integration-tests with short option.
This commit is contained in:
parent
dbdaf2c22b
commit
a1481f5a3e
@ -42,6 +42,7 @@ kube::test::find_integration_test_dirs() {
|
||||
cd ${KUBE_ROOT}
|
||||
find test/integration/${1-} -name '*_test.go' -print0 \
|
||||
| xargs -0n1 dirname \
|
||||
| uniq \
|
||||
| sort -u
|
||||
)
|
||||
}
|
||||
@ -61,7 +62,7 @@ runTests() {
|
||||
# KUBE_RACE="-race"
|
||||
make -C "${KUBE_ROOT}" test \
|
||||
WHAT="$(kube::test::find_integration_test_dirs ${2-} | paste -sd' ' -)" \
|
||||
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \
|
||||
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -short=true -tags 'integration no-docker'" \
|
||||
KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} --vmodule=garbage*collector*=6 --alsologtostderr=true" \
|
||||
KUBE_RACE="" \
|
||||
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
|
||||
|
@ -30,9 +30,8 @@ import (
|
||||
// If you need to start an etcd instance by hand, you also need to insert a key
|
||||
// for this check to pass (*any* key will do, eg:
|
||||
//curl -L http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world").
|
||||
func init() {
|
||||
RequireEtcd()
|
||||
}
|
||||
|
||||
var testing_etcd = false
|
||||
|
||||
func GetEtcdURLFromEnv() string {
|
||||
url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
|
||||
@ -41,6 +40,10 @@ func GetEtcdURLFromEnv() string {
|
||||
}
|
||||
|
||||
func NewEtcdClient() etcd.Client {
|
||||
// gaurded to avoid infinite recursion, check etcd.
|
||||
if testing_etcd {
|
||||
RequireEtcd()
|
||||
}
|
||||
cfg := etcd.Config{
|
||||
Endpoints: []string{GetEtcdURLFromEnv()},
|
||||
}
|
||||
@ -52,9 +55,14 @@ func NewEtcdClient() etcd.Client {
|
||||
}
|
||||
|
||||
func RequireEtcd() {
|
||||
testing_etcd = true
|
||||
defer func() {
|
||||
testing_etcd = false
|
||||
}()
|
||||
if _, err := etcd.NewKeysAPI(NewEtcdClient()).Get(context.TODO(), "/", nil); err != nil {
|
||||
glog.Fatalf("unable to connect to etcd for testing: %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func WithEtcdKey(f func(string)) {
|
||||
|
@ -73,3 +73,6 @@ cd kubernetes/test/component/scheduler/perf
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
||||
|
||||
|
||||
[]()
|
@ -24,11 +24,17 @@ import (
|
||||
|
||||
// TestSchedule100Node3KPods schedules 3k pods on 100 nodes.
|
||||
func TestSchedule100Node3KPods(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping because we want to run short tests")
|
||||
}
|
||||
schedulePods(100, 3000)
|
||||
}
|
||||
|
||||
// TestSchedule1000Node30KPods schedules 30k pods on 1000 nodes.
|
||||
func TestSchedule1000Node30KPods(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping because we want to run short tests")
|
||||
}
|
||||
schedulePods(1000, 30000)
|
||||
}
|
||||
|
@ -41,9 +41,9 @@ kube::log::status "performance test start"
|
||||
# theoretically it has less variance.
|
||||
if ${RUN_BENCHMARK:-false}; then
|
||||
go test -c -o "perf.test"
|
||||
"./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out
|
||||
"./perf.test" -test.bench=. -test.run=xxxx -test.cpuprofile=prof.out -test.short=false
|
||||
kube::log::status "benchmark tests finished"
|
||||
fi
|
||||
# Running density tests. It might take a long time.
|
||||
go test -test.run=. -test.timeout=60m
|
||||
go test -test.run=. -test.timeout=60m -test.short=false
|
||||
kube::log::status "density tests finished"
|
@ -44,7 +44,7 @@ import (
|
||||
// Notes on rate limiter:
|
||||
// - client rate limit is set to 5000.
|
||||
func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destroyFunc func()) {
|
||||
framework.DeleteAllEtcdKeys()
|
||||
// framework.DeleteAllEtcdKeys()
|
||||
|
||||
var m *master.Master
|
||||
masterConfig := framework.NewIntegrationTestMasterConfig()
|
Loading…
Reference in New Issue
Block a user