Skip to content

Commit

Permalink
update tests with GetQueuedRevisionsSummary queue interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tlin4194 committed Oct 26, 2024
1 parent 4a5c4a0 commit a986769
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package queue_test

import (
"github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier"
"testing"
"time"

"github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier"

"github.com/google/uuid"
"github.com/runatlantis/atlantis/server/neptune/workflows/activities"
"github.com/runatlantis/atlantis/server/neptune/workflows/activities/github"
Expand All @@ -14,6 +15,7 @@ import (
"github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"go.temporal.io/sdk/temporal"
"go.temporal.io/sdk/testsuite"
"go.temporal.io/sdk/workflow"
)
Expand All @@ -25,9 +27,13 @@ type testCheckRunClient struct {
}

func (t *testCheckRunClient) CreateOrUpdate(ctx workflow.Context, deploymentID string, request notifier.GithubCheckRunRequest) (int64, error) {
assert.Equal(t.expectedT, t.expectedRequest, request)
assert.Equal(t.expectedT, t.expectedDeploymentID, deploymentID)
switch {
case assert.Equal(t.expectedT, t.expectedRequest, request):

case assert.Equal(t.expectedT, t.expectedDeploymentID, deploymentID):
default:
return 1, temporal.NewApplicationError("failing workflow", "myType")
}
return 1, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (q *testQueue) SetLockForMergedItems(ctx workflow.Context, state queue.Lock
q.Lock = state
}

func (q *testQueue) GetQueuedRevisionsSummary() string {
return "Revisions in queue"
}

type workerRequest struct {
Queue []internalTerraform.DeploymentInfo
ExpectedValidationErrors []*queue.ValidationError
Expand Down

0 comments on commit a986769

Please sign in to comment.