Skip to content

Commit 5a06a42

Browse files
ostermanautofix-ci[bot]
authored andcommitted
Sanitize snapshots (#1002)
* sanitize snapshots * [autofix.ci] apply automated fixes * check for empty repo root * normalize slashes * normalize slashes * try to fix windows snapshots with windows paths * handle multiple slashes * handle multiple slashes * changed strategy for removing double slashes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 71f849c commit 5a06a42

File tree

9 files changed

+60
-36
lines changed

9 files changed

+60
-36
lines changed

tests/fixtures/scenarios/mock-terraform/atmos.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ stacks:
1818
- "**/*"
1919
excluded_paths:
2020
- "**/templates/**/*"
21+
name_pattern: "{environment}-{component}"
2122

2223
logs:
2324
file: "/dev/stderr"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
22
backend "local" {
3-
workspace_dir = "terraform.tfstate.d"
3+
path = "terraform.tfstate"
44
}
55
}

tests/fixtures/scenarios/mock-terraform/components/terraform/mock/main.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
variable "stage" {
2+
type = string
3+
}
4+
5+
variable "environment" {
6+
type = string
7+
}
8+
9+
variable "tenant" {
10+
type = string
11+
}
12+
113
variable "foo" {
214
type = string
315
default = "foo"
@@ -13,11 +25,15 @@ variable "baz" {
1325
default = "baz"
1426
}
1527

28+
# Mock resource for testing
1629
resource "local_file" "mock" {
1730
content = jsonencode({
1831
foo = var.foo
1932
bar = var.bar
2033
baz = var.baz
34+
stage = var.stage
35+
environment = var.environment
36+
tenant = var.tenant
2137
})
2238
filename = "${path.module}/mock.json"
2339
}
@@ -33,3 +49,15 @@ output "bar" {
3349
output "baz" {
3450
value = var.baz
3551
}
52+
53+
output "stage" {
54+
value = var.stage
55+
}
56+
57+
output "environment" {
58+
value = var.environment
59+
}
60+
61+
output "tenant" {
62+
value = var.tenant
63+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"bar":"dev-bar","baz":"dev-baz","foo":"dev-foo"}
1+
{"bar":"dev-bar","baz":"dev-baz","environment":"dev","foo":"dev-foo","stage":"dev","tenant":"test"}

tests/fixtures/scenarios/mock-terraform/components/terraform/mock/versions.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
terraform {
2-
required_version = ">= 1.0.0"
2+
3+
34
required_providers {
45
local = {
56
source = "hashicorp/local"

tests/fixtures/scenarios/mock-terraform/stacks/catalog/mock.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
components:
2+
terraform:
3+
mock:
4+
metadata:
5+
component: mock
6+
backend:
7+
type: local
8+
settings:
9+
component: mock
10+
vars:
11+
foo: "catalog-foo"
12+
bar: "catalog-bar"
13+
baz: "catalog-baz"
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import:
2-
- catalog/mock
3-
4-
vars:
5-
environment: dev
6-
component: mock
2+
- ../catalog/terraform/mock
73

84
components:
95
terraform:
106
mock:
117
metadata:
128
component: mock
139
environment: dev
14-
settings:
15-
component: mock
10+
backend:
11+
type: local
1612
vars:
13+
stage: dev
14+
environment: dev
15+
tenant: test
1716
foo: "dev-foo"
1817
bar: "dev-bar"
19-
baz: "dev-baz"
18+
baz: "dev-baz"
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import:
2-
- catalog/mock
3-
4-
vars:
5-
environment: prod
6-
component: mock
2+
- ../catalog/terraform/mock
73

84
components:
95
terraform:
106
mock:
117
metadata:
128
component: mock
139
environment: prod
14-
settings:
15-
component: mock
10+
backend:
11+
type: local
1612
vars:
13+
stage: prod
14+
environment: prod
15+
tenant: test
1716
foo: "prod-foo"
1817
bar: "prod-bar"
19-
baz: "prod-baz"
18+
baz: "prod-baz"

0 commit comments

Comments
 (0)