The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Allow `info` level driver runs (#75648)
Nemanja Glumacf1fd89c9393d
diff --git a/.github/actions/upload-test-results/action.yml b/.github/actions/upload-test-results/action.ymlindex 19a7ec6d1b1..2d6fc565507 100644--- a/.github/actions/upload-test-results/action.yml+++ b/.github/actions/upload-test-results/action.yml@@ -21,6 +21,19 @@ inputs:default: ""previous-step-outcome:required: true+ driver-status:+ required: false+ default: ""+ description: >-+ Configured status for this driver ("info", "skip", "required", or empty). When+ "info", the job is reported as passing regardless of the real test outcome, and+ that outcome is surfaced via a job summary and (on PRs) a comment instead.+ report-variant:+ required: false+ default: ""+ description: >-+ Optional label disambiguating matrix legs of the same job, so the info-driver+ job summary and PR comment stay distinct per leg.runs:using: "composite"@@ -50,7 +63,10 @@ runs:# Important!# 1. This step must always run because it controls job's exit code.# 2. There's no point in running this outside the organization+ # 3. For "info" drivers our own status takes precedence: we let this step pass so+ # the job is reported as passing regardless of the real outcome (still uploaded).if: always() && github.repository_owner == 'metabase'+ continue-on-error: ${{ inputs.driver-status == 'info' }}uses: trunk-io/analytics-uploader@1198efcc0976501147b10a7e343c3fa069527526 # v2.0.9env:TRUNK_REPO_URL: [email protected]:metabase/metabase.git@@ -62,3 +78,105 @@ runs:token: ${{ inputs.trunk-api-token }}use-cache: trueprevious-step-outcome: ${{ inputs.previous-step-outcome }}++ # For "info" drivers the job is forced green above, so surface the real outcome here —+ # but only when it did NOT pass, to avoid spamming summaries/comments for healthy runs.+ # Never include logs or stack traces — only the real status and a link to the run.+ - name: Report info-level driver result (job summary)+ if: ${{ always() && inputs.driver-status == 'info' && inputs.previous-step-outcome == 'failure' }}+ shell: bash+ env:+ OUTCOME: ${{ inputs.previous-step-outcome }}+ LABEL: ${{ inputs.output-name }}+ VARIANT: ${{ inputs.report-variant }}+ run: | # sh+ if [ "$OUTCOME" = "success" ]; then EMOJI="✅"; else EMOJI="❌"; fi+ TITLE="$LABEL"+ [ -n "$VARIANT" ] && TITLE="$LABEL ($VARIANT)"+ RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"+ {+ echo "### ℹ️ Info-level driver: $TITLE"+ echo ""+ echo "Reported as passing (non-blocking). Real result: $EMOJI \`$OUTCOME\`"+ echo ""+ echo "[View run]($RUN_URL)"+ } >> "$GITHUB_STEP_SUMMARY"++ # Maintain ONE PR comment per commit for all info drivers. Each leg upserts its own line+ # (keyed by a hidden tag); a passing leg removes its line, and the comment is deleted once+ # no failing legs remain. Comments from older commits are cleaned up. Runs on pass and fail+ # so recoveries self-heal. Never includes logs or stack traces — only status and a run link.+ - name: Sync info-level driver result into the PR comment+ if: ${{ always() && inputs.driver-status == 'info' && github.event_name == 'pull_request' }}+ uses: actions/github-script@v9+ continue-on-error: true+ env:+ OUTCOME: ${{ inputs.previous-step-outcome }}+ LABEL: ${{ inputs.output-name }}+ VARIANT: ${{ inputs.report-variant }}+ with:+ script: | # js+ const { OUTCOME, LABEL, VARIANT, GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID } = process.env;+ const pr = context.payload.pull_request;+ if (!pr) return;+ const { owner, repo } = context.repo;+ const sha = pr.head.sha;+ // PREFIX matches the current per-commit marker AND the older per-leg one, so legacy+ // comments from a previous version get cleaned up on the next sync.+ const PREFIX = "<!-- info-driver-result";+ const marker = `<!-- info-driver-results:${sha} -->`;+ const header = `${marker}\nℹ️ **Info-level drivers** failed (non-blocking) on \`${sha.slice(0, 7)}\` — these do not gate:`;+ const lineKey = `${LABEL}:${VARIANT}`;+ const title = VARIANT ? `${LABEL} (${VARIANT})` : LABEL;+ const runUrl = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;+ // Only real failures are reported; cancelled/skipped/success remove this leg's line.+ // List-item line with the hidden key tag at the END so markdown (links) renders.+ const ourLine = OUTCOME === "failure"+ ? `- **${title}** — ❌ \`${OUTCOME}\` ([Logs](${runUrl})) <!--l:${lineKey}-->`+ : null;+ const linesOf = (body) => body.split("\n").filter((l) => l.includes("<!--l:"));++ const sync = async () => {+ const { data: comments } = await github.rest.issues.listComments({+ owner, repo, issue_number: pr.number, per_page: 100,+ });+ const tagged = comments.filter((c) => c.body.includes(PREFIX));+ // Drop comments left over from older commits.+ for (const c of tagged.filter((c) => !c.body.includes(marker))) {+ await github.rest.issues.deleteComment({ owner, repo, comment_id: c.id }).catch(() => {});+ }+ const mine = tagged+ .filter((c) => c.body.includes(marker))+ .sort((a, b) => new Date(a.created_at) - new Date(b.created_at));+ // Merge any duplicates raced into existence; latest write of each line wins.+ const byKey = new Map();+ for (const c of mine) {+ for (const l of linesOf(c.body)) {+ const m = l.match(/<!--l:(.*?)-->/);+ if (m) byKey.set(m[1], l);+ }+ }+ if (ourLine) byKey.set(lineKey, ourLine);+ else byKey.delete(lineKey);+ const lines = [...byKey.values()].sort();+ const target = mine[0];+ for (const c of mine.slice(1)) {+ await github.rest.issues.deleteComment({ owner, repo, comment_id: c.id }).catch(() => {});+ }+ if (lines.length === 0) {+ if (target) await github.rest.issues.deleteComment({ owner, repo, comment_id: target.id }).catch(() => {});+ return;+ }+ const body = [header, "", ...lines].join("\n");+ if (target) {+ await github.rest.issues.updateComment({ owner, repo, comment_id: target.id, body });+ } else {+ await github.rest.issues.createComment({ owner, repo, issue_number: pr.number, body });+ }+ };++ // Retry to shrink the window where parallel legs clobber each other's update.+ for (let i = 0; i < 4; i++) {+ try { await sync(); break; }+ catch (e) { if (i === 3) throw e; await new Promise((r) => setTimeout(r, 400 * (i + 1))); }+ }diff --git a/.github/workflows/disabled-drivers-slack-notification.yml b/.github/workflows/disabled-drivers-slack-notification.ymlindex 7bd1f0031f2..018e31ce2a4 100644--- a/.github/workflows/disabled-drivers-slack-notification.yml+++ b/.github/workflows/disabled-drivers-slack-notification.yml@@ -30,15 +30,23 @@ jobs:const response = await fetch('https://raw.githubusercontent.com/metabase/ci-test-config/refs/heads/master/ci-test-config.json');const config = await response.json();- const drivers = config.ignored?.drivers || [];+ const drivers = config.drivers || [];const lastUpdated = config.metadata?.last_updated || 'unknown';const reason = config.metadata?.reason || 'No reason provided';- if (drivers.length === 0) {- console.log('No drivers are currently disabled. Skipping Slack notification.');+ const skipped = drivers.filter(d => d.status === 'skip').map(d => d.name);+ const info = drivers.filter(d => d.status === 'info').map(d => d.name);++ if (skipped.length === 0 && info.length === 0) {+ console.log('No drivers are disabled or collecting data. Skipping Slack notification.');return;}+ const list = (names) => names.map(d => `\`${d}\``).join(' ');+ const lines = [];+ if (skipped.length) lines.push(`:no_entry: *Disabled (not run):* ${list(skipped)}`);+ if (info.length) lines.push(`:information_source: *Collecting data (non-blocking):* ${list(info)}`);+if (!process.env.SLACK_BOT_TOKEN) {throw new Error('SLACK_BOT_TOKEN is required');}@@ -47,13 +55,13 @@ jobs:await slack.chat.postMessage({channel: 'engineering-ci',- text: 'CI Disabled Drivers Report',+ text: 'CI Driver Status Report',blocks: [{type: 'section',text: {type: 'mrkdwn',- text: `:no_entry: *CI Disabled Drivers*\n${drivers.map(d => `\`${d}\``).join(' ')}`+ text: `*CI Driver Status*\n${lines.join('\n')}`},accessory: {type: 'button',diff --git a/.github/workflows/drivers.yml b/.github/workflows/drivers.ymlindex 931ebec3ddd..b63c3cb3168 100644--- a/.github/workflows/drivers.yml+++ b/.github/workflows/drivers.yml@@ -38,6 +38,24 @@ jobs:sqlite-should-run: ${{ steps.driver-decisions.outputs.sqlite-should-run }}sqlserver-should-run: ${{ steps.driver-decisions.outputs.sqlserver-should-run }}vertica-should-run: ${{ steps.driver-decisions.outputs.vertica-should-run }}+ # Per-driver configured status from ci-test-config (skip | info | required)+ athena-status: ${{ steps.driver-decisions.outputs.athena-status }}+ bigquery-status: ${{ steps.driver-decisions.outputs.bigquery-status }}+ clickhouse-status: ${{ steps.driver-decisions.outputs.clickhouse-status }}+ databricks-status: ${{ steps.driver-decisions.outputs.databricks-status }}+ druid-jdbc-status: ${{ steps.driver-decisions.outputs.druid-jdbc-status }}+ mongo-status: ${{ steps.driver-decisions.outputs.mongo-status }}+ mongo-ssl-status: ${{ steps.driver-decisions.outputs.mongo-ssl-status }}+ mongo-sharded-cluster-status: ${{ steps.driver-decisions.outputs.mongo-sharded-cluster-status }}+ mysql-mariadb-status: ${{ steps.driver-decisions.outputs.mysql-mariadb-status }}+ oracle-status: ${{ steps.driver-decisions.outputs.oracle-status }}+ presto-jdbc-status: ${{ steps.driver-decisions.outputs.presto-jdbc-status }}+ redshift-status: ${{ steps.driver-decisions.outputs.redshift-status }}+ snowflake-status: ${{ steps.driver-decisions.outputs.snowflake-status }}+ sparksql-status: ${{ steps.driver-decisions.outputs.sparksql-status }}+ sqlite-status: ${{ steps.driver-decisions.outputs.sqlite-status }}+ sqlserver-status: ${{ steps.driver-decisions.outputs.sqlserver-status }}+ vertica-status: ${{ steps.driver-decisions.outputs.vertica-status }}# Per-driver quarantine conflict flags (set when driver is quarantined but has file changes)athena-quarantine-conflict: ${{ steps.driver-decisions.outputs.athena-quarantine-conflict }}bigquery-quarantine-conflict: ${{ steps.driver-decisions.outputs.bigquery-quarantine-conflict }}@@ -59,6 +77,28 @@ jobs:sqlserver-quarantine-conflict: ${{ steps.driver-decisions.outputs.sqlserver-quarantine-conflict }}vertica-quarantine-conflict: ${{ steps.driver-decisions.outputs.vertica-quarantine-conflict }}steps:+ # Up front (before any driver job), drop info-driver comments from older commits so a+ # superseded comment disappears immediately rather than waiting for this run's drivers.+ # Keeps this commit's comment (if any) so a re-run doesn't flicker.+ - name: Remove stale info-driver comments+ if: ${{ github.event_name == 'pull_request' }}+ uses: actions/github-script@v9+ continue-on-error: true+ with:+ script: | # js+ const pr = context.payload.pull_request;+ if (!pr) return;+ const { owner, repo } = context.repo;+ const PREFIX = "<!-- info-driver-result";+ const keep = `<!-- info-driver-results:${pr.head.sha} -->`;+ const { data: comments } = await github.rest.issues.listComments({+ owner, repo, issue_number: pr.number, per_page: 100,+ });+ for (const c of comments) {+ if (c.body.includes(PREFIX) && !c.body.includes(keep)) {+ await github.rest.issues.deleteComment({ owner, repo, comment_id: c.id }).catch(() => {});+ }+ }- name: Checkout repositoryuses: actions/checkout@v6- name: Fetch base branch@@ -141,6 +181,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.athena-status }}+ report-variant: ${{ matrix.job.name }}be-tests-bigquery-cloud-sdk-ee:needs: determine-driver-skips@@ -215,6 +257,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.bigquery-status }}+ report-variant: ${{ matrix.job.name }}- name: Cleanup python-runnerif: ${{ always() && matrix.job.needs-python-runner == true }}uses: ./.github/actions/cleanup-python-runner@@ -400,6 +444,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.databricks-status }}+ report-variant: ${{ matrix.job.name }}be-tests-databricks-multi-catalog-ee:needs: determine-driver-skips@@ -449,6 +495,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.databricks-status }}+ report-variant: ${{ matrix.job.name }}be-tests-h2:needs: determine-driver-skips@@ -1207,6 +1255,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.redshift-status }}+ report-variant: ${{ matrix.job.name }}- name: Cleanup python-runnerif: ${{ always() && matrix.job.needs-python-runner == true }}uses: ./.github/actions/cleanup-python-runner@@ -1287,6 +1337,8 @@ jobs:aws-region: ${{ vars.AWS_REGION }}trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}previous-step-outcome: ${{ steps.test-driver.outputs.test-outcome }}+ driver-status: ${{ needs.determine-driver-skips.outputs.snowflake-status }}+ report-variant: ${{ matrix.job.name }}- name: Cleanup python-runnerif: ${{ always() && matrix.job.needs-python-runner == true }}uses: ./.github/actions/cleanup-python-runner@@ -1587,9 +1639,11 @@ jobs:# if you add a driver job, you must add it to this list for it to be a required check- be-tests-h2- be-tests-athena-ee- # these are not reliable, but we want to run them anyway to gather data about failures- # - be-tests-snowflake-ee- # - be-tests-bigquery-cloud-sdk-ee+ # Listed unconditionally; ci-test-config controls their effect via per-driver status.+ # An "info" driver is reported as passing, so it never blocks this check; flip it to+ # "required" in the config to make a real failure gate, with no change here.+ - be-tests-snowflake-ee+ - be-tests-bigquery-cloud-sdk-ee- be-tests-databricks-ee- be-tests-druid-jdbc-ee- be-tests-mysql-mariadbdiff --git a/bb.edn b/bb.ednindex 615df77cacd..f06095ad940 100644--- a/bb.edn+++ b/bb.edn@@ -373,7 +373,7 @@["1" "Global skip (no backend changes)" "SKIP" "workflow skip (no backend changes)"]["2" "Driver is :h2 or :postgres" "RUN" "H2/Postgres always run"]["3" "ci:run-all-drivers or ci:run-DRIVER" "RUN" "ci:run-all-drivers or ci:run-DRIVER label"]- ["4" "Driver is quarantined" "SKIP" "driver is quarantined"]+ ["4" "Configured status = skip" "SKIP" "driver is quarantined"]["4(a)" "...and has break-quarantine-X label" "RUN" "anti-quarantine label present"]["5" "On master or release branch" "RUN" "master/release branch"]["6" "Cloud driver + ci:all-cloud-drivers" "RUN" "ci:all-cloud-drivers label"]@@ -389,12 +389,23 @@"RUN"(str "any of " (pr-str driver-triggers) " affected by module changes")]["12" "Self-hosted driver, not affected" "SKIP" "driver module not affected"]]))+ "\nThis table decides only WHETHER a driver runs. A driver's configured status then\n"+ "applies to that decision (see 'Driver Status' below) and never overrides it.\n""\n\n## Labels of Interest\n\n""These PR labels influence driver test decisions:\n\n"" ci:run-all-drivers Force-run ALL drivers (overrides quarantine)\n"" ci:run-DRIVER Force-run a specific driver, e.g. ci:run-mysql-mariadb (overrides quarantine)\n"" ci:all-cloud-drivers Run all cloud drivers (athena, bigquery, databricks, redshift, snowflake)\n"" break-quarantine-DRIVER Un-quarantine a specific driver, e.g. break-quarantine-mysql\n"+ "\n## Driver Status (from the CI driver config)\n\n"+ "Each driver also gets a configured status, emitted as DRIVER-status=... for the result job. The\n"+ "run/skip decision above always takes precedence; status only shapes the outcome of a run mage\n"+ "decides on:\n\n"+ " skip Listed with status \"skip\": not run at all (quarantined; break-quarantine-DRIVER overrides)\n"+ " info Listed with status \"info\": if mage decides to run it, the run proceeds but its result\n"+ " must NOT gate (data collection). info NEVER forces a run -- if mage wouldn't run the\n"+ " driver, info does not change that.\n"+ " required No configured status: runs and gates as usual (the default)\n""\n## All Drivers\n\n"(str/join ", " (map name (sort mage.modules/all-drivers)))"\n")))diff --git a/mage/src/mage/modules.clj b/mage/src/mage/modules.cljindex 957f456fcc4..b802df0a211 100644--- a/mage/src/mage/modules.clj+++ b/mage/src/mage/modules.clj@@ -311,7 +311,7 @@(get driver-directory->drivers dir-name))))updated-files)))-;;; driver quarantine+;;; driver quarantine / status(def ^:private ci-test-config-url"https://raw.githubusercontent.com/metabase/ci-test-config/refs/heads/master/ci-test-config.json")@@ -319,12 +319,47 @@(defn- read-ci-test-config [](json/parse-string (slurp ci-test-config-url) keyword))-(defn- quarantined-drivers []- (-> (read-ci-test-config)- (get-in [:ignored :drivers] [])- (->> (mapcat #(or (get driver-directory->drivers %)- [(keyword %)])))- (set)))+(defn- config-name->drivers+ "Translate a ci-test-config driver `name` (e.g. \"snowflake\") into the internal driver+ keyword(s) it targets. Most names map straight to a single keyword; a few (e.g. \"mongo\")+ fan out to several jobs via [[driver-directory->drivers]]."+ [driver-name]+ (or (seq (get driver-directory->drivers driver-name))+ [(keyword driver-name)]))++(defn- driver-statuses+ "Map of driver keyword -> status keyword (`:skip` or `:info`) sourced from the top-level+ `drivers` array in ci-test-config.json. Each entry identifies a driver by its short `name`+ (e.g. \"snowflake\"). Drivers absent from the config are implicitly `:required` and do not+ appear in this map.++ :skip -- do not run the driver at all (subject to the break-quarantine-<driver> label)+ :info -- run the driver, but its result must not gate (data collection only)++ This MUST NOT break CI: any failure to read or parse the config (network error,+ malformed JSON, etc.) is swallowed and yields an empty map, so every driver falls back+ to `:required` (runs and gates) -- the safe default."+ []+ (try+ (into {}+ (comp (keep (fn [{driver-name :name, status :status}]+ (when-let [status-kw (#{:skip :info} (keyword status))]+ [driver-name status-kw])))+ (mapcat (fn [[driver-name status-kw]]+ (map (fn [driver] [driver status-kw])+ (config-name->drivers driver-name)))))+ (get (read-ci-test-config) :drivers []))+ (catch Throwable e+ ;; stderr, not stdout: in --github-output-only mode stdout is redirected into $GITHUB_OUTPUT.+ (binding [*out* *err*]+ (println (c/yellow (str "WARNING: could not read driver statuses from ci-test-config ("+ (.getMessage e) "); treating all drivers as required."))))+ {})))++(defn- skip-drivers+ "Set of driver keywords with status `:skip` in `statuses` (these are quarantined: not run)."+ [statuses]+ (into #{} (keep (fn [[driver status]] (when (= status :skip) driver))) statuses))(defn- parse-bool"Parse a string boolean from CLI args. Returns true for 'true', false otherwise."@@ -463,7 +498,9 @@:skip (parse-bool (:skip options)):particular-driver-changed? particular-driver-changed?:verbose? (not github-output-only?)}- quarantined (quarantined-drivers)+ statuses (driver-statuses)+ ;; `:skip` drivers are quarantined (not run); `:info`/`:required` drivers run normally.+ quarantined (skip-drivers statuses)updated-files (u/updated-files git-ref)updated (updated-files->updated-modules updated-files)driver-affected? (driver-deps-affected? updated)@@ -472,7 +509,8 @@effective-driver-affected? (or driver-affected? important-file-changed?)decisions (mapv (fn [driver](assoc (driver-decision driver ctx effective-driver-affected? quarantined updated)- :driver driver))+ :driver driver+ :status (get statuses driver :required)))all-drivers);; Check for quarantined drivers with file changes but no break-quarantine labelquarantined-with-changes (into #{}@@ -485,8 +523,9 @@(if github-output-only?;; In github-output-only mode, print just the key=value lines (no colors)(do- (doseq [{:keys [driver should-run]} decisions]- (println (str (name driver) "-should-run=" should-run)))+ (doseq [{:keys [driver should-run status]} decisions]+ (println (str (name driver) "-should-run=" should-run))+ (println (str (name driver) "-status=" (name status))))(doseq [driver quarantined-with-changes](println (str (name driver) "-quarantine-conflict=true"))))(do@@ -500,10 +539,14 @@(println "");; Print human-readable decision summary(println "=== Driver Decisions ===")- (doseq [{:keys [driver should-run reason]} decisions]- (println (format "%-25s %s - %s"+ (doseq [{:keys [driver should-run status reason]} decisions]+ (println (format "%-25s %s %s - %s"(name driver)(if should-run (c/green "RUN ") (c/yellow "SKIP"))+ (case status+ :info (c/blue "[info] ")+ :skip (c/yellow "[skip] ")+ "[required]")reason)))(println "");; Print GITHUB_OUTPUT preview with colorsdiff --git a/mage/test/mage/modules_test.clj b/mage/test/mage/modules_test.cljindex 651c73d7482..cf96f044bb4 100644--- a/mage/test/mage/modules_test.clj+++ b/mage/test/mage/modules_test.clj@@ -370,3 +370,57 @@(is (-> [changed-file]mage.modules/updated-files->updated-modulesmage.modules/driver-deps-affected?)))))++;;; =============================================================================+;;; ci-test-config `drivers` parsing (skip / info / required status)+;;; =============================================================================++(deftest config-name->drivers-resolves-driver-names+ (testing "a driver name resolves to its internal driver keyword"+ (is (= [:snowflake] (#'mage.modules/config-name->drivers "snowflake")))+ (is (= [:bigquery] (#'mage.modules/config-name->drivers "bigquery")))+ (is (= [:databricks] (#'mage.modules/config-name->drivers "databricks"))))+ (testing "a name that fans out to several jobs is expanded"+ (is (= [:mongo :mongo-ssl :mongo-sharded-cluster]+ (#'mage.modules/config-name->drivers "mongo")))))++(def ^:private example-config+ "The new ci-test-config `drivers` shape from DEV-2149."+ {:drivers [{:name "databricks" :status "skip"}+ {:name "snowflake" :status "info"}+ {:name "bigquery" :status "info"}]})++(deftest driver-statuses-maps-names-to-status+ (testing "drivers array is translated to a driver-keyword -> status map"+ (with-redefs [mage.modules/read-ci-test-config (constantly example-config)]+ (is (= {:databricks :skip+ :snowflake :info+ :bigquery :info}+ (#'mage.modules/driver-statuses)))))+ (testing "drivers absent from the config are not present (implicitly :required)"+ (with-redefs [mage.modules/read-ci-test-config (constantly example-config)]+ (is (nil? (get (#'mage.modules/driver-statuses) :mysql))))))++(deftest driver-statuses-never-throws+ (testing "a failure to read/parse the config yields {} (all drivers required) instead of breaking CI"+ (with-redefs [mage.modules/read-ci-test-config (fn [] (throw (ex-info "boom" {})))]+ (is (= {} (#'mage.modules/driver-statuses))))))++(deftest skip-drivers-selects-only-skip-status+ (testing "only :skip drivers are quarantined; :info drivers still run"+ (is (= #{:databricks}+ (#'mage.modules/skip-drivers {:databricks :skip+ :snowflake :info+ :bigquery :info})))))++(deftest info-driver-runs-but-is-not-skipped+ (testing "an :info driver is NOT in the skip-set, so it follows normal run rules (runs on master)"+ ;; skip-set derived from example-config contains only :databricks+ (let [skip-set (#'mage.modules/skip-drivers {:databricks :skip :snowflake :info})+ result (mage.modules/driver-decision :snowflake+ (make-ctx {:is-master-or-release true})+ false+ skip-set+ #{})]+ (is (true? (:should-run result)))+ (is (= "master/release branch" (:reason result))))))