Skip to content
Snippets Groups Projects
Unverified Commit b8172829 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

:race_car::rocket: :race_car::rocket: :race_car::rocket: Test partitioning for MySQL: shave ~5 minutes off of CI runs :race_car::rocket::race_car::rocket: :race_car::rocket: (#48422)

* SQUASH!

* Add another sanity checc

* Another test fix attempt

* Appease Kondo
parent 372d529b
No related branches found
No related tags found
No related merge requests found
......@@ -203,6 +203,10 @@ jobs:
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
partition-index: [0, 1]
env:
CI: 'true'
DRIVERS: mysql
......@@ -223,6 +227,9 @@ jobs:
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-mariadb-10-2-ee'
test-args: >-
:partition/total 2
:partition/index ${{ matrix.partition-index }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
......@@ -240,6 +247,10 @@ jobs:
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
partition-index: [0, 1]
env:
CI: 'true'
DRIVERS: mysql
......@@ -260,6 +271,9 @@ jobs:
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-mariadb-latest-ee'
test-args: >-
:partition/total 2
:partition/index ${{ matrix.partition-index }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
......@@ -534,6 +548,10 @@ jobs:
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
partition-index: [0, 1]
env:
CI: 'true'
DRIVERS: mysql
......@@ -554,6 +572,9 @@ jobs:
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-mysql-8-0-ee'
test-args: >-
:partition/total 2
:partition/index ${{ matrix.partition-index }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
......@@ -571,6 +592,10 @@ jobs:
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
partition-index: [0, 1]
env:
CI: 'true'
DRIVERS: mysql
......@@ -606,6 +631,9 @@ jobs:
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-mysql-latest-ee'
test-args: >-
:partition/total 2
:partition/index ${{ matrix.partition-index }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
......
......@@ -80,6 +80,8 @@
"Implementation of `with-no-data-perms-for-all-users`. Sets every data permission for all databases to the
least permissive value for the All Users permission group for the duration of the test."
[thunk]
;; force creation of test-data if it is not already created
(data/db)
(with-restored-data-perms-for-group! (u/the-id (perms-group/all-users))
(doseq [[perm-type _] data-perms/Permissions
db-id (t2/select-pks-set :model/Database)]
......
......@@ -374,10 +374,10 @@
(deftest e2e-ignore-user-supplied-perms-test
(testing "You shouldn't be able to bypass security restrictions by passing in `::query-perms/perms` in the query"
(binding [api/*current-user-id* (mt/user->id :rasta)]
(mt/with-no-data-perms-for-all-users!
(data-perms/set-table-permission! (perms-group/all-users) (mt/id :venues) :perms/create-queries :no)
(data-perms/set-database-permission! (perms-group/all-users) (mt/id) :perms/view-data :unrestricted)
(mt/with-no-data-perms-for-all-users!
(data-perms/set-table-permission! (perms-group/all-users) (mt/id :venues) :perms/create-queries :no)
(data-perms/set-database-permission! (perms-group/all-users) (mt/id) :perms/view-data :unrestricted)
(mt/with-test-user :rasta
(testing "Sanity check: should not be able to run this query the normal way"
(is (thrown-with-msg?
clojure.lang.ExceptionInfo
......
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