timflannagan / rukpak

Rukpak runs in a Kubernetes cluster and defines an API for installing cloud native bundle content
Apache License 2.0
0 stars 0 forks source link

there should actually be 7 objects on the status once the unpacker supports nest... #22

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/timflannagan/rukpak/blob/1b85f443f3e9395fe08954cd487249aba2b9e7c9/test/e2e/plain_provisioner_test.go#L336


        })
    })

    When("Bundles are backed by a git repository", func() {
        var (
            bundles []*rukpakv1alpha1.Bundle
            ctx     context.Context
        )
        BeforeEach(func() {
            ctx = context.Background()

            By("creating the git based Bundles")
            bundles = []*rukpakv1alpha1.Bundle{
                {
                    ObjectMeta: metav1.ObjectMeta{
                        GenerateName: "combo-git-commit",
                    },
                    Spec: rukpakv1alpha1.BundleSpec{
                        ProvisionerClassName: plainProvisionerID,
                        Source: rukpakv1alpha1.BundleSource{
                            Type: "git",
                            Git: rukpakv1alpha1.GitSource{
                                Repository: "https://github.com/operator-framework/combo",
                                Ref: rukpakv1alpha1.GitRef{
                                    Commit: "4567031e158b42263e70a7c63e29f8981a4a6135",
                                },
                            },
                        },
                    },
                },
                {
                    ObjectMeta: metav1.ObjectMeta{
                        GenerateName: "combo-git-tag",
                    },
                    Spec: rukpakv1alpha1.BundleSpec{
                        ProvisionerClassName: plainProvisionerID,
                        Source: rukpakv1alpha1.BundleSource{
                            Type: "git",
                            Git: rukpakv1alpha1.GitSource{
                                Repository: "https://github.com/operator-framework/combo",
                                Ref: rukpakv1alpha1.GitRef{
                                    Branch: "main",
                                    Tag:    "v0.0.1",
                                },
                            },
                        },
                    },
                },
            }

            for _, bundle := range bundles {
                err := c.Create(ctx, bundle)
                Expect(err).To(BeNil())
            }
        })
        AfterEach(func() {
            By("deleting the testing Bundle resource")
            for _, bundle := range bundles {
                err := c.Delete(ctx, bundle)
                Expect(err).To(BeNil())
            }
        })

        It("should source the git content specified and unpack it to the cluster successfully", func() {
            By("eventually reporting an Unpacked phase", func() {
                for _, bundle := range bundles {
                    Eventually(func() bool {
                        if err := c.Get(ctx, client.ObjectKeyFromObject(bundle), bundle); err != nil {
                            return false
                        }
                        return bundle.Status.Phase == rukpakv1alpha1.PhaseUnpacked
                    }).Should(BeTrue())
                }
            })

            By("eventually writing a non-empty list of unpacked objects to the status", func() {
                for _, bundle := range bundles {
                    Eventually(func() bool {
                        if err := c.Get(ctx, client.ObjectKeyFromObject(bundle), bundle); err != nil {
                            return false
                        }
                        if bundle.Status.Info == nil {
                            return false
                        }
                        // TODO: there should actually be 7 objects on the status once the unpacker supports nested dirs
                        return len(bundle.Status.Info.Objects) == 5
                    }).Should(BeTrue())
                }
            })
        })
    })
github-actions[bot] commented 2 years ago

This issue has become stale because it has been open 60 days with no activity. The maintainers of this repo will remove this label during issue triage or it will be removed automatically after an update. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.