chihsuan commented on code in PR #11911:
URL: https://github.com/apache/ozone/pull/11911#discussion_r4468230783
##########
hadoop-ozone/dev-support/checks/install/bats.sh:
##########
@@ -17,13 +17,17 @@
# This script installs bats.
# Requires _install_tool from _lib.sh. Use `source` for both scripts, because
it modifies $PATH.
-: ${BATS_VERSION:="1.2.1"}
+: ${BATS_VERSION:="1.14.0"}
+: ${BATS_SUPPORT_VERSION:="0.3.0"}
+: ${BATS_ASSERT_VERSION:="2.2.4"}
_install_bats() {
curl -LSs
"https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz" | tar
-xz -f -
+ curl -LSs
"https://github.com/bats-core/bats-support/archive/v${BATS_SUPPORT_VERSION}.tar.gz"
| tar -xz -f -
+ curl -LSs
"https://github.com/bats-core/bats-assert/archive/v${BATS_ASSERT_VERSION}.tar.gz"
| tar -xz -f -
+ rm -f bats-assert bats-support
+ ln -s bats-support-${BATS_SUPPORT_VERSION} bats-support
+ ln -s bats-assert-${BATS_ASSERT_VERSION} bats-assert
Review Comment:
Could we chain these steps with `&&` so that a failed download reports an
error?
##########
hadoop-ozone/dev-support/checks/bats.sh:
##########
@@ -30,16 +30,18 @@ source "${DIR}/install/bats.sh"
rm -f "${REPORT_DIR}/output.log"
-find * \( \
- -path '*/src/test/shell/*' -name '*.bats' \
- -or -path dev-support/ci/errorprone.bats \
- -or -path dev-support/ci/selective_ci_checks.bats \
- -or -path dev-support/ci/pr_title_check.bats \
- -or -path dev-support/ci/find_test_class_project.bats \
- -or -path dev-support/ci/junit_summary.bats \
- \) -print0 \
- | xargs -0 -n1 bats --formatter tap \
- | tee -a "${REPORT_DIR}/output.log"
+# accept specific tests as argument
+if [[ "$#" -ge 1 ]]; then
+ echo "$@" \
+ | xargs -n1 bats --formatter tap
Review Comment:
I noticed `check.yml` [appends
`ratis-args`](https://github.com/apache/ozone/blob/28c85143e511e99a175ae414cd255f2e8e5082bd/.github/workflows/check.yml#L255)
to every check, so it looks like bats might interpret those arguments as test
file paths? If so, could we skip options here?
##########
hadoop-ozone/dev-support/checks/install/bats.sh:
##########
@@ -17,13 +17,17 @@
# This script installs bats.
Review Comment:
nit: Maybe mention the libraries too?
```suggestion
# This script installs bats with bats-support and bats-assert libraries.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]