mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-08 23:58:43 +00:00
Updating diffKeywordRegex to properly handle new test case (#2551)
* new resource was added to test TestRenderProjectResultsWithEnableDiffMarkdownFormat * Correct test case * 1st regex change * Adding one more pattern to regex Co-authored-by: dyurovskykh-tivo <Dmytro.Yurovskykh@tivo.com>
This commit is contained in:
committed by
GitHub
parent
c2904218e5
commit
4cc5cf6848
@@ -2222,7 +2222,41 @@ Terraform will perform the following actions:
|
||||
]
|
||||
}
|
||||
|
||||
Plan: 1 to add, 1 to change, 1 to destroy.
|
||||
# aws_api_gateway_rest_api.rest_api will be updated in-place
|
||||
~ resource "aws_api_gateway_rest_api" "rest_api" {
|
||||
~ body = <<-EOT
|
||||
openapi: 3.0.0
|
||||
security:
|
||||
- SomeAuth: []
|
||||
paths:
|
||||
/someEndpoint:
|
||||
get:
|
||||
- operationId: someOperation
|
||||
+ operationId: someOperation2
|
||||
responses:
|
||||
204:
|
||||
description: Empty response.
|
||||
components:
|
||||
schemas:
|
||||
SomeEnum:
|
||||
type: string
|
||||
enum:
|
||||
- value1
|
||||
- value2
|
||||
securitySchemes:
|
||||
SomeAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: Authorization
|
||||
EOT
|
||||
id = "4i5suz5c4l"
|
||||
name = "test"
|
||||
tags = {}
|
||||
# (9 unchanged attributes hidden)
|
||||
# (1 unchanged block hidden)
|
||||
}
|
||||
|
||||
Plan: 1 to add, 2 to change, 1 to destroy.
|
||||
`
|
||||
cases := []struct {
|
||||
Description string
|
||||
@@ -2399,7 +2433,41 @@ Terraform will perform the following actions:
|
||||
]
|
||||
}
|
||||
|
||||
Plan: 1 to add, 1 to change, 1 to destroy.
|
||||
# aws_api_gateway_rest_api.rest_api will be updated in-place
|
||||
! resource "aws_api_gateway_rest_api" "rest_api" {
|
||||
! body = <<-EOT
|
||||
openapi: 3.0.0
|
||||
security:
|
||||
- SomeAuth: []
|
||||
paths:
|
||||
/someEndpoint:
|
||||
get:
|
||||
- operationId: someOperation
|
||||
+ operationId: someOperation2
|
||||
responses:
|
||||
204:
|
||||
description: Empty response.
|
||||
components:
|
||||
schemas:
|
||||
SomeEnum:
|
||||
type: string
|
||||
enum:
|
||||
- value1
|
||||
- value2
|
||||
securitySchemes:
|
||||
SomeAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: Authorization
|
||||
EOT
|
||||
id = "4i5suz5c4l"
|
||||
name = "test"
|
||||
tags = {}
|
||||
# (9 unchanged attributes hidden)
|
||||
# (1 unchanged block hidden)
|
||||
}
|
||||
|
||||
Plan: 1 to add, 2 to change, 1 to destroy.
|
||||
|
||||
$$$
|
||||
|
||||
@@ -2407,7 +2475,7 @@ $$$
|
||||
* :repeat: To **plan** this project again, comment:
|
||||
* $atlantis plan -d path -w workspace$
|
||||
</details>
|
||||
Plan: 1 to add, 1 to change, 1 to destroy.
|
||||
Plan: 1 to add, 2 to change, 1 to destroy.
|
||||
|
||||
|
||||
`,
|
||||
|
||||
@@ -384,7 +384,7 @@ func (p *PlanSuccess) Summary() string {
|
||||
|
||||
// DiffMarkdownFormattedTerraformOutput formats the Terraform output to match diff markdown format
|
||||
func (p PlanSuccess) DiffMarkdownFormattedTerraformOutput() string {
|
||||
diffKeywordRegex := regexp.MustCompile(`(?m)^( +)([-+~]\s)(.*)(\s=\s|\s->\s|<<|\{|\(known after apply\)|\[)(.*)`)
|
||||
diffKeywordRegex := regexp.MustCompile(`(?m)^( +)([-+~]\s)(.*)(\s=\s|\s->\s|<<|\{|\(known after apply\)| {2,}[^ ]+:.*)(.*)`)
|
||||
diffListRegex := regexp.MustCompile(`(?m)^( +)([-+~]\s)(".*",)`)
|
||||
diffTildeRegex := regexp.MustCompile(`(?m)^~`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user