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
trigger cloud driver tests on certain modules (#69200)
dpsuttona3e48f08679d
diff --git a/mage/src/mage/modules.clj b/mage/src/mage/modules.cljindex 1b5f4a5f753..d34152da1b2 100644--- a/mage/src/mage/modules.clj+++ b/mage/src/mage/modules.clj@@ -14,7 +14,12 @@(def default-modules-which-trigger-drivers"Modules that, when affected by changes, should trigger driver tests."- ['driver 'transforms])+ '#{driver transforms})++(def modules-triggering-cloud-drivers+ "Modules not only trigger driver tests, but run cloud drivers as well. Can be duplicative to driver triggers."+ '#{query-processor transforms+ enterprise/transforms enterprise/transforms-python});;; TODO (Cam 2025-11-07) changes to test files should only cause us to run tests for that module as well, not;;; everything that depends on that module directly or indirectly in `src`@@ -213,7 +218,8 @@([modules](driver-deps-affected? (dependencies) modules))([deps modules]- (driver-deps-affected? deps modules default-modules-which-trigger-drivers))+ (driver-deps-affected? deps modules (set/union default-modules-which-trigger-drivers+ modules-triggering-cloud-drivers)))([deps modules trigger-modules](let [unaffected (unaffected-modules deps (remove driver-affecting-overrides modules))](boolean@@ -387,11 +393,11 @@{:should-run true:reason (str "driver files changed (modules/drivers/" (name driver) "/**)")}- ;; Priority 7: Cloud driver + query-processor updated → run it+ ;; Priority 7: Cloud driver + module triggering cloud dbs updated → run it(and (contains? cloud-drivers driver)- (contains? updated 'query-processor))+ (seq (set/intersection updated modules-triggering-cloud-drivers))){:should-run true- :reason "query-processor module updated"}+ :reason "Module updated which explicitly triggers cloud drivers"};; Priority 8: Cloud driver, no relevant changes → skip(contains? cloud-drivers driver)diff --git a/mage/test/mage/modules_test.clj b/mage/test/mage/modules_test.cljindex 3235b6d4c81..f619f434898 100644--- a/mage/test/mage/modules_test.clj+++ b/mage/test/mage/modules_test.clj@@ -166,17 +166,20 @@(is (true? (:should-run result)))(is (re-find #"driver files changed" (:reason result))))))-(deftest cloud-driver-with-query-processor-changes-runs- (testing "Cloud driver runs when query-processor module is updated"- (doseq [driver [:athena :bigquery :databricks :redshift :snowflake]]+(deftest modules-can-trigger-cloud-drivers+ (doseq [module '#{query-processor transforms+ enterprise/transforms enterprise/transforms-python}+ driver [:athena :bigquery :databricks :redshift :snowflake]]+ (testing (format "Cloud driver runs when %s module is updated" module)(let [result (mage.modules/driver-decision driver(make-ctx {})- false ; not affected- #{} ; quarantined- #{'query-processor})] ; updated+ false ; not affected+ #{} ; quarantined+ #{module})] ; updated(is (true? (:should-run result))(str driver " should run when query-processor updated"))- (is (= "query-processor module updated" (:reason result)))))))+ (is (= "Module updated which explicitly triggers cloud drivers"+ (:reason result)))))))(deftest cloud-driver-without-changes-skips(testing "Cloud driver skips when no relevant changes"@@ -250,7 +253,7 @@(let [modules-triggering-drivers (modules-affecting-drivers);; This count was 33 as of 2026-01-20. Update this number ONLY if you;; intentionally want more modules to trigger driver tests.- max-allowed-count 33]+ max-allowed-count 35](is (<= (count modules-triggering-drivers) max-allowed-count)(format "Too many modules trigger driver tests! Expected <= %d, got %d.Modules triggering driver tests: %s