Skip to content

Commit

Permalink
HDDS-6226. Run tests for selective CI checks in CI (#3019)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai committed Feb 9, 2022
1 parent 11f4c9b commit 40d0a40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/post-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@v2
if: matrix.check != 'bats'
- name: Checkout project with history
uses: actions/checkout@v2
with:
fetch-depth: 0
if: matrix.check == 'bats'
- name: Cache for maven dependencies
uses: actions/cache@v2
with:
Expand Down
8 changes: 7 additions & 1 deletion hadoop-ozone/dev-support/checks/bats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ source "${DIR}/_lib.sh"

install_bats

git clone https://github.com/bats-core/bats-assert dev-support/ci/bats-assert
git clone https://github.com/bats-core/bats-support dev-support/ci/bats-support

REPORT_DIR=${OUTPUT_DIR:-"${DIR}/../../../target/bats"}
mkdir -p "${REPORT_DIR}"
REPORT_FILE="${REPORT_DIR}/summary.txt"

rm -f "${REPORT_DIR}/output.log"

find * -path '*/src/test/shell/*' -name '*.bats' -print0 \
find * \( \
-path '*/src/test/shell/*' -name '*.bats' \
-or -path dev-support/ci/selective_ci_checks.bats \
\) -print0 \
| xargs -0 -n1 bats --formatter tap \
| tee -a "${REPORT_DIR}/output.log"

Expand Down

0 comments on commit 40d0a40

Please sign in to comment.