mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 03:18:32 +00:00
fix: Better determine number of expected comments and webhooks in e2e test (#3907)
* fix: Better determine number of expected comments and webhooks in e2e test * Cleanup
This commit is contained in:
@@ -111,7 +111,28 @@ func TestGitHubWorkflow(t *testing.T) {
|
||||
ExpAllowResponseCommentBack bool
|
||||
// ExpParseFailedCount represents how many times test sends invalid commands
|
||||
ExpParseFailedCount int
|
||||
// ExpNoLocksToDelete whether we expect that there are no locks at the end to delete
|
||||
ExpNoLocksToDelete bool
|
||||
}{
|
||||
{
|
||||
Description: "no comment or change",
|
||||
RepoDir: "simple",
|
||||
ModifiedFiles: []string{},
|
||||
Comments: []string{},
|
||||
ExpReplies: [][]string{},
|
||||
ExpNoLocksToDelete: true,
|
||||
},
|
||||
{
|
||||
Description: "no comment",
|
||||
RepoDir: "simple",
|
||||
ModifiedFiles: []string{"main.tf"},
|
||||
Comments: []string{},
|
||||
ExpReplies: [][]string{
|
||||
{"exp-output-autoplan.txt"},
|
||||
{"exp-output-merge.txt"},
|
||||
},
|
||||
ExpAutoplan: true,
|
||||
},
|
||||
{
|
||||
Description: "simple",
|
||||
RepoDir: "simple",
|
||||
@@ -208,6 +229,7 @@ func TestGitHubWorkflow(t *testing.T) {
|
||||
},
|
||||
ExpAllowResponseCommentBack: true,
|
||||
ExpParseFailedCount: 1,
|
||||
ExpNoLocksToDelete: true,
|
||||
},
|
||||
{
|
||||
Description: "simple with atlantis.yaml",
|
||||
@@ -618,9 +640,13 @@ func TestGitHubWorkflow(t *testing.T) {
|
||||
|
||||
// Now we're ready to verify Atlantis made all the comments back (or
|
||||
// replies) that we expect. We expect each plan to have 1 comment,
|
||||
// and apply have 1 for each comment plus one for the locks deleted at the
|
||||
// end.
|
||||
expNumReplies := len(c.Comments) + 1 - c.ExpParseFailedCount
|
||||
// and apply have 1 for each comment
|
||||
expNumReplies := len(c.Comments)
|
||||
|
||||
// If there are locks to delete at the end, that will take a comment
|
||||
if !c.ExpNoLocksToDelete {
|
||||
expNumReplies++
|
||||
}
|
||||
|
||||
if c.ExpAutoplan {
|
||||
expNumReplies++
|
||||
|
||||
Reference in New Issue
Block a user