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
Remove ability to skip test suites upfront (#80760)
Nemanja Glumacadf654542a9c
diff --git a/.github/workflows/disabled-drivers-slack-notification.yml b/.github/workflows/disabled-drivers-slack-notification.ymldeleted file mode 100644index 6c62d3e1091..00000000000--- a/.github/workflows/disabled-drivers-slack-notification.yml+++ /dev/null@@ -1,88 +0,0 @@-name: Disabled Drivers Slack Notification--on:- workflow_dispatch:- schedule:- - cron: "0 9 * * 1" # every Monday at 9:00 UTC--jobs:- notify-disabled-drivers:- if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}- runs-on: ${{ vars.SLIM_RUNNER_KEY }}- timeout-minutes: 5- steps:- - uses: actions/[email protected]- with:- node-version: lts/Jod-- - name: Install Slack SDK- run: npm install @slack/web-api-- - name: Check disabled drivers and notify Slack- uses: actions/github-script@v9- env:- SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}- with:- script: |- const { WebClient } = require('@slack/web-api');-- // Fetch the config- 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.drivers || [];- const lastUpdated = config.metadata?.last_updated || 'unknown';- const reason = config.metadata?.reason || 'No reason provided';-- // "skip" is the only status CI reads: the driver is not run at all. A driver that- // runs but must not gate is expressed as a suite-level rule in CI Conductor, which- // reports it in its own UI.- const skipped = drivers.filter(d => d.status === 'skip').map(d => d.name);-- if (skipped.length === 0) {- console.log('No drivers are disabled. Skipping Slack notification.');- return;- }-- const list = (names) => names.map(d => `\`${d}\``).join(' ');- const lines = [`:no_entry: *Disabled (not run):* ${list(skipped)}`];-- if (!process.env.SLACK_BOT_TOKEN) {- throw new Error('SLACK_BOT_TOKEN is required');- }-- const slack = new WebClient(process.env.SLACK_BOT_TOKEN);-- await slack.chat.postMessage({- channel: 'engineering-ci',- text: 'CI Driver Status Report',- blocks: [- {- type: 'section',- text: {- type: 'mrkdwn',- text: `*CI Driver Status*\n${lines.join('\n')}`- },- accessory: {- type: 'button',- text: {- type: 'plain_text',- text: 'View Config',- emoji: true- },- url: 'https://github.com/metabase/ci-test-config/blob/master/ci-test-config.json'- }- },- {- type: 'context',- elements: [- {- type: 'mrkdwn',- text: `${reason} · :clock1: *${lastUpdated}*`- }- ]- }- ]- });-- console.log('Slack notification sent successfully');diff --git a/bb.edn b/bb.ednindex e3b474cec47..dc53048899f 100644--- a/bb.edn+++ b/bb.edn@@ -409,36 +409,27 @@(with-out-str(table/table [["Priority" "Condition" "Result" "Reason"]["0" "--only-driver=DRIVER was passed" "RUN/SKIP" "only that one driver runs"]- ["1" "Global force-run" "RUN" "master/release branch or ci:run-all label (skip list ignored)"]+ ["1" "Global force-run" "RUN" "master/release branch or ci:run-all label"]["2" "Global skip (no backend changes)" "SKIP" "workflow skip (no backend changes)"]["3" "Driver is :h2 or :postgres" "RUN" "H2/Postgres always run"]["4" "ci:run-all-drivers or ci:run-DRIVER" "RUN" "ci:run-all-drivers or ci:run-DRIVER label"]- ["5" "Driver's own modules/drivers/* files changed" "RUN" "driver files changed (skip list ignored)"]- ["6" "Configured status = skip" "SKIP" "driver is skipped by CI config"]- ["7" "Cloud driver + ci:run-all-cloud-drivers" "RUN" "ci:run-all-cloud-drivers label"]- ["8" "Cloud driver + query-processor updated" "RUN" "query-processor module updated"]- ["9" "Cloud driver + driver deps affected" "RUN" "driver module affected by shared code changes"]- ["10" "Cloud driver, no relevant changes" "SKIP" "no relevant changes for cloud driver"]- ["11"+ ["5" "Driver's own modules/drivers/* files changed" "RUN" "driver files changed"]+ ["6" "Cloud driver + ci:run-all-cloud-drivers" "RUN" "ci:run-all-cloud-drivers label"]+ ["7" "Cloud driver + query-processor updated" "RUN" "query-processor module updated"]+ ["8" "Cloud driver + driver deps affected" "RUN" "driver module affected by shared code changes"]+ ["9" "Cloud driver, no relevant changes" "SKIP" "no relevant changes for cloud driver"]+ ["10"(str (pr-str driver-triggers) " module deps affected")"RUN"(str "any of " (pr-str driver-triggers) " affected by module changes")]- ["12" "Self-hosted driver, not affected" "SKIP" "driver module not affected"]]))+ ["11" "Self-hosted driver, not affected" "SKIP" "driver module not affected"]]))"\nThis table decides only WHETHER a driver runs. Whether its failures GATE is a separate\n""question, answered at the end of the job by ci-conductor's quarantine rules.\n"- "\nNote: the remote skip list (status = skip) is ignored entirely on a force-run --\n"- "master and release-* branches, or a ci:run-all label -- so every driver runs there.\n"- "Whether failures gate remains determined by CI Conductor's quarantine rules. The skip\n"- "list is also ignored for any driver whose own modules/drivers/* files the run changes.\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 the skip list)\n"- " ci:run-DRIVER Force-run a specific driver, e.g. ci:run-mysql-mariadb (overrides the skip list)\n"+ " ci:run-all-drivers Force-run ALL drivers\n"+ " ci:run-DRIVER Force-run a specific driver, e.g. ci:run-mysql-mariadb\n"" ci:run-all-cloud-drivers Run all cloud drivers (athena, bigquery, databricks, redshift, snowflake)\n"- "\n## Driver Status (from the CI driver config)\n\n"- " skip Listed with status \"skip\" in ci-test-config.json: not run at all (changing the\n"- " driver's own files or ci:run-DRIVER overrides). Every other driver runs and\n"- " gates as usual.\n""\nTo let a driver run but not gate, add a suite-quarantine rule in CI Conductor instead.\n""\n## All Drivers\n\n"(str/join ", " (map name (sort mage.modules/all-drivers)))diff --git a/mage/src/mage/modules.clj b/mage/src/mage/modules.cljindex a95d5b2c502..93d2bb1c1e1 100644--- a/mage/src/mage/modules.clj+++ b/mage/src/mage/modules.clj@@ -1,7 +1,5 @@(ns mage.modules(:require- ^:clj-kondo/ignore- [cheshire.core :as json][clojure.edn :as edn][clojure.set :as set][clojure.string :as str]@@ -338,50 +336,6 @@(get driver-directory->drivers dir-name))))updated-files))-;;; driver status--(def ^:private ci-test-config-url- "https://raw.githubusercontent.com/metabase/ci-test-config/refs/heads/master/ci-test-config.json")--(defn- read-ci-test-config []- (json/parse-string (slurp ci-test-config-url) keyword))--(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- skip-drivers- "Set of driver keywords listed with status `\"skip\"` in the top-level `drivers` array of- ci-test-config.json. Each entry identifies a driver by its short `name` (e.g. \"snowflake\");- a few names fan out to several jobs. `skip` means: do not run the driver at all, unless the run- changes files under the driver's own `modules/drivers/*` directory or carries the- ci:run-<driver> label -- either of those overrides the `skip` keyword and runs the driver.-- Drivers absent from the config run and gate as usual.-- Whether a driver's failures GATE is a separate question, answered by ci-conductor's- suite-level quarantine rules at the end of the job -- not by this config.-- This MUST NOT break CI: any failure to read or parse the config (network error,- malformed JSON, etc.) is swallowed and yields an empty set, so every driver runs and- gates -- the safe default."- []- (try- (into #{}- (comp (filter (fn [{status :status}] (= "skip" status)))- (mapcat (fn [{driver-name :name}] (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 skipped drivers from ci-test-config ("- (.getMessage e) "); treating all drivers as required."))))- #{})))-(defn- parse-bool"Parse a string boolean from CLI args. Returns true for 'true', false otherwise."[s]@@ -428,12 +382,11 @@[driver{:keys [force-run pr-labels skip particular-driver-changed? only-driver]}driver-deps-affected?- skipped-driversupdated](cond;; Priority 0: a request for one named driver job (workflow_dispatch on drivers.yml). Runs exactly- ;; that driver and nothing else -- not H2/Postgres, and not the skip list, since asking for a job by- ;; name is a stronger signal than any rule below.+ ;; that driver and nothing else -- not even H2/Postgres, since asking for a job by name is a+ ;; stronger signal than any rule below.only-driver(if (= driver only-driver){:should-run true@@ -441,8 +394,7 @@{:should-run false:reason (str "--only-driver=" (name only-driver) " requested instead")})- ;; Priority 1: Global force-run. Every driver runs; the remote skip list is not consulted at- ;; all, so a stray entry there can't silently disable a driver's tests.+ ;; Priority 1: Global force-run. Every driver runs.force-run{:should-run true:reason "force-run (master/release branch or ci:run-all label)"}@@ -465,47 +417,40 @@"ci:run-all-drivers label"(str (run-driver-label driver) " label"))}- ;; Priority 5: The driver's own source changed - run it even when the CI config skips it,- ;; since the change is exactly what needs testing.+ ;; Priority 5: The driver's own source changed - the change is exactly what needs testing.(contains? particular-driver-changed? driver){:should-run true:reason "driver files changed"}- ;; Priority 6: Drivers the CI config marks `skip`; Priorities 1, 4 and 5 are the ways to force- ;; one to run.- (contains? skipped-drivers driver)- {:should-run false- :reason "driver is skipped by CI config"}-- ;; Priority 7: Cloud driver + ci:run-all-cloud-drivers label+ ;; Priority 6: Cloud driver + ci:run-all-cloud-drivers label(and (contains? cloud-drivers driver)(contains? pr-labels "ci:run-all-cloud-drivers")){:should-run true:reason "ci:run-all-cloud-drivers label"}- ;; Priority 8: Cloud driver + module triggering cloud dbs updated → run it+ ;; Priority 7: Cloud driver + module triggering cloud dbs updated → run it(and (contains? cloud-drivers driver)(seq (set/intersection updated modules-triggering-cloud-drivers))){:should-run true:reason "Module updated which explicitly triggers cloud drivers"}- ;; Priority 9: Cloud driver + driver deps affected (e.g., deps.edn changed)+ ;; Priority 8: Cloud driver + driver deps affected (e.g., deps.edn changed)(and (contains? cloud-drivers driver)driver-deps-affected?){:should-run true:reason "driver module affected by shared code changes"}- ;; Priority 10: Cloud driver, no relevant changes → skip+ ;; Priority 9: Cloud driver, no relevant changes → skip(contains? cloud-drivers driver){:should-run false:reason "no relevant changes for cloud driver"}- ;; Priority 11: Driver deps affected by shared code changes+ ;; Priority 10: Driver deps affected by shared code changesdriver-deps-affected?{:should-run true:reason "driver module affected by shared code changes"}- ;; Priority 12: Self-hosted driver, not affected+ ;; Priority 11: Self-hosted driver, not affected:else{:should-run false:reason "driver module not affected"}))@@ -528,8 +473,8 @@git-ref (get options :git-ref "master")force-run (parse-bool (:force-run options))only-driver (parse-only-driver (:only-driver options))- ;; force-run and --only-driver each decide every driver on their own, so neither the change- ;; analysis nor the remote skip list is consulted there.+ ;; force-run and --only-driver each decide every driver on their own, so the change+ ;; analysis is not consulted there.analysis (when-not (or force-run only-driver)(let [updated-files (u/updated-files git-ref)updated (updated-files->updated-modules updated-files)@@ -538,9 +483,8 @@{:particular-driver-changed? (drivers-with-file-changes updated-files):updated updated:driver-affected? driver-affected?- :important-file-changed? important-file-changed?- :skipped (skip-drivers)}))- {:keys [particular-driver-changed? updated driver-affected? important-file-changed? skipped]} analysis+ :important-file-changed? important-file-changed?}))+ {:keys [particular-driver-changed? updated driver-affected? important-file-changed?]} analysisctx {:git-ref git-ref:force-run force-run:pr-labels (parse-labels (:pr-labels options))@@ -552,7 +496,6 @@ctx;; module dependency check combines both conditions(boolean (or driver-affected? important-file-changed?))- (or skipped #{})(or updated #{})):driver driver))all-drivers)]diff --git a/mage/test/mage/modules_test.clj b/mage/test/mage/modules_test.cljindex c1dc50d5c06..2bdff4a5e3c 100644--- a/mage/test/mage/modules_test.clj+++ b/mage/test/mage/modules_test.clj@@ -26,18 +26,16 @@(doseq [driver [:h2 :postgres :mysql-mariadb :bigquery]](let [result (mage.modules/driver-decision driver(make-ctx {:only-driver :bigquery})- false ; driver-deps-affected?- #{} ; skipped- #{})] ; updated+ false ; driver-deps-affected?+ #{})] ; updated(is (= (= :bigquery driver) (:should-run result))(str driver " should run only when it is the requested driver"))))))(deftest only-driver-beats-every-other-rule- (testing "the requested driver runs even when the CI config skips it and the workflow says skip"+ (testing "the requested driver runs even when the workflow says skip"(let [result (mage.modules/driver-decision :snowflake(make-ctx {:only-driver :snowflake, :skip true})false- #{:snowflake} ; skipped by CI config#{})](is (true? (:should-run result)))(is (= "requested via --only-driver=snowflake" (:reason result)))))@@ -45,7 +43,6 @@(let [result (mage.modules/driver-decision :h2(make-ctx {:only-driver :snowflake})false- #{}#{})](is (false? (:should-run result)))(is (= "--only-driver=snowflake requested instead" (:reason result))))))@@ -59,66 +56,26 @@(is (nil? (#'mage.modules/parse-only-driver blank))))));;; =============================================================================-;;; Priority 5: Driver's own files changed (beats the CI config skip list)+;;; Priority 5: Driver's own files changed;;; =============================================================================-(deftest particular-driver-changes-beat-configured-skip- (testing "a skipped driver still runs when its own files changed -- that's what needs testing"+(deftest particular-driver-changes-run-that-driver+ (testing "a driver runs when its own files changed, even with nothing else affected"(doseq [driver [:mysql :mongo :snowflake :databricks]](let [result (mage.modules/driver-decision driver(make-ctx {:particular-driver-changed? #{driver}})- false ; driver-deps-affected?- #{driver} ; skipped- #{})] ; updated+ false ; driver-deps-affected?+ #{})] ; updated(is (true? (:should-run result))- (str driver " should run despite the CI config skip"))+ (str driver " should run when its own files changed"))(is (= "driver files changed" (:reason result)))))))-;;; =============================================================================-;;; Priority 6: CI config skip list (ignored on a force-run)-;;; =============================================================================--(deftest skipped-driver-does-not-run- (testing "Driver the CI config marks skip does not run"- (doseq [[what changed] {"nothing changed" #{}- "another driver's files changed" #{:mysql}}]- (testing what- (let [result (mage.modules/driver-decision :snowflake- (make-ctx {:particular-driver-changed? changed})- false ; driver-deps-affected?- #{:snowflake :mysql} ; skipped- #{})] ; updated- (is (false? (:should-run result)))- (is (= "driver is skipped by CI config" (:reason result))))))))--(deftest skipped-driver-runs-on-force-run- (testing "a driver marked skip in the remote config still runs (and gates) on a force-run"- (let [result (mage.modules/driver-decision :mysql- (make-ctx {:force-run true})- true ; driver-deps-affected?- #{:mysql} ; skipped- #{})] ; updated- (is (true? (:should-run result)))- (is (= "force-run (master/release branch or ci:run-all label)" (:reason result))))))--(deftest skip-config-names-are-translated- (testing "Config names from ci-test-config.json are translated to internal driver keywords via driver-directory->drivers"- (testing "directory names are translated to internal keywords"- ;; bigquery-cloud-sdk -> :bigquery (via driver-directory->drivers mapping).- ;; Not a force-run here, since the skip list is ignored on one.- (let [result (mage.modules/driver-decision :bigquery- (make-ctx {:force-run false})- false- #{:bigquery} ; as if translated from "bigquery-cloud-sdk"- #{})]- (is (false? (:should-run result)))- (is (= "driver is skipped by CI config" (:reason result)))))- (testing "the driver-directory->drivers mapping contains expected translations"- ;; Verify the mapping exists and has expected entries- (is (= [:bigquery] (get @#'mage.modules/driver-directory->drivers "bigquery-cloud-sdk"))- "bigquery-cloud-sdk should map to [:bigquery]")- (is (= [:mongo :mongo-ssl :mongo-sharded-cluster] (get @#'mage.modules/driver-directory->drivers "mongo"))- "mongo should map to multiple test jobs"))))+(deftest driver-directory-names-map-to-test-jobs+ (testing "a driver directory maps to the driver keyword(s) whose jobs it feeds"+ (is (= [:bigquery] (get @#'mage.modules/driver-directory->drivers "bigquery-cloud-sdk"))+ "bigquery-cloud-sdk should map to [:bigquery]")+ (is (= [:mongo :mongo-ssl :mongo-sharded-cluster] (get @#'mage.modules/driver-directory->drivers "mongo"))+ "mongo should map to multiple test jobs")));;; =============================================================================;;; Priority 2: Global skip@@ -129,23 +86,12 @@(doseq [driver [:h2 :postgres :mysql :mongo :athena :bigquery]](let [result (mage.modules/driver-decision driver(make-ctx {:skip true})- true ; even if affected- #{} ; skipped+ true ; even if affected#{})] ; updated(is (false? (:should-run result))(str driver " should be skipped"))(is (= "workflow skip (no backend changes)" (:reason result)))))))-(deftest workflow-skip-beats-ci-config-skip- (testing "Workflow skip takes priority over the CI config skip list"- (let [result (mage.modules/driver-decision :mysql- (make-ctx {:skip true})- false- #{:mysql}- #{})]- (is (false? (:should-run result)))- (is (= "workflow skip (no backend changes)" (:reason result))))))-;;; =============================================================================;;; Priority 3: H2 and Postgres always run;;; =============================================================================@@ -156,7 +102,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {:force-run false})false ; driver module not affected- #{} ; skipped#{})] ; updated(is (true? (:should-run result))(str driver " should always run"))@@ -168,7 +113,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {:skip true})false- #{} ; skipped#{})] ; updated(is (false? (:should-run result))(str driver " should be skipped on global skip"))@@ -184,7 +128,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {:pr-labels #{"ci:run-all-drivers"}})false ; not affected- #{} ; skipped#{})] ; updated(is (true? (:should-run result))(str driver " should run with ci:run-all-drivers"))@@ -195,7 +138,6 @@(let [result (mage.modules/driver-decision :mysql(make-ctx {:pr-labels #{"ci:run-mysql"}})false- #{} ; skipped#{})] ; updated(is (true? (:should-run result)))(is (= "ci:run-mysql label" (:reason result))))))@@ -205,65 +147,42 @@(let [result (mage.modules/driver-decision :mongo(make-ctx {:pr-labels #{"ci:run-mysql"}})false- #{} ; skipped#{})] ; updated(is (false? (:should-run result))))))-(deftest ci-run-all-drivers-overrides-skip-list- (testing "ci:run-all-drivers overrides the skip list"- (let [result (mage.modules/driver-decision :mysql- (make-ctx {:pr-labels #{"ci:run-all-drivers"}})- false- #{:mysql} ; skipped- #{})] ; updated- (is (true? (:should-run result)))- (is (= "ci:run-all-drivers label" (:reason result))))))--(deftest ci-run-specific-driver-overrides-skip-list- (testing "ci:run-<driver> overrides the skip list"- (let [result (mage.modules/driver-decision :mysql- (make-ctx {:pr-labels #{"ci:run-mysql"}})- false- #{:mysql} ; skipped- #{})] ; updated- (is (true? (:should-run result)))- (is (= "ci:run-mysql label" (:reason result))))))-;;; =============================================================================;;; Priority 1: Global force-run;;; =============================================================================(deftest force-run-runs-all-drivers- (testing "All drivers run on a force-run, even the globally skipped ones"+ (testing "All drivers run on a force-run, even when the workflow says skip"(doseq [driver [:h2 :postgres :mysql :mongo :athena :bigquery :snowflake]](let [result (mage.modules/driver-decision driver(make-ctx {:force-run true :skip true})false ; even if not affected- #{driver} ; skipped#{})] ; updated(is (true? (:should-run result))(str driver " should run on a force-run"))(is (= "force-run (master/release branch or ci:run-all label)" (:reason result)))))));;; =============================================================================-;;; Priority 11: Driver deps affected (self-hosted only)+;;; Priority 10: Driver deps affected (self-hosted only);;; =============================================================================(deftest driver-deps-affected-runs-self-hosted-drivers(testing "Self-hosted drivers run when driver module is affected"- ;; H2/Postgres hit priority 3 first, others hit priority 11+ ;; H2/Postgres hit priority 3 first, others hit priority 10(doseq [driver [:mysql :mongo :oracle :sqlserver]](let [result (mage.modules/driver-decision driver(make-ctx {})- true ; driver-deps-affected- #{} ; skipped+ true ; driver-deps-affected#{})] ; updated(is (true? (:should-run result))(str driver " should run when driver module affected"))(is (= "driver module affected by shared code changes" (:reason result)))))));;; =============================================================================-;;; Priority 7-10: Cloud driver special rules+;;; Priority 6-9: Cloud driver special rules;;; =============================================================================(deftest cloud-driver-with-label-runs@@ -272,7 +191,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {:pr-labels #{"ci:run-all-cloud-drivers"}})false ; not affected- #{} ; skipped#{})] ; updated(is (true? (:should-run result))(str driver " should run with label"))@@ -286,7 +204,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {})false ; not affected- #{} ; skipped#{module})] ; updated(is (true? (:should-run result))(str driver " should run when query-processor updated"))@@ -299,7 +216,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {})true ; driver-deps-affected- #{} ; skipped#{})] ; updated(is (true? (:should-run result))(str driver " should run when driver deps affected"))@@ -311,14 +227,13 @@(let [result (mage.modules/driver-decision driver(make-ctx {})false ; not affected- #{} ; skipped#{})] ; updated(is (false? (:should-run result))(str driver " should skip without changes"))(is (= "no relevant changes for cloud driver" (:reason result)))))));;; =============================================================================-;;; Priority 12: Self-hosted drivers+;;; Priority 11: Self-hosted drivers;;; =============================================================================(deftest self-hosted-driver-not-affected-skips@@ -328,7 +243,6 @@(let [result (mage.modules/driver-decision driver(make-ctx {})false ; not affected- #{} ; skipped#{})] ; updated(is (false? (:should-run result))(str driver " should skip when not affected"))@@ -411,47 +325,3 @@(is (-> [changed-file]mage.modules/updated-files->updated-modulesmage.modules/driver-deps-affected?)))))--;;; =============================================================================-;;; ci-test-config `drivers` parsing (skip 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 ci-test-config `drivers` shape."- {:drivers [{:name "databricks" :status "skip"}- {:name "mongo" :status "skip"}- {:name "snowflake" :status "required"}]})--(deftest skip-drivers-selects-only-skip-status- (testing "only drivers listed with status \"skip\" are skipped"- (with-redefs [mage.modules/read-ci-test-config (constantly example-config)]- (is (= #{:databricks :mongo :mongo-ssl :mongo-sharded-cluster}- (#'mage.modules/skip-drivers)))))- (testing "drivers absent from the config are not skipped"- (with-redefs [mage.modules/read-ci-test-config (constantly example-config)]- (is (not (contains? (#'mage.modules/skip-drivers) :mysql))))))--(deftest skip-drivers-never-throws- (testing "a failure to read/parse the config yields #{} (all drivers run) instead of breaking CI"- (with-redefs [mage.modules/read-ci-test-config (fn [] (throw (ex-info "boom" {})))]- (is (= #{} (#'mage.modules/skip-drivers))))))--(deftest non-skip-driver-follows-normal-run-rules- (testing "a driver that isn't skipped follows the normal decision rules (runs on a force-run)"- (with-redefs [mage.modules/read-ci-test-config (constantly example-config)]- (let [result (mage.modules/driver-decision :snowflake- (make-ctx {:force-run true})- false- (#'mage.modules/skip-drivers)- #{})]- (is (true? (:should-run result)))- (is (= "force-run (master/release branch or ci:run-all label)" (:reason result)))))))