Skip to content

Commit fa316ba

Browse files
committed
fix: Remove extra whitespace from drift test expected value
The test was failing because the expected string in the contains assertion had extra blank lines and whitespace-only lines that the Go templates don't actually produce. Simplified the expected value to match actual template output.
1 parent b7d4e06 commit fa316ba

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

.github/workflows/test-failed-plan-drift.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
for file in ./tests/terraform/stacks/catalog/*.yaml; do
5252
if [ -f "$file" ]; then
5353
sed -i -e "s#__INFRACOST_ENABLED__#false#g" "$file"
54-
sed -i -e "s#__STORAGE_REGION__#${{ env.AWS_REGION }}#g" "$file"
54+
sed -i -e "s#__STORAGE_REGION__#${{ env.AWS_REGION }}#g" "$file"
5555
sed -i -e "s#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g" "$file"
56-
sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file"
56+
sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file"
5757
sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file"
5858
sed -i -e "s#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g" "$file"
5959
sed -i -e "s#__PLAN_ROLE__#${{ secrets.TERRAFORM_PLAN_ROLE }}#g" "$file"
@@ -97,7 +97,7 @@ jobs:
9797
id: metadata
9898
run: |
9999
set +e
100-
100+
101101
test -d ./metadata
102102
DIR_EXISTS=$?
103103
echo "dir_exists=${DIR_EXISTS}" >> $GITHUB_OUTPUT
@@ -109,10 +109,10 @@ jobs:
109109
test -f ./metadata/issue-description-plat-ue2-sandbox-foobar-fail.md
110110
FILE_EXISTS=$?
111111
echo "file_md_exists=${FILE_EXISTS}" >> $GITHUB_OUTPUT
112-
112+
113113
echo "file_md=$(cat ./metadata/issue-description-plat-ue2-sandbox-foobar-fail.md | jq -Rs .)" >> $GITHUB_OUTPUT
114-
115-
echo "file_json=$(cat ./metadata/plat-ue2-sandbox-foobar-fail.metadata.json | jq -Rs . )" >> $GITHUB_OUTPUT
114+
115+
echo "file_json=$(cat ./metadata/plat-ue2-sandbox-foobar-fail.metadata.json | jq -Rs . )" >> $GITHUB_OUTPUT
116116
117117
- uses: nick-fields/assert-action@v2
118118
with:
@@ -142,27 +142,19 @@ jobs:
142142
143143
- uses: nick-fields/assert-action@v2
144144
with:
145-
comparison: contains
145+
comparison: contains
146146
actual: |
147147
${{ fromJSON(needs.test.outputs.summary) }}
148148
expected: |
149-
150149
## Drift Detection Failed for `foobar-fail` in `plat-ue2-sandbox`!
151150
152-
153-
154151
<a href="https://cloudposse.com/"><img src="https://cloudposse.com/logo-300x69.svg" width="100px" align="right"/></a>
155152
156-
157153
[![failed](https://shields.io/badge/PLAN-FAILED-ff0000?style=for-the-badge)](#user-content-result-plat-ue2-sandbox-foobar-fail)
158154
159-
160-
161-
162-
163155
<details><summary><a id="result-plat-ue2-sandbox-foobar-fail" />:warning: Error summary</summary>
164156
165-
<br/>
157+
<br/>
166158
To reproduce this locally, run:<br/><br/>
167159
168160
```shell
@@ -190,18 +182,8 @@ jobs:
190182
**Error:** subcommand exited with code 1
191183
```
192184
193-
194-
195-
196-
197185
</details>
198186
199-
200-
201-
202-
203-
204-
205187
<details><summary>Metadata</summary>
206188
207189
```json

0 commit comments

Comments
 (0)