Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: support single comment summary with orchestrator mode #1850

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
motatoes committed Dec 21, 2024
commit 6df110bd0189f93d930deafaeb58b6e85d826eca
10 changes: 7 additions & 3 deletions cli/pkg/digger/digger_test.go
Original file line number Diff line number Diff line change
@@ -86,7 +86,12 @@ func (m *MockPRManager) GetApprovals(prNumber int) ([]string, error) {

func (m *MockPRManager) PublishComment(prNumber int, comment string) (*ci.Comment, error) {
m.Commands = append(m.Commands, RunInfo{"PublishComment", strconv.Itoa(prNumber) + " " + comment, time.Now()})
return nil, nil
return &ci.Comment{
Id: "",
DiscussionId: "",
Body: nil,
Url: "",
}, nil
}

func (m *MockPRManager) ListIssues() ([]*ci.Issue, error) {
@@ -241,7 +246,6 @@ func (m MockPlanPathProvider) LocalPlanFilePath() string {
}

func TestCorrectCommandExecutionWhenApplying(t *testing.T) {

commandRunner := &MockCommandRunner{}
terraformExecutor := &MockTerraformExecutor{}
prManager := &MockPRManager{}
@@ -288,7 +292,7 @@ func TestCorrectCommandExecutionWhenApplying(t *testing.T) {

commandStrings := allCommandsInOrderWithParams(terraformExecutor, commandRunner, prManager, lock, planStorage, planPathProvider)

assert.Equal(t, []string{"RetrievePlan plan", "Init ", "Apply ", "PublishComment 1 <details ><summary>Apply output</summary>\n\n```terraform\n\n```\n</details>", "Run echo"}, commandStrings)
assert.Equal(t, []string{"RetrievePlan plan", "Init ", "Apply ", "Run echo"}, commandStrings)
}

func TestCorrectCommandExecutionWhenDestroying(t *testing.T) {
Loading
Oops, something went wrong.