diff --git a/cmd/modulectl/create/cmd_test.go b/cmd/modulectl/create/cmd_test.go index fe145f5..b00385c 100644 --- a/cmd/modulectl/create/cmd_test.go +++ b/cmd/modulectl/create/cmd_test.go @@ -48,7 +48,6 @@ func Test_Execute_ReturnsError_WhenModuleServiceReturnsError(t *testing.T) { func Test_Execute_ParsesAllModuleOptions(t *testing.T) { moduleConfigFile := testutils.RandomName(10) credentials := testutils.RandomName(10) - gitRemote := testutils.RandomName(10) insecure := "true" templateOutput := testutils.RandomName(10) registryURL := testutils.RandomName(10) @@ -57,7 +56,6 @@ func Test_Execute_ParsesAllModuleOptions(t *testing.T) { os.Args = []string{ "create", "--config-file", moduleConfigFile, - "--git-remote", gitRemote, "--insecure", insecure, "--output", templateOutput, "--registry", registryURL, diff --git a/tests/e2e/create/create_suite_test.go b/tests/e2e/create/create_suite_test.go index 14b1b32..96072ea 100644 --- a/tests/e2e/create/create_suite_test.go +++ b/tests/e2e/create/create_suite_test.go @@ -53,7 +53,6 @@ const ( ociRegistry = "http://k3d-oci.localhost:5001" templateOutputPath = "/tmp/template.yaml" - gitRemote = "https://github.com/kyma-project/template-operator" ) // Command wrapper for `modulectl create` diff --git a/tests/e2e/create/create_test.go b/tests/e2e/create/create_test.go index 2fbfd3c..af0b58d 100644 --- a/tests/e2e/create/create_test.go +++ b/tests/e2e/create/create_test.go @@ -339,8 +339,15 @@ var _ = Describe("Test 'create' command", Ordered, func() { Expect(localBlobAccessSpec.LocalReference).To(ContainSubstring("sha256:")) Expect(localBlobAccessSpec.MediaType).To(Equal("application/x-tar")) - By("And descriptor.component.sources should be empty") - Expect(len(descriptor.Sources)).To(Equal(0)) + By("And descriptor.component.sources should contain repository entry") + Expect(len(descriptor.Sources)).To(Equal(1)) + source := descriptor.Sources[0] + sourceAccessSpec, err := ocm.DefaultContext().AccessSpecForSpec(source.Access) + Expect(err).ToNot(HaveOccurred()) + githubAccessSpec, ok := sourceAccessSpec.(*github.AccessSpec) + Expect(ok).To(BeTrue()) + Expect(github.Type).To(Equal(githubAccessSpec.Type)) + Expect(githubAccessSpec.RepoURL).To(Equal("https://github.com/kyma-project/template-operator")) By("And spec.mandatory should be false") Expect(template.Spec.Mandatory).To(BeFalse()) @@ -456,14 +463,13 @@ var _ = Describe("Test 'create' command", Ordered, func() { Context("Given 'modulectl create' command", func() { var cmd createCmd - It("When invoked with valid module-config containing security-scanner-config and different version, and the git-remote flag", + It("When invoked with valid module-config containing security-scanner-config and different version", func() { cmd = createCmd{ moduleConfigFile: withSecurityConfig, registry: ociRegistry, insecure: true, output: templateOutputPath, - gitRemote: gitRemote, } }) It("Then the command should succeed", func() {