From f5b32dac7ed474eb07b00f8a2bb5f573b11e23a6 Mon Sep 17 00:00:00 2001 From: Levi Blackstone Date: Thu, 11 Apr 2019 16:46:22 -0600 Subject: [PATCH] Use different CRDs to allow test parallelism (#534) --- tests/examples/python/python_test.go | 2 +- tests/examples/python/yaml-test/manifest.yaml | 12 +++++------ tests/integration/crds/crd_test.go | 4 ++-- tests/integration/crds/step1/index.ts | 20 +++++++++---------- tests/integration/crds/step2/index.ts | 14 ++++++------- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/tests/examples/python/python_test.go b/tests/examples/python/python_test.go index 230b0ababb..6607e39b3a 100644 --- a/tests/examples/python/python_test.go +++ b/tests/examples/python/python_test.go @@ -90,7 +90,7 @@ func TestYaml(t *testing.T) { assert.Equal(t, tokens.Type("kubernetes:apiextensions.k8s.io/v1beta1:CustomResourceDefinition"), crd.URN.Type()) name, _ = openapi.Pluck(crd.Outputs, "metadata", "name") - assert.True(t, strings.HasPrefix(name.(string), "crontabs.stable.example.com")) + assert.True(t, strings.HasPrefix(name.(string), "foos.bar.example.com")) // Verify namespace. namespace := stackInfo.Deployment.Resources[1] diff --git a/tests/examples/python/yaml-test/manifest.yaml b/tests/examples/python/yaml-test/manifest.yaml index 42616b9439..41959d4665 100644 --- a/tests/examples/python/yaml-test/manifest.yaml +++ b/tests/examples/python/yaml-test/manifest.yaml @@ -30,17 +30,15 @@ items: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: crontabs.stable.example.com + name: foos.bar.example.com spec: - group: stable.example.com + group: bar.example.com versions: - name: v1 served: true storage: true scope: Namespaced names: - plural: crontabs - singular: crontab - kind: CronTab - shortNames: - - ct + plural: foos + singular: foo + kind: Foo diff --git a/tests/integration/crds/crd_test.go b/tests/integration/crds/crd_test.go index 96b999eed3..fcde9bc002 100644 --- a/tests/integration/crds/crd_test.go +++ b/tests/integration/crds/crd_test.go @@ -59,8 +59,8 @@ func TestCRDs(t *testing.T) { // Assert that CRD and CR exist // - assert.Equal(t, "crontab", string(crd.URN.Name())) - assert.Equal(t, "my-new-cron-object", string(ct1.URN.Name())) + assert.Equal(t, "foobar", string(crd.URN.Name())) + assert.Equal(t, "my-new-foobar-object", string(ct1.URN.Name())) }, EditDirs: []integration.EditDir{ { diff --git a/tests/integration/crds/step1/index.ts b/tests/integration/crds/step1/index.ts index 7268a8c736..42e4889528 100644 --- a/tests/integration/crds/step1/index.ts +++ b/tests/integration/crds/step1/index.ts @@ -20,30 +20,30 @@ const namespace = new k8s.core.v1.Namespace("test-namespace"); // Create a CustomResourceDefinition and a CustomResource. // -new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", { - metadata: { name: "crontabs.stable.example.com" }, +new k8s.apiextensions.v1beta1.CustomResourceDefinition("foobar", { + metadata: { name: "foobars.stable.example.com" }, spec: { group: "stable.example.com", version: "v1", scope: "Namespaced", names: { - plural: "crontabs", - singular: "crontab", - kind: "CronTab", - shortNames: ["ct"] + plural: "foobars", + singular: "foobar", + kind: "FooBar", + shortNames: ["fb"] } } }); new k8s.apiextensions.CustomResource( - "my-new-cron-object", + "my-new-foobar-object", { apiVersion: "stable.example.com/v1", - kind: "CronTab", + kind: "FooBar", metadata: { namespace: namespace.metadata.name, - name: "my-new-cron-object", + name: "my-new-foobar-object", }, - spec: { cronSpec: "* * * * */5", image: "my-awesome-cron-image" } + spec: { foo: "such amaze", bar: "wow" } }, ); diff --git a/tests/integration/crds/step2/index.ts b/tests/integration/crds/step2/index.ts index 329d90ffca..0f663c98ff 100644 --- a/tests/integration/crds/step2/index.ts +++ b/tests/integration/crds/step2/index.ts @@ -24,14 +24,14 @@ const namespace = new k8s.core.v1.Namespace("test-namespace"); // new k8s.apiextensions.CustomResource( - "my-new-cron-object", + "my-new-foobar-object", { apiVersion: "stable.example.com/v1", - kind: "CronTab", - metadata: { - namespace: namespace.metadata.name, - name: "my-new-cron-object", - }, - spec: { cronSpec: "* * * * */6", image: "my-awesome-cron-image" } + kind: "FooBar", + metadata: { + namespace: namespace.metadata.name, + name: "my-new-foobar-object", + }, + spec: { foo: "such amaze" } }, );