diff --git a/.github/workflows/post-commit.yml b/.github/workflows/post-commit.yml index 6d4a22921b13..318a7869d45f 100644 --- a/.github/workflows/post-commit.yml +++ b/.github/workflows/post-commit.yml @@ -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: diff --git a/hadoop-ozone/dev-support/checks/bats.sh b/hadoop-ozone/dev-support/checks/bats.sh index f5b2cc90afd3..dc071324a51a 100755 --- a/hadoop-ozone/dev-support/checks/bats.sh +++ b/hadoop-ozone/dev-support/checks/bats.sh @@ -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"