adoroszlai opened a new pull request, #11911: URL: https://github.com/apache/ozone/pull/11911
## What changes were proposed in this pull request? Problems: 1. `hadoop-ozone/dev-support/checks/install/bats.sh` installs `bats-core` in `.dev-tools/bats`, but its add-on libraries in `dev-support/ci`. They are usable only in `dev-support/ci` tests, but not those in `hadoop-ozone/dist/src/test/shell`. 2. Manually using `bats` installed by the above script is cumbersome. Running `hadoop-ozone/dev-support/checks/bats.sh` hides that complexity, but runs all scripts, so it is slower than needed. 3. `bats-core` is outdated. 4. Add-ons are used from their `main` branch. We should use releases. 5. Partial test list is hard-coded in `bats.sh`. Changes in this PR: 1. Install `bats-assert` and `bats-support` along `bats-core` in `.dev-tools/bats`. Change tests to use it from `.dev-tools/bats`. 2. Allow running specific tests scripts via `hadoop-ozone/dev-support/checks/bats.sh` by passing arguments. 3. Upgrade `bats-core` to latest release (1.14.0). 4. Pin library versions to their latest releases. 5. Replace hard-coded list of tests under `dev-support/ci` in `bats.sh` (which were needed to not run bats' own tests included in the repos cloned for the libraries) with a negative filter for the libraries. Notes: - Prior installation of `.dev-tools/bats` needs to be removed manually to get the latest version with libs. - If you have installed `bats` elsewhere, use `OZONE_PREFER_LOCAL_TOOL=false` to ignore that. https://issues.apache.org/jira/browse/HDDS-17666 ## How was this patch tested? ```bash $ rm -fr .dev-tools/bats $ OZONE_PREFER_LOCAL_TOOL=false hadoop-ozone/dev-support/checks/bats.sh dev-support/ci/pr_title_check.bats hadoop-ozone/dist/src/test/shell/gc_opts.bats ... Installed bats in .dev-tools/bats ... 1..2 ok 1 check legal PR title examples ok 2 check illegal PR title examples 1..3 ok 1 Setting GC parameters: add GC params for server ok 2 Setting GC parameters: disabled for client ok 3 Setting GC parameters: disabled if GC params are customized $ wc -l target/bats/output.log 7 target/bats/output.log $ OZONE_PREFER_LOCAL_TOOL=false hadoop-ozone/dev-support/checks/bats.sh dev-support/ci/pr_title_check.bats 1..2 ok 1 check legal PR title examples ok 2 check illegal PR title examples $ OZONE_PREFER_LOCAL_TOOL=false hadoop-ozone/dev-support/checks/bats.sh ... $ wc -l target/bats/output.log 102 target/bats/output.log ``` CI: https://github.com/adoroszlai/ozone/actions/runs/41451953615/job/125299252369#step:17:23 -- 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]
