From b0bba20aa44e30ef0296b89f336d426224d73a16 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Tue, 28 Nov 2023 09:32:26 +0100 Subject: [PATCH] Fix gitlab migration unit test Closes #1837. The differences in dates can be explained by commit e19b9653ea, which changed the order in which "created_date" and "updated_date" are considered. --- services/migrations/gitlab_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/migrations/gitlab_test.go b/services/migrations/gitlab_test.go index 731486eff2..697066c8bf 100644 --- a/services/migrations/gitlab_test.go +++ b/services/migrations/gitlab_test.go @@ -291,7 +291,7 @@ func TestGitlabDownloadRepo(t *testing.T) { }, Base: base.PullRequestBranch{ Ref: "master", - SHA: "", + SHA: "c59c9b451acca9d106cc19d61d87afe3fbbb8b83", OwnerName: "lafriks", RepoName: "test_repo", }, @@ -309,16 +309,16 @@ func TestGitlabDownloadRepo(t *testing.T) { assertReviewsEqual(t, []*base.Review{ { IssueIndex: 1, - ReviewerID: 4102996, - ReviewerName: "zeripath", - CreatedAt: time.Date(2019, 11, 28, 16, 2, 8, 377000000, time.UTC), + ReviewerID: 527793, + ReviewerName: "axifive", + CreatedAt: time.Date(2019, 11, 28, 8, 54, 41, 34000000, time.UTC), State: "APPROVED", }, { IssueIndex: 1, - ReviewerID: 527793, - ReviewerName: "axifive", - CreatedAt: time.Date(2019, 11, 28, 16, 2, 8, 377000000, time.UTC), + ReviewerID: 4102996, + ReviewerName: "zeripath", + CreatedAt: time.Date(2019, 11, 28, 8, 54, 41, 34000000, time.UTC), State: "APPROVED", }, }, rvs) @@ -330,7 +330,7 @@ func TestGitlabDownloadRepo(t *testing.T) { IssueIndex: 2, ReviewerID: 4575606, ReviewerName: "real6543", - CreatedAt: time.Date(2020, 4, 19, 19, 24, 21, 108000000, time.UTC), + CreatedAt: time.Date(2019, 11, 28, 15, 56, 54, 108000000, time.UTC), State: "APPROVED", }, }, rvs)