Skip to content

Commit

Permalink
fix: add assertion to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
dreinhardt89 committed Jun 13, 2023
1 parent 2adfadf commit 3a0df39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@ jobs:
tflint_version: ${{ matrix.tflint_version }}
tflint_wrapper: true
- name: Run
id: tflint
run: tflint -f compact --force
- name: Verify Exit Code Output
run: |
if [[ ${{ steps.tflint.outputs.exitcode }} -ne 0 ]]; then
echo "TFLint Exit Code not captured."
exit 1
else
echo "TFLint Exit Code captured."
fi
7 changes: 3 additions & 4 deletions wrapper/tflint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ const OutputListener = require('./lib/output-listener');
const pathToCLI = require('./lib/tflint-bin');

async function checkTflint() {
// Setting check to `true` will cause `which` to throw if tflint isn't found
const check = true;
return io.which(pathToCLI, check);
// throws if `which` does not find a result
return io.which(pathToCLI, true);
}

(async () => {
Expand Down Expand Up @@ -49,5 +48,5 @@ async function checkTflint() {
}

// A non-zero exitCode is considered an error
core.setFailed(`TFlint exited with code ${exitCode}.`);
core.setFailed(`TFLint exited with code ${exitCode}.`);
})();

0 comments on commit 3a0df39

Please sign in to comment.