From 8af08f90b53e901f2f4234f1f17307eab9c928ab Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 16 Jun 2016 14:27:12 -0700 Subject: [PATCH 1/2] remove unused prefix code, fix comment --- hack/test-go.sh | 25 +++------------------- test/integration/framework/master_utils.go | 6 +++--- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/hack/test-go.sh b/hack/test-go.sh index f87b16559e5..676c2392216 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -60,8 +60,6 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1,federation/v1alpha1;v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1"} # once we have multiple group supports -# Run tests with the standard (registry) etcd prefix. -KUBE_TEST_ETCD_PREFIXES=${KUBE_TEST_ETCD_PREFIXES:-"registry"} # Create a junit-style XML test report in this directory if set. KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-} # Set to 'y' to keep the verbose stdout from tests when KUBE_JUNIT_REPORT_DIR is @@ -315,29 +313,12 @@ checkFDs # Convert the CSVs to arrays. IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}" -IFS=',' read -a etcdPrefixes <<< "${KUBE_TEST_ETCD_PREFIXES}" apiVersionsCount=${#apiVersions[@]} -etcdPrefixesCount=${#etcdPrefixes[@]} -for (( i=0, j=0; ; )); do +for (( i=0; i<${apiVersionsCount}; i++ )); do apiVersion=${apiVersions[i]} - etcdPrefix=${etcdPrefixes[j]} - echo "Running tests for APIVersion: $apiVersion with etcdPrefix: $etcdPrefix" + echo "Running tests for APIVersion: $apiVersion" # KUBE_TEST_API sets the version of each group to be tested. - KUBE_TEST_API="${apiVersion}" ETCD_PREFIX=${etcdPrefix} runTests "$@" - i=${i}+1 - j=${j}+1 - if [[ i -eq ${apiVersionsCount} ]] && [[ j -eq ${etcdPrefixesCount} ]]; then - # All api versions and etcd prefixes tested. - break - fi - if [[ i -eq ${apiVersionsCount} ]]; then - # Use the last api version for remaining etcd prefixes. - i=${i}-1 - fi - if [[ j -eq ${etcdPrefixesCount} ]]; then - # Use the last etcd prefix for remaining api versions. - j=${j}-1 - fi + KUBE_TEST_API="${apiVersion}" runTests "$@" done # We might run the tests for multiple versions, but we want to report only diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 1fef1141ef4..3242a5ea961 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -155,9 +155,9 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se func NewMasterConfig() *master.Config { config := storagebackend.Config{ ServerList: []string{"http://127.0.0.1:4001"}, - // TODO: this is a quick hack to work around #27179. It - // conveniently exercises the prefix code, so maybe it's worth - // leaving in. + // This causes the integration tests to exercise the etcd + // prefix code, so please don't change without ensuring + // sufficient coverage in other ways. Prefix: uuid.New(), } From 22eac7e56ad72d1bdd5fb48aac74acb56fe90efc Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 16 Jun 2016 14:30:53 -0700 Subject: [PATCH 2/2] stop double testing, extra coverage not worth the time --- hack/test-go.sh | 2 +- hack/test-integration.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/test-go.sh b/hack/test-go.sh index 676c2392216..a63b684a4e0 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -58,7 +58,7 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} # Lists of API Versions of each groups that should be tested, groups are # separated by comma, lists are separated by semicolon. e.g., # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" -KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1,federation/v1alpha1;v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1"} +KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1"} # once we have multiple group supports # Create a junit-style XML test report in this directory if set. KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-} diff --git a/hack/test-integration.sh b/hack/test-integration.sh index 9f47d1e257a..e7a437ceb3a 100755 --- a/hack/test-integration.sh +++ b/hack/test-integration.sh @@ -29,7 +29,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # TODO: It's going to be: # KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"} -KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1;v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1"} +KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1"} # Give integration tests longer to run # TODO: allow a larger value to be passed in