Skip to content

Commit

Permalink
adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lindnerby committed Nov 6, 2024
1 parent cc8bdde commit 8105eee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions cmd/modulectl/create/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/create/create_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
14 changes: 10 additions & 4 deletions tests/e2e/create/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 8105eee

Please sign in to comment.