Skip to content

Commit

Permalink
Merge 532f3b9 into 64216a8
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Apr 28, 2020
2 parents 64216a8 + 532f3b9 commit 7e6df81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Shellcheck

on: [push,pull_request]

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
6 changes: 3 additions & 3 deletions scripts/test-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ DUMP_FILE=logs/example-$(date --iso).fuel

function executeWithArguments() {
rm -rf stdout stderr logs
LAST_ARGUMENTS=$@
"$PHARO" "$IMAGE" example $@ --quit > out 2> err || true
LAST_ARGUMENTS=$*
"$PHARO" "$IMAGE" example "$@" --quit > out 2> err || true
[ -f stdout ] && mv stdout out || touch out
[ -f stderr ] && mv stderr err || touch err
}
Expand All @@ -18,7 +18,7 @@ function assertOutputIncludesMessage() {
local level=$2
local message=$3

if [ $(grep -c "^\[[0-9T.:+-]*\] \[$level\] $message" "$output") -eq 0 ]; then
if [ "$(grep -c "^\[[0-9T.:+-]*\] \[$level\] $message" "$output")" -eq 0 ]; then
echo "Expected std$1 to have: [$level] '$message' when invoked with $LAST_ARGUMENTS"
exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

# shellcheck source=test-utils.sh
source test-utils.sh

executeWithArguments --add=5
Expand Down

0 comments on commit 7e6df81

Please sign in to comment.