Skip to content

Commit 6a73940

Browse files
committed
Move test to correct job
1 parent aced65b commit 6a73940

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

.github/workflows/test-unlock-state.yaml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,6 @@ jobs:
9393
9494
echo 'Lock id is ${{ fromJson(steps.locked-state-destroy.outputs.lock-info).ID }}'
9595
96-
- name: Try using locked state using terraform-destroy-workspace
97-
uses: ./terraform-destroy-workspace
98-
id: locked-state-destroy-workspace
99-
continue-on-error: true
100-
with:
101-
path: tests/workflows/test-unlock-state
102-
103-
- name: Check terraform-destroy-workspace state locked failure-reason
104-
run: |
105-
if [[ "${{ steps.locked-state-destroy-workspace.outcome }}" != "failure" ]]; then
106-
echo "Apply did not fail correctly"
107-
exit 1
108-
fi
109-
110-
if [[ "${{ steps.locked-state-destroy-workspace.outputs.failure-reason }}" != "state-locked" ]]; then
111-
echo "::error:: failure-reason not set correctly"
112-
exit 1
113-
fi
114-
115-
echo '"${{ steps.locked-state-destroy-workspace.outputs.lock-info }}"'
116-
117-
echo 'Lock id is ${{ fromJson(steps.locked-state-destroy-workspace.outputs.lock-info).ID }}'
118-
11996
- name: Unlock the state
12097
uses: ./terraform-unlock-state
12198
continue-on-error: true
@@ -200,6 +177,30 @@ jobs:
200177
201178
echo 'Lock id is ${{ fromJson(steps.locked-state-workspace.outputs.lock-info).ID }}'
202179
180+
- name: Try using locked state using terraform-destroy-workspace
181+
uses: ./terraform-destroy-workspace
182+
id: locked-state-destroy-workspace
183+
continue-on-error: true
184+
with:
185+
path: tests/workflows/test-unlock-state
186+
workspace: hello
187+
188+
- name: Check terraform-destroy-workspace state locked failure-reason
189+
run: |
190+
if [[ "${{ steps.locked-state-destroy-workspace.outcome }}" != "failure" ]]; then
191+
echo "Apply did not fail correctly"
192+
exit 1
193+
fi
194+
195+
if [[ "${{ steps.locked-state-destroy-workspace.outputs.failure-reason }}" != "state-locked" ]]; then
196+
echo "::error:: failure-reason not set correctly"
197+
exit 1
198+
fi
199+
200+
echo '"${{ steps.locked-state-destroy-workspace.outputs.lock-info }}"'
201+
202+
echo 'Lock id is ${{ fromJson(steps.locked-state-destroy-workspace.outputs.lock-info).ID }}'
203+
203204
- name: Unlock the state
204205
uses: ./terraform-unlock-state
205206
continue-on-error: true

0 commit comments

Comments
 (0)