-
- Downloads
Explicitly load driver code and fail tests when driver is present
Driver loading previously was very dependent on what code clojure compiled first. If the Oracle driver was loaded before the plugin directory was examined, it would result in the Oracle driver never being loaded. This is due to clojure code only being loaded once when required and the driver loading code being free floating code that is only evaled when the namespace is loaded. This commit switches that code to be in an -init-driver function that is invoked when the driver is required. This ensures that regardless of code loading order, the driver will be available if it's present. This commit also includes code to fail the build if requested to test on an engine when that engine's driver is not available. Previously if you set ENGINES to "h2,oracle" but had no Oracle driver in the plugins directory, the test would succeed, but only test against H2.
Showing
- src/metabase/driver.clj 4 additions, 1 deletionsrc/metabase/driver.clj
- src/metabase/driver/bigquery.clj 4 additions, 1 deletionsrc/metabase/driver/bigquery.clj
- src/metabase/driver/crate.clj 4 additions, 2 deletionssrc/metabase/driver/crate.clj
- src/metabase/driver/druid.clj 4 additions, 1 deletionsrc/metabase/driver/druid.clj
- src/metabase/driver/googleanalytics.clj 4 additions, 2 deletionssrc/metabase/driver/googleanalytics.clj
- src/metabase/driver/h2.clj 4 additions, 1 deletionsrc/metabase/driver/h2.clj
- src/metabase/driver/mongo.clj 4 additions, 2 deletionssrc/metabase/driver/mongo.clj
- src/metabase/driver/mysql.clj 4 additions, 1 deletionsrc/metabase/driver/mysql.clj
- src/metabase/driver/oracle.clj 11 additions, 8 deletionssrc/metabase/driver/oracle.clj
- src/metabase/driver/postgres.clj 4 additions, 1 deletionsrc/metabase/driver/postgres.clj
- src/metabase/driver/presto.clj 4 additions, 2 deletionssrc/metabase/driver/presto.clj
- src/metabase/driver/redshift.clj 4 additions, 1 deletionsrc/metabase/driver/redshift.clj
- src/metabase/driver/sqlite.clj 4 additions, 1 deletionsrc/metabase/driver/sqlite.clj
- src/metabase/driver/sqlserver.clj 4 additions, 1 deletionsrc/metabase/driver/sqlserver.clj
- src/metabase/driver/vertica.clj 7 additions, 5 deletionssrc/metabase/driver/vertica.clj
- test/metabase/test/data/datasets.clj 5 additions, 0 deletionstest/metabase/test/data/datasets.clj
Loading
Please register or sign in to comment