Skip to content
Snippets Groups Projects
Unverified Commit c966918b authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

Don't run sandboxing rollback test on mysql (#44515)

* Don't run sandboxing rollback test on mysql

* Update test/metabase/db/schema_migrations_test.clj
parent 1dceed32
No related branches found
No related tags found
No related merge requests found
......@@ -2017,33 +2017,35 @@
(t2/select-fn-set :object (t2/table-name :model/Permissions) :group_id group-id)))))))
(deftest sandboxing-rollback-test
(testing "Can we rollback to 49 when sandboxing is configured"
(impl/test-migrations ["v50.2024-01-10T03:27:29" "v50.2024-06-20T13:21:30"] [migrate!]
(let [db-id (first (t2/insert-returning-pks! (t2/table-name Database) {:name "DB"
:engine "h2"
:created_at :%now
:updated_at :%now
:details "{}"}))
table-id (first (t2/insert-returning-pks! (t2/table-name Table) {:db_id db-id
:schema "SchemaName"
:name "Table"
:created_at :%now
:updated_at :%now
:active true}))
permission-id (t2/insert-returning-pk! (t2/table-name :model/Permissions) {:object "/db/fake-permission/"
:group_id 1})
_ (t2/query-one {:insert-into :sandboxes
:values [{:group_id 1
:table_id table-id
:attribute_remappings "{\"foo\", 1}"
:permission_id permission-id}]})
expected {:group_id 1
:table_id table-id
:attribute_remappings "{\"foo\", 1}"}]
(migrate!)
(is (=? expected (t2/select-one :sandboxes :table_id table-id)))
(migrate! :down 49)
(is (=? expected (t2/select-one :sandboxes :table_id table-id)))))))
;; TODO (noahmoss): uncomment when fixed on mysql
(mt/test-drivers [:postgres :h2 #_:mysql]
(testing "Can we rollback to 49 when sandboxing is configured"
(impl/test-migrations ["v50.2024-01-10T03:27:29" "v50.2024-06-20T13:21:30"] [migrate!]
(let [db-id (first (t2/insert-returning-pks! (t2/table-name Database) {:name "DB"
:engine "h2"
:created_at :%now
:updated_at :%now
:details "{}"}))
table-id (first (t2/insert-returning-pks! (t2/table-name Table) {:db_id db-id
:schema "SchemaName"
:name "Table"
:created_at :%now
:updated_at :%now
:active true}))
permission-id (t2/insert-returning-pk! (t2/table-name :model/Permissions) {:object "/db/fake-permission/"
:group_id 1})
_ (t2/query-one {:insert-into :sandboxes
:values [{:group_id 1
:table_id table-id
:attribute_remappings "{\"foo\", 1}"
:permission_id permission-id}]})
expected {:group_id 1
:table_id table-id
:attribute_remappings "{\"foo\", 1}"}]
(migrate!)
(is (=? expected (t2/select-one :sandboxes :table_id table-id)))
(migrate! :down 49)
(is (=? expected (t2/select-one :sandboxes :table_id table-id))))))))
(deftest view-count-test
(testing "report_card.view_count and report_dashboard.view_count should be populated"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment