Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Document :module flag in CLAUDE.md and add --drivers=LIST to bin/test-agent (#73372)

Chris Truter4a9210a4a5e0
diff --git a/CLAUDE.md b/CLAUDE.md
index 480b696abc0..cb31a36895b 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -47,6 +47,15 @@ If you do not have `clojure-eval` available to you or `clj-nrepl-eval`, do not f
./bin/test-agent :only '[metabase.foo-test metabase.bar-test]' # multiple namespaces
```
+For module-scoped runs — useful when validating a branch's blast radius — pass `:module` (single) or `:modules` (vector) to scope tests to the module(s) the branch touched. The test runner resolves these to test directories: `enterprise/foo` → `enterprise/backend/test/metabase_enterprise/foo`, otherwise `test/metabase/<name>` (see `metabase.test-runner/parse-options`).
+
+```bash
+./bin/test-agent :module enterprise/workspaces
+./bin/test-agent :modules '[sql-parsing query-processor]'
+# Driver tests: --drivers=LIST adds the driver aliases and sets DRIVERS=LIST in one step.
+./bin/test-agent --drivers=mysql,h2,postgres :module enterprise/workspaces
+```
+
Once again, do not use `clj -X:dev:test` directly — its progress-bar output is hard to parse.
## Tool Preferences
diff --git a/bin/test-agent b/bin/test-agent
index cc42da81477..ef89788cded 100755
--- a/bin/test-agent
+++ b/bin/test-agent
@@ -11,10 +11,13 @@
# bin/test-agent :only '[metabase.foo-test]'
# bin/test-agent :only '[metabase.foo-test/some-test]'
# bin/test-agent --oss :only '[metabase.foo-test]' # run without EE extensions
+# bin/test-agent --drivers=mysql,h2,postgres :module enterprise/workspaces # run driver tests
# bin/test-agent # runs all tests (rarely what you want)
#
# Options:
-# --oss Run without enterprise extensions (uses :oss:oss-dev instead of :ee:ee-dev)
+# --oss Run without enterprise extensions (uses :oss:oss-dev instead of :ee:ee-dev)
+# --drivers=LIST Add driver aliases (:drivers:drivers-dev) and set DRIVERS=LIST.
+# LIST is a comma-separated list of driver names, e.g. mysql,h2,postgres.
#
# Any extra arguments are forwarded directly to the clojure test command.
# The :test alias uses port 0 (OS-assigned random port) so parallel runs never collide.
@@ -23,17 +26,33 @@ set -euo pipefail
export HAWK_MODE=cli/ci
-# Check for --oss flag
-ALIASES=":dev:ee:ee-dev:test"
+# Parse our own flags; forward everything else to clojure.
+INCLUDE_OSS=false
+INCLUDE_DRIVERS=false
+DRIVERS_VAL=""
args=()
for arg in "$@"; do
if [[ "$arg" == "--oss" ]]; then
- ALIASES=":dev:ci:test:oss:oss-dev"
+ INCLUDE_OSS=true
+ elif [[ "$arg" == --drivers=* ]]; then
+ INCLUDE_DRIVERS=true
+ DRIVERS_VAL="${arg#--drivers=}"
else
args+=("$arg")
fi
done
+if $INCLUDE_OSS; then
+ ALIASES=":dev:ci:test:oss:oss-dev"
+else
+ ALIASES=":dev:ee:ee-dev:test"
+fi
+
+if $INCLUDE_DRIVERS; then
+ ALIASES="${ALIASES}:drivers:drivers-dev"
+ export DRIVERS="$DRIVERS_VAL"
+fi
+
# Filter noise and strip ANSI escape sequences
clean_output() {
grep -v '^Downloading: ' \