Commit feb43c5e authored by Maciej Szulik's avatar Maciej Szulik

Reapply ScheduledJob tests (2ab885a5)

parent 631772bd
...@@ -58,6 +58,8 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} ...@@ -58,6 +58,8 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-}
# Lists of API Versions of each groups that should be tested, groups are # Lists of API Versions of each groups that should be tested, groups are
# separated by comma, lists are separated by semicolon. e.g., # separated by comma, lists are separated by semicolon. e.g.,
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
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"} 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 # once we have multiple group supports
# Create a junit-style XML test report in this directory if set. # Create a junit-style XML test report in this directory if set.
......
...@@ -29,6 +29,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -29,6 +29,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# TODO: It's going to be: # 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"}
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"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 # Give integration tests longer to run
......
...@@ -169,6 +169,10 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source) ...@@ -169,6 +169,10 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source)
j.ManualSelector = nil j.ManualSelector = nil
} }
}, },
func(cp *batch.ConcurrencyPolicy, c fuzz.Continue) {
policies := []batch.ConcurrencyPolicy{batch.AllowConcurrent, batch.ForbidConcurrent, batch.ReplaceConcurrent}
*cp = policies[c.Rand.Intn(len(policies))]
},
func(j *api.List, c fuzz.Continue) { func(j *api.List, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again c.FuzzNoCustom(j) // fuzz self without calling this function again
// TODO: uncomment when round trip starts from a versioned object // TODO: uncomment when round trip starts from a versioned object
......
...@@ -429,6 +429,19 @@ func TestDiscoveryAtAPIS(t *testing.T) { ...@@ -429,6 +429,19 @@ func TestDiscoveryAtAPIS(t *testing.T) {
Version: testapi.Autoscaling.GroupVersion().Version, Version: testapi.Autoscaling.GroupVersion().Version,
}, },
}, },
// batch is using its pkg/apis/batch/ types here since during installation
// both versions get installed and testapi.go currently does not support
// multi-versioned clients
batch.GroupName: {
{
GroupVersion: batchapiv1.SchemeGroupVersion.String(),
Version: batchapiv1.SchemeGroupVersion.Version,
},
{
GroupVersion: batchapiv2alpha1.SchemeGroupVersion.String(),
Version: batchapiv2alpha1.SchemeGroupVersion.Version,
},
},
apps.GroupName: { apps.GroupName: {
{ {
GroupVersion: testapi.Apps.GroupVersion().String(), GroupVersion: testapi.Apps.GroupVersion().String(),
...@@ -442,15 +455,6 @@ func TestDiscoveryAtAPIS(t *testing.T) { ...@@ -442,15 +455,6 @@ func TestDiscoveryAtAPIS(t *testing.T) {
}, },
}, },
} }
var batchVersions []unversioned.GroupVersionForDiscovery
for _, gv := range testapi.Batch.GroupVersions() {
batchVersions = append(batchVersions, unversioned.GroupVersionForDiscovery{
GroupVersion: gv.String(),
Version: gv.Version,
})
}
expectVersions[batch.GroupName] = batchVersions
expectPreferredVersion := map[string]unversioned.GroupVersionForDiscovery{ expectPreferredVersion := map[string]unversioned.GroupVersionForDiscovery{
autoscaling.GroupName: { autoscaling.GroupName: {
GroupVersion: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.String(), GroupVersion: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.String(),
......
...@@ -33,6 +33,7 @@ import ( ...@@ -33,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/batch/v2alpha1"
"k8s.io/kubernetes/pkg/client/restclient" "k8s.io/kubernetes/pkg/client/restclient"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/master" "k8s.io/kubernetes/pkg/master"
...@@ -257,6 +258,9 @@ var deleteResp string = ` ...@@ -257,6 +258,9 @@ var deleteResp string = `
// Job share storage. This test can be deleted when Jobs is removed from ext/v1beta1, // Job share storage. This test can be deleted when Jobs is removed from ext/v1beta1,
// (expected to happen in 1.4). // (expected to happen in 1.4).
func TestBatchGroupBackwardCompatibility(t *testing.T) { func TestBatchGroupBackwardCompatibility(t *testing.T) {
if *testapi.Batch.GroupVersion() == v2alpha1.SchemeGroupVersion {
t.Skip("Shared job storage is not required for batch/v2alpha1.")
}
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
transport := http.DefaultTransport transport := http.DefaultTransport
......
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