Skip to content

Commit

Permalink
fix: commit_queue_test should use s.ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackarySantana committed Dec 9, 2024
1 parent df9eb9f commit ca278af
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions trigger/commit_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ func TestCommitQueueTriggers(t *testing.T) {
}

type commitQueueSuite struct {
event event.EventLogEntry
data *event.CommitQueueEventData
subs []event.Subscription
event event.EventLogEntry
data *event.CommitQueueEventData
subs []event.Subscription
ctx context.Context
cancel context.CancelFunc

t *commitQueueTriggers

Expand All @@ -37,6 +39,8 @@ func (s *commitQueueSuite) SetupSuite() {
}

func (s *commitQueueSuite) SetupTest() {
s.ctx, s.cancel = context.WithCancel(context.Background())

s.NoError(db.ClearCollections(event.EventCollection, patch.Collection, event.SubscriptionsCollection, event.SubscriptionsCollection, model.ProjectRefCollection))

s.data = &event.CommitQueueEventData{
Expand Down Expand Up @@ -80,11 +84,12 @@ func (s *commitQueueSuite) SetupTest() {
s.t.patch = &p
}

func (s *commitQueueSuite) TestEmailUnescapesDescription() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
func (s *commitQueueSuite) TearDownTest() {
s.cancel()
}

n, err := s.t.commitQueueOutcome(ctx, &s.subs[0])
func (s *commitQueueSuite) TestEmailUnescapesDescription() {
n, err := s.t.commitQueueOutcome(s.ctx, &s.subs[0])
s.NoError(err)
s.NotNil(n)
payload, ok := n.Payload.(*message.Email)
Expand Down

0 comments on commit ca278af

Please sign in to comment.