Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
delete unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaKitazawa committed May 28, 2022
1 parent f7ef652 commit ed00044
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions controllers/reviewappmanager_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ package controllers

import (
"context"
"fmt"
"time"

"github.com/go-logr/glogr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -160,35 +158,6 @@ var _ = Describe("ReviewAppManager controller", func() {
// It("should be updated ReviewApp when PR is updated", func() {
// })

It("should be deleted ReviewApp when PR is closed", func() {
// Control external resources: open PR for test
err := ghClient.OpenPr(testGitAppOrganization, testGitAppRepository, testGitAppPrNumForRAM)
Expect(err).NotTo(HaveOccurred())

_, err = createSomeResourceForReviewAppManagerTest(ctx)
Expect(err).NotTo(HaveOccurred())

// Control external resources: close PR for test
err = ghClient.ClosePr(testGitAppOrganization, testGitAppRepository, testGitAppPrNumForRAM)
Expect(err).NotTo(HaveOccurred())

// wait to run reconcile loop
ra := dreamkastv1alpha1.ReviewApp{}
Eventually(func() error {
err := k8sClient.Get(ctx, client.ObjectKey{Namespace: testNamespace, Name: "test-ram-shotakitazawa-reviewapp-operator-demo-app-1"}, &ra)
if err != nil {
if apierrors.IsNotFound(err) {
return nil
}
return err
}
return fmt.Errorf("ReviewApp must not exist")
},
60*time.Second, // timeout
10*time.Second, // interval
).Should(Succeed())
})

It("should be created PullRequest when PR is opened", func() {
// Control external resources: open PR for test
err := ghClient.OpenPr(testGitAppOrganization, testGitAppRepository, testGitAppPrNumForRAM)
Expand Down

0 comments on commit ed00044

Please sign in to comment.