Skip to content

Commit

Permalink
#39 Reactivate test (#47)
Browse files Browse the repository at this point in the history
* Patch failing test

The test must modify an existing property of the driver configuration in order to get a different hash

* Upgrade to Metabase 0.43.3
  • Loading branch information
kaklakariada authored Jun 21, 2022
1 parent 850b2af commit 97b872c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
env:
METABASE_TAG: v0.43.1
METABASE_TAG: v0.43.3
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
path: metabase-driver

- name: Checkout the Metabase repository
- name: Checkout the Metabase repository at tag ${{ env.METABASE_TAG }}
uses: actions/checkout@v3
with:
fetch-depth: 1
Expand All @@ -38,20 +38,20 @@ jobs:
java-version: 11

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@5.1
uses: DeLaGuardo/setup-clojure@7.0
with:
cli: latest

- name: Cache Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('metabase-driver/deps.edn', 'metabase/**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache clj-kondo
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .clj-kondo/.cache
key: clj-kondo-cache
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
env:
METABASE_TAG: v0.43.1
METABASE_TAG: v0.43.3
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 1
path: 'metabase-driver'

- name: Checkout the Metabase repository
- name: Checkout the Metabase repository at tag ${{ env.METABASE_TAG }}
uses: actions/checkout@v3
with:
fetch-depth: 1
Expand All @@ -45,7 +45,7 @@ jobs:
java-version: 11

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@5.1
uses: DeLaGuardo/setup-clojure@7.0
with:
cli: latest

Expand Down
1 change: 1 addition & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* [1.0.2](changes_1.0.2.md)
* [1.0.1](changes_1.0.1.md)
* [1.0.0](changes_1.0.0.md)
* [0.3.0](changes_0.3.0.md)
Expand Down
11 changes: 11 additions & 0 deletions doc/changes/changes_1.0.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# metabase-driver 1.0.2, released 2022-??-??

Code name: Adapt to Metabase 0.43.3

## Summary

In this release we tested the driver with Metabase version 0.43.3. This release was only tested with Metabase 0.43.3. If you use an older version of Metabase please use metabase-driver 1.0.0.

## Refactoring

* #39: Reactivated failing test in Metabase
2 changes: 1 addition & 1 deletion doc/developer_guide/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ clojure --version
git clone https://github.com/metabase/metabase.git
cd metabase
git fetch --all --tags
export METABASE_VERSION=0.43.1
export METABASE_VERSION=0.43.3
git checkout "tags/v${METABASE_VERSION}" -b "v${METABASE_VERSION}-branch"
# Build (this will take ~15min)
./bin/build
Expand Down
34 changes: 22 additions & 12 deletions scripts/exclude_tests.diff
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,37 @@ index 018ec0446b..accbb02ed1 100644
(= driver/*driver* :presto)
"2018-04-18"
diff --git a/test/metabase/driver/sql_jdbc/connection_test.clj b/test/metabase/driver/sql_jdbc/connection_test.clj
index f05ebd53a0..46bea0c74d 100644
index f05ebd53a0..ff03a1b63c 100644
--- a/test/metabase/driver/sql_jdbc/connection_test.clj
+++ b/test/metabase/driver/sql_jdbc/connection_test.clj
@@ -105,7 +105,7 @@
(assoc :new-config "something"))))))
@@ -1,5 +1,6 @@
(ns metabase.driver.sql-jdbc.connection-test
(:require [clojure.java.jdbc :as jdbc]
+ [clojure.string :as str]
[clojure.test :refer :all]
[metabase.db.spec :as db.spec]
[metabase.driver :as driver]
@@ -93,6 +94,9 @@
:redshift
(assoc details :additional-options "defaultRowFetchSize=1000")

(deftest connection-pool-invalidated-on-details-change
- (mt/test-drivers (sql-jdbc.tu/sql-jdbc-drivers)
+ (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :exasol) ; https://github.com/exasol/metabase-driver/issues/39
(testing "db->pooled-connection-spec marks a connection pool invalid if the db details map changes\n"
(let [db (mt/db)
hash-change-called-times (atom 0)
+ :exasol ;; Test fail when using a hostname other than localhost or 127.0.0.1 e.g. when the DB runs in a VM.
+ (assoc details :certificate-fingerprint (str/lower-case (:certificate-fingerprint details)))
+
(cond-> details
;; swap localhost and 127.0.0.1
(= "localhost" (:host details))
diff --git a/test/metabase/driver/sql_jdbc_test.clj b/test/metabase/driver/sql_jdbc_test.clj
index dce2cb2600..2db1365558 100644
index dce2cb2600..f679a5a0e8 100644
--- a/test/metabase/driver/sql_jdbc_test.clj
+++ b/test/metabase/driver/sql_jdbc_test.clj
@@ -195,7 +195,7 @@
@@ -194,8 +194,8 @@
(is (= 3
(spliced-count-of :checkins [:= $date "2014-03-05"]))))))

;; Oracle, Redshift, and SparkSQL don't have 'Time' types
- ;; Oracle, Redshift, and SparkSQL don't have 'Time' types
- (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :redshift :sparksql)
+ ;; Oracle, Redshift, SparkSQL and Exasol don't have 'Time' types
+ (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :redshift :sparksql :exasol) ; Exasol does not support TIME data type
(testing "splicing a time"
(is (= 2
Expand Down

0 comments on commit 97b872c

Please sign in to comment.