Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-6226. Run tests for selective CI checks in CI #3019

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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