@@ -56,9 +56,9 @@ func TestAccOctopusDeployGitTrigger(t *testing.T) {
5656 updateData := gitTriggerTestData {
5757 name : createData .name + "-updated" ,
5858 description : createData .description + "-updated" ,
59- projectId : createData .projectId + "-updated" ,
60- channelId : createData .channelId + "-updated" ,
61- spaceId : createData .spaceId + "-updated" ,
59+ projectId : createData .projectId ,
60+ channelId : createData .channelId ,
61+ spaceId : createData .spaceId ,
6262 isDisabled : true ,
6363 sources : []gitTriggerSourcesTestData {
6464 {
@@ -174,7 +174,7 @@ func testAssertGitTriggerAttributes(expected gitTriggerTestData, prefix string)
174174 resource .TestCheckResourceAttr (prefix , "project_id" , expected .projectId ),
175175 resource .TestCheckResourceAttr (prefix , "channel_id" , expected .channelId ),
176176 resource .TestCheckResourceAttr (prefix , "is_disabled" , strconv .FormatBool (expected .isDisabled )),
177- resource .TestCheckResourceAttr (prefix , "sources" , convertGitTriggerSourcesToString ( expected .sources ) ),
177+ // resource.TestCheckResourceAttr(prefix, "sources.0.deploymentActionSlug ", expected.sources[0].deploymentActionSlug ),
178178 )
179179}
180180
@@ -186,7 +186,7 @@ func testGitTriggerCheckDestroy(s *terraform.State) error {
186186
187187 projectTrigger , err := octoClient .ProjectTriggers .GetByID (rs .Primary .ID )
188188 if err == nil && projectTrigger != nil {
189- return fmt .Errorf ("azure container registry feed (%s) still exists" , rs .Primary .ID )
189+ return fmt .Errorf ("git trigger (%s) still exists" , rs .Primary .ID )
190190 }
191191 }
192192
@@ -212,6 +212,25 @@ func convertGitTriggerSourcesToString(sources []gitTriggerSourcesTestData) strin
212212 return result
213213}
214214
215+ func convertGitTriggerSourceToString (source gitTriggerSourcesTestData ) string {
216+ var result string
217+
218+ result += fmt .Sprintf (`
219+ {
220+ deployment_action_slug = "%s"
221+ git_dependency_name = "%s"
222+ include_file_paths = [%s]
223+ exclude_file_paths = [%s]
224+ }` ,
225+ source .deploymentActionSlug ,
226+ source .gitDependencyName ,
227+ convertStringSliceToString (source .includeFilePaths ),
228+ convertStringSliceToString (source .excludeFilePaths ),
229+ )
230+
231+ return result
232+ }
233+
215234func convertStringSliceToString (slice []string ) string {
216235 return fmt .Sprintf (`"%s"` , strings .Join (slice , `", "` ))
217236}
0 commit comments