Skip to content

Commit

Permalink
fix(test): adapt test validation (#18)
Browse files Browse the repository at this point in the history
* fix(test): adapt test validation

Related to the change in
#17

* feat(action): run CI on pull request against master
  • Loading branch information
beiertu-mms authored Mar 14, 2023
1 parent fdef6bc commit 35d356f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- 'dependabot/*'
schedule:
- cron: '22 22 * * 5'
pull_request:
branches:
- 'master'

jobs:
test:
Expand Down
18 changes: 9 additions & 9 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# NOTE: environment variable GITHUB_EVENT_PATH
# is required in a pullrequest scenario. If the variable
# is not set the test the test is gonna hang.
# is not set the test is gonna hang.

# global variables ############################################################
CONTAINER_NAME="yamllint-github-action"
Expand Down Expand Up @@ -73,7 +73,7 @@ function setup() {
echo $output | grep -q "lint: error: failed yamllint on"
echo $output | grep -q "line too long (114 > 80 characters)"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand Down Expand Up @@ -118,7 +118,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -q "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand All @@ -142,7 +142,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -q "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand All @@ -165,7 +165,7 @@ function setup() {
echo $output | grep -q "$INPUT_YAMLLINT_FILE_OR_DIR"
echo $output | grep -vq "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -vq "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -vq -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 0 ]]
}
Expand All @@ -190,7 +190,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand All @@ -214,7 +214,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand All @@ -239,7 +239,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}
Expand All @@ -262,7 +262,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request"

cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}"
cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"

[[ "${status}" -eq 1 ]]
}

0 comments on commit 35d356f

Please sign in to comment.