Skip to content

Commit

Permalink
up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samirtahir91 committed Apr 1, 2024
1 parent c6ebc4a commit e511ed3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/controller/githubapp_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ var _ = Describe("GithubApp controller", func() {

Context("When setting up the test environment", func() {
It("Should create GithubApp custom resources", func() {
By("Creating the privateKeySecret in the namespace1")
ctx := context.Background()

By("Creating the privateKeySecret in the namespace1")
createPrivateKeySecret(ctx, namespace1, "privateKey")

By("Creating a first GithubApp custom resource in the namespace1")
Expand All @@ -139,7 +140,6 @@ var _ = Describe("GithubApp controller", func() {

Context("When reconciling a GithubApp", func() {
It("should successfully reconcile the resource", func() {
By("Reconciling the created resource")
ctx := context.Background()

By("Retrieving the access token secret")
Expand All @@ -154,8 +154,9 @@ var _ = Describe("GithubApp controller", func() {

Context("When deleting an access token secret", func() {
It("should successfully reconcile the secret again", func() {
By("Deleting the access token secret")
ctx := context.Background()

By("Deleting the access token secret")
var retrievedSecret corev1.Secret
err := k8sClient.Delete(ctx, &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -231,16 +232,16 @@ var _ = Describe("GithubApp controller", func() {

Context("When requeing a reconcile for a GithubApp that is not expired", func() {
It("should successfully reconcile the resource and get the rate limit", func() {
By("Reconciling the created resource")
ctx := context.Background()

By("Reconciling the created resource")
controllerReconciler := &GithubAppReconciler{
Client: k8sClient,
Scheme: k8sClient.Scheme(),
}

// Perform reconciliation for the resource
result, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
err := controllerReconciler.Reconcile(ctx, reconcile.Request{

Check failure on line 244 in internal/controller/githubapp_controller_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint and staticcheck

assignment mismatch: 1 variable but controllerReconciler.Reconcile returns 2 values (typecheck)
NamespacedName: types.NamespacedName{
Namespace: namespace1,
Name: githubAppName,
Expand Down

0 comments on commit e511ed3

Please sign in to comment.