From bde7c373098b87728b616932091317747e6628c8 Mon Sep 17 00:00:00 2001 From: fflorent Date: Mon, 28 Oct 2024 15:44:56 +0100 Subject: [PATCH 1/9] CI: add server tests with Postgresql Context: some server tests succeeded when using sqlite but failed with postgresql. This commit runs the same tests using a postgresql database to ensure both database types are supported for these tests. --- .github/workflows/main.yml | 42 +++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b33b002f1..d93fc718c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,10 @@ jobs: node-version: [22.x] tests: - ':lint:python:client:common:smoke:stubs:' - - ':server-1-of-2:' - - ':server-2-of-2:' + - ':server-1-of-4:' + - ':server-2-of-4:' + - ':server-3-of-4:' + - ':server-4-of-4:' - ':nbrowser-^[A-D]:' - ':nbrowser-^[E-L]:' - ':nbrowser-^[M-N]:' @@ -96,7 +98,7 @@ jobs: if: contains(matrix.tests, ':stubs:') run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:stubs - - name: Run server tests with minio and redis + - name: Run server tests with sqlite, minio and redis if: contains(matrix.tests, ':server-') run: | export TEST_SPLITS=$(echo $TESTS | sed "s/.*:server-\([^:]*\).*/\1/") @@ -111,6 +113,26 @@ jobs: GRIST_DOCS_MINIO_PORT: 9000 GRIST_DOCS_MINIO_BUCKET: grist-docs-test + - name: Run server tests with postgresql, minio and redis + if: contains(matrix.tests, ':server-') + run: | + export TEST_SPLITS=$(echo $TESTS | sed "s/.*:server-\([^:]*\).*/\1/") + MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:server + env: + TESTS: ${{ matrix.tests }} + GRIST_DOCS_MINIO_ACCESS_KEY: administrator + GRIST_DOCS_MINIO_SECRET_KEY: administrator + TEST_REDIS_URL: "redis://localhost/11" + GRIST_DOCS_MINIO_USE_SSL: 0 + GRIST_DOCS_MINIO_ENDPOINT: localhost + GRIST_DOCS_MINIO_PORT: 9000 + GRIST_DOCS_MINIO_BUCKET: grist-docs-test + TYPEORM_TYPE: postgres + TYPEORM_HOST: localhost + TYPEORM_DATABASE: db_name + TYPEORM_USERNAME: db_user + TYPEORM_PASSWORD: db_password + - name: Run main tests without minio and redis if: contains(matrix.tests, ':nbrowser-') run: | @@ -167,6 +189,20 @@ jobs: --health-timeout 5s --health-retries 5 + postgresql: + image: postgres:latest + env: + POSTGRES_USER: db_user + POSTGRES_PASSWORD: db_password + POSTGRES_DB: db_name + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U db_user" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + candidate: needs: build_and_test if: ${{ success() && github.event_name == 'push' }} From 7575c20833f39e9addc397beaee60a9305fd0538 Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Thu, 5 Dec 2024 13:05:52 -0600 Subject: [PATCH 2/9] Regenerate initialDocSql.ts --- app/server/lib/initialDocSql.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/lib/initialDocSql.ts b/app/server/lib/initialDocSql.ts index 764d1a1869..024c16b0b6 100644 --- a/app/server/lib/initialDocSql.ts +++ b/app/server/lib/initialDocSql.ts @@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS "_grist_REPL_Hist" (id INTEGER PRIMARY KEY, "code" TE CREATE TABLE IF NOT EXISTS "_grist_Attachments" (id INTEGER PRIMARY KEY, "fileIdent" TEXT DEFAULT '', "fileName" TEXT DEFAULT '', "fileType" TEXT DEFAULT '', "fileSize" INTEGER DEFAULT 0, "fileExt" TEXT DEFAULT '', "imageHeight" INTEGER DEFAULT 0, "imageWidth" INTEGER DEFAULT 0, "timeDeleted" DATETIME DEFAULT NULL, "timeUploaded" DATETIME DEFAULT NULL); CREATE TABLE IF NOT EXISTS "_grist_Triggers" (id INTEGER PRIMARY KEY, "tableRef" INTEGER DEFAULT 0, "eventTypes" TEXT DEFAULT NULL, "isReadyColRef" INTEGER DEFAULT 0, "actions" TEXT DEFAULT '', "label" TEXT DEFAULT '', "memo" TEXT DEFAULT '', "enabled" BOOLEAN DEFAULT 0, "watchedColRefList" TEXT DEFAULT NULL, "options" TEXT DEFAULT ''); CREATE TABLE IF NOT EXISTS "_grist_ACLRules" (id INTEGER PRIMARY KEY, "resource" INTEGER DEFAULT 0, "permissions" INTEGER DEFAULT 0, "principals" TEXT DEFAULT '', "aclFormula" TEXT DEFAULT '', "aclColumn" INTEGER DEFAULT 0, "aclFormulaParsed" TEXT DEFAULT '', "permissionsText" TEXT DEFAULT '', "rulePos" NUMERIC DEFAULT 1e999, "userAttributes" TEXT DEFAULT '', "memo" TEXT DEFAULT ''); -INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',1e999,'',''); +INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',9.0e+999,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLResources" (id INTEGER PRIMARY KEY, "tableId" TEXT DEFAULT '', "colIds" TEXT DEFAULT ''); INSERT INTO _grist_ACLResources VALUES(1,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLPrincipals" (id INTEGER PRIMARY KEY, "type" TEXT DEFAULT '', "userEmail" TEXT DEFAULT '', "userName" TEXT DEFAULT '', "groupName" TEXT DEFAULT '', "instanceId" TEXT DEFAULT ''); @@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS "_grist_REPL_Hist" (id INTEGER PRIMARY KEY, "code" TE CREATE TABLE IF NOT EXISTS "_grist_Attachments" (id INTEGER PRIMARY KEY, "fileIdent" TEXT DEFAULT '', "fileName" TEXT DEFAULT '', "fileType" TEXT DEFAULT '', "fileSize" INTEGER DEFAULT 0, "fileExt" TEXT DEFAULT '', "imageHeight" INTEGER DEFAULT 0, "imageWidth" INTEGER DEFAULT 0, "timeDeleted" DATETIME DEFAULT NULL, "timeUploaded" DATETIME DEFAULT NULL); CREATE TABLE IF NOT EXISTS "_grist_Triggers" (id INTEGER PRIMARY KEY, "tableRef" INTEGER DEFAULT 0, "eventTypes" TEXT DEFAULT NULL, "isReadyColRef" INTEGER DEFAULT 0, "actions" TEXT DEFAULT '', "label" TEXT DEFAULT '', "memo" TEXT DEFAULT '', "enabled" BOOLEAN DEFAULT 0, "watchedColRefList" TEXT DEFAULT NULL, "options" TEXT DEFAULT ''); CREATE TABLE IF NOT EXISTS "_grist_ACLRules" (id INTEGER PRIMARY KEY, "resource" INTEGER DEFAULT 0, "permissions" INTEGER DEFAULT 0, "principals" TEXT DEFAULT '', "aclFormula" TEXT DEFAULT '', "aclColumn" INTEGER DEFAULT 0, "aclFormulaParsed" TEXT DEFAULT '', "permissionsText" TEXT DEFAULT '', "rulePos" NUMERIC DEFAULT 1e999, "userAttributes" TEXT DEFAULT '', "memo" TEXT DEFAULT ''); -INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',1e999,'',''); +INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',9.0e+999,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLResources" (id INTEGER PRIMARY KEY, "tableId" TEXT DEFAULT '', "colIds" TEXT DEFAULT ''); INSERT INTO _grist_ACLResources VALUES(1,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLPrincipals" (id INTEGER PRIMARY KEY, "type" TEXT DEFAULT '', "userEmail" TEXT DEFAULT '', "userName" TEXT DEFAULT '', "groupName" TEXT DEFAULT '', "instanceId" TEXT DEFAULT ''); From a608fc5b656bdab9a56b251f09f5b035156ad134 Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Thu, 5 Dec 2024 18:40:42 -0600 Subject: [PATCH 3/9] Turn off Postgres JIT in CI workflow --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d93fc718c1..9607b0ba9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -195,6 +195,10 @@ jobs: POSTGRES_USER: db_user POSTGRES_PASSWORD: db_password POSTGRES_DB: db_name + # JIT is enabled by default since Postgres 17 and has a huge negative impact on performance, + # making many tests timeout. + # https://support.getgrist.com/self-managed/#what-is-a-home-database + PGOPTIONS: "-c jit=off" ports: - 5432:5432 options: >- From 046dd4945d4864b4126a489d8248cfe8250d12d4 Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Fri, 6 Dec 2024 13:11:17 -0600 Subject: [PATCH 4/9] Separate server and gen-server tests --- .github/workflows/main.yml | 30 ++++++++++++++---------------- package.json | 3 ++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9607b0ba9e..d51eb1bbef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,10 +21,10 @@ jobs: node-version: [22.x] tests: - ':lint:python:client:common:smoke:stubs:' - - ':server-1-of-4:' - - ':server-2-of-4:' - - ':server-3-of-4:' - - ':server-4-of-4:' + - ':server-1-of-2:' + - ':server-2-of-2:' + - ':gen-server-1-of-2:' + - ':gen-server-2-of-2:' - ':nbrowser-^[A-D]:' - ':nbrowser-^[E-L]:' - ':nbrowser-^[M-N]:' @@ -65,7 +65,7 @@ jobs: run: yarn run lint:ci - name: Make sure bucket is versioned - if: contains(matrix.tests, ':server-') + if: contains(matrix.tests, ':server-') || contains(matrix.tests, ':gen-server-') env: AWS_ACCESS_KEY_ID: administrator AWS_SECRET_ACCESS_KEY: administrator @@ -98,12 +98,14 @@ jobs: if: contains(matrix.tests, ':stubs:') run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:stubs - - name: Run server tests with sqlite, minio and redis - if: contains(matrix.tests, ':server-') + - name: Run gen-server tests with minio and redis + if: contains(matrix.tests, ':gen-server-') run: | - export TEST_SPLITS=$(echo $TESTS | sed "s/.*:server-\([^:]*\).*/\1/") - MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:server + export TEST_SPLITS=$(echo $TESTS | sed "s/.*:gen-server-\([^:]*\).*/\1/") + yarn run test:gen-server + TYPEORM_TYPE=postgres TYPEORM_HOST=localhost TYPEORM_DATABASE=db_name TYPEORM_USERNAME=db_user TYPEORM_PASSWORD=db_password yarn run test:gen-server env: + MOCHA_WEBDRIVER_HEADLESS: 1 TESTS: ${{ matrix.tests }} GRIST_DOCS_MINIO_ACCESS_KEY: administrator GRIST_DOCS_MINIO_SECRET_KEY: administrator @@ -113,12 +115,13 @@ jobs: GRIST_DOCS_MINIO_PORT: 9000 GRIST_DOCS_MINIO_BUCKET: grist-docs-test - - name: Run server tests with postgresql, minio and redis + - name: Run server tests with minio and redis if: contains(matrix.tests, ':server-') run: | export TEST_SPLITS=$(echo $TESTS | sed "s/.*:server-\([^:]*\).*/\1/") - MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:server + yarn run test:server env: + MOCHA_WEBDRIVER_HEADLESS: 1 TESTS: ${{ matrix.tests }} GRIST_DOCS_MINIO_ACCESS_KEY: administrator GRIST_DOCS_MINIO_SECRET_KEY: administrator @@ -127,11 +130,6 @@ jobs: GRIST_DOCS_MINIO_ENDPOINT: localhost GRIST_DOCS_MINIO_PORT: 9000 GRIST_DOCS_MINIO_BUCKET: grist-docs-test - TYPEORM_TYPE: postgres - TYPEORM_HOST: localhost - TYPEORM_DATABASE: db_name - TYPEORM_USERNAME: db_user - TYPEORM_PASSWORD: db_password - name: Run main tests without minio and redis if: contains(matrix.tests, ':nbrowser-') diff --git a/package.json b/package.json index 8c0556e89f..162cbe6778 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "test:stubs": "GRIST_TEST_LOGIN=1 ./test/test_env.sh mocha ${DEBUG:+-b --no-exit} $([ -z $DEBUG ] && echo --forbid-only) -g \"${GREP_TESTS}\" --slow 8000 -R test/xunit-file '_build/test/nbrowser_with_stubs/**/*.js'", "test:client": "./test/test_env.sh mocha ${DEBUG:+'-b'} '_build/test/client/**/*.js'", "test:common": "./test/test_env.sh mocha ${DEBUG:+'-b'} '_build/test/common/**/*.js'", - "test:server": "TEST_SUITE=server TEST_SUITE_FOR_TIMINGS=server TIMINGS_FILE=test/timings/server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/server/**/*.js' '_build/test/gen-server/**/*.js'", + "test:server": "TEST_SUITE=server TEST_SUITE_FOR_TIMINGS=server TIMINGS_FILE=test/timings/server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/server/**/*.js'", + "test:gen-server": "TEST_SUITE=server TEST_SUITE_FOR_TIMINGS=server TIMINGS_FILE=test/timings/server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/gen-server/**/*.js'", "test:smoke": "./test/test_env.sh mocha _build/test/nbrowser/Smoke.js", "test:docker": "./test/test_under_docker.sh", "test:python": "sandbox_venv3/bin/python sandbox/grist/runtests.py ${GREP_TESTS:+discover -p \"test*${GREP_TESTS}*.py\"}", From dfac3ae865871553ba11dfdd50686dc61435af90 Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Fri, 6 Dec 2024 13:46:35 -0600 Subject: [PATCH 5/9] Print Postgres JIT status before running tests --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d51eb1bbef..4aae6ced41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,6 +101,7 @@ jobs: - name: Run gen-server tests with minio and redis if: contains(matrix.tests, ':gen-server-') run: | + PGPASSWORD=db_password psql -h localhost -U db_user -w db_name -c "SHOW ALL;" | grep ' jit ' export TEST_SPLITS=$(echo $TESTS | sed "s/.*:gen-server-\([^:]*\).*/\1/") yarn run test:gen-server TYPEORM_TYPE=postgres TYPEORM_HOST=localhost TYPEORM_DATABASE=db_name TYPEORM_USERNAME=db_user TYPEORM_PASSWORD=db_password yarn run test:gen-server From 95995fdc318948e954529e0a3858cb5971ccbf94 Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Fri, 6 Dec 2024 13:52:52 -0600 Subject: [PATCH 6/9] Use POSTGRES_INITDB_ARGS --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4aae6ced41..e8d8a02e86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -197,7 +197,7 @@ jobs: # JIT is enabled by default since Postgres 17 and has a huge negative impact on performance, # making many tests timeout. # https://support.getgrist.com/self-managed/#what-is-a-home-database - PGOPTIONS: "-c jit=off" + POSTGRES_INITDB_ARGS: "-c jit=off" ports: - 5432:5432 options: >- From 87296262077c871e9573b01c2ae67b799f17f96f Mon Sep 17 00:00:00 2001 From: Leslie H <142967379+SleepyLeslie@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:14:21 +0000 Subject: [PATCH 7/9] Update test:gen-server target Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 162cbe6778..784c8c2550 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:client": "./test/test_env.sh mocha ${DEBUG:+'-b'} '_build/test/client/**/*.js'", "test:common": "./test/test_env.sh mocha ${DEBUG:+'-b'} '_build/test/common/**/*.js'", "test:server": "TEST_SUITE=server TEST_SUITE_FOR_TIMINGS=server TIMINGS_FILE=test/timings/server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/server/**/*.js'", - "test:gen-server": "TEST_SUITE=server TEST_SUITE_FOR_TIMINGS=server TIMINGS_FILE=test/timings/server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/gen-server/**/*.js'", + "test:gen-server": "TEST_SUITE=gen-server TEST_SUITE_FOR_TIMINGS=gen-server TIMINGS_FILE=test/timings/gen-server.txt ./test/test_env.sh mocha ${DEBUG:+'-b'} -g \"${GREP_TESTS}\" -R test/xunit-file '_build/test/gen-server/**/*.js'", "test:smoke": "./test/test_env.sh mocha _build/test/nbrowser/Smoke.js", "test:docker": "./test/test_under_docker.sh", "test:python": "sandbox_venv3/bin/python sandbox/grist/runtests.py ${GREP_TESTS:+discover -p \"test*${GREP_TESTS}*.py\"}", From 8662fdf02760668f7d0c6c86e4573f25d5e35645 Mon Sep 17 00:00:00 2001 From: "Leslie H." <142967379+SleepyLeslie@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:56:32 -0600 Subject: [PATCH 8/9] Revert "Regenerate initialDocSql.ts" This reverts commit 7575c20833f39e9addc397beaee60a9305fd0538. --- app/server/lib/initialDocSql.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/lib/initialDocSql.ts b/app/server/lib/initialDocSql.ts index 024c16b0b6..764d1a1869 100644 --- a/app/server/lib/initialDocSql.ts +++ b/app/server/lib/initialDocSql.ts @@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS "_grist_REPL_Hist" (id INTEGER PRIMARY KEY, "code" TE CREATE TABLE IF NOT EXISTS "_grist_Attachments" (id INTEGER PRIMARY KEY, "fileIdent" TEXT DEFAULT '', "fileName" TEXT DEFAULT '', "fileType" TEXT DEFAULT '', "fileSize" INTEGER DEFAULT 0, "fileExt" TEXT DEFAULT '', "imageHeight" INTEGER DEFAULT 0, "imageWidth" INTEGER DEFAULT 0, "timeDeleted" DATETIME DEFAULT NULL, "timeUploaded" DATETIME DEFAULT NULL); CREATE TABLE IF NOT EXISTS "_grist_Triggers" (id INTEGER PRIMARY KEY, "tableRef" INTEGER DEFAULT 0, "eventTypes" TEXT DEFAULT NULL, "isReadyColRef" INTEGER DEFAULT 0, "actions" TEXT DEFAULT '', "label" TEXT DEFAULT '', "memo" TEXT DEFAULT '', "enabled" BOOLEAN DEFAULT 0, "watchedColRefList" TEXT DEFAULT NULL, "options" TEXT DEFAULT ''); CREATE TABLE IF NOT EXISTS "_grist_ACLRules" (id INTEGER PRIMARY KEY, "resource" INTEGER DEFAULT 0, "permissions" INTEGER DEFAULT 0, "principals" TEXT DEFAULT '', "aclFormula" TEXT DEFAULT '', "aclColumn" INTEGER DEFAULT 0, "aclFormulaParsed" TEXT DEFAULT '', "permissionsText" TEXT DEFAULT '', "rulePos" NUMERIC DEFAULT 1e999, "userAttributes" TEXT DEFAULT '', "memo" TEXT DEFAULT ''); -INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',9.0e+999,'',''); +INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',1e999,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLResources" (id INTEGER PRIMARY KEY, "tableId" TEXT DEFAULT '', "colIds" TEXT DEFAULT ''); INSERT INTO _grist_ACLResources VALUES(1,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLPrincipals" (id INTEGER PRIMARY KEY, "type" TEXT DEFAULT '', "userEmail" TEXT DEFAULT '', "userName" TEXT DEFAULT '', "groupName" TEXT DEFAULT '', "instanceId" TEXT DEFAULT ''); @@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS "_grist_REPL_Hist" (id INTEGER PRIMARY KEY, "code" TE CREATE TABLE IF NOT EXISTS "_grist_Attachments" (id INTEGER PRIMARY KEY, "fileIdent" TEXT DEFAULT '', "fileName" TEXT DEFAULT '', "fileType" TEXT DEFAULT '', "fileSize" INTEGER DEFAULT 0, "fileExt" TEXT DEFAULT '', "imageHeight" INTEGER DEFAULT 0, "imageWidth" INTEGER DEFAULT 0, "timeDeleted" DATETIME DEFAULT NULL, "timeUploaded" DATETIME DEFAULT NULL); CREATE TABLE IF NOT EXISTS "_grist_Triggers" (id INTEGER PRIMARY KEY, "tableRef" INTEGER DEFAULT 0, "eventTypes" TEXT DEFAULT NULL, "isReadyColRef" INTEGER DEFAULT 0, "actions" TEXT DEFAULT '', "label" TEXT DEFAULT '', "memo" TEXT DEFAULT '', "enabled" BOOLEAN DEFAULT 0, "watchedColRefList" TEXT DEFAULT NULL, "options" TEXT DEFAULT ''); CREATE TABLE IF NOT EXISTS "_grist_ACLRules" (id INTEGER PRIMARY KEY, "resource" INTEGER DEFAULT 0, "permissions" INTEGER DEFAULT 0, "principals" TEXT DEFAULT '', "aclFormula" TEXT DEFAULT '', "aclColumn" INTEGER DEFAULT 0, "aclFormulaParsed" TEXT DEFAULT '', "permissionsText" TEXT DEFAULT '', "rulePos" NUMERIC DEFAULT 1e999, "userAttributes" TEXT DEFAULT '', "memo" TEXT DEFAULT ''); -INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',9.0e+999,'',''); +INSERT INTO _grist_ACLRules VALUES(1,1,63,'[1]','',0,'','',1e999,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLResources" (id INTEGER PRIMARY KEY, "tableId" TEXT DEFAULT '', "colIds" TEXT DEFAULT ''); INSERT INTO _grist_ACLResources VALUES(1,'',''); CREATE TABLE IF NOT EXISTS "_grist_ACLPrincipals" (id INTEGER PRIMARY KEY, "type" TEXT DEFAULT '', "userEmail" TEXT DEFAULT '', "userName" TEXT DEFAULT '', "groupName" TEXT DEFAULT '', "instanceId" TEXT DEFAULT ''); From 144f3a1086fd7cdc22671e6438ec3ba2ca9c9a86 Mon Sep 17 00:00:00 2001 From: "Leslie H." <142967379+SleepyLeslie@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:22:06 -0600 Subject: [PATCH 9/9] Split gen-server tests with sqlite/postgres --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8d8a02e86..bbe56552e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,8 +23,7 @@ jobs: - ':lint:python:client:common:smoke:stubs:' - ':server-1-of-2:' - ':server-2-of-2:' - - ':gen-server-1-of-2:' - - ':gen-server-2-of-2:' + - ':gen-server:' - ':nbrowser-^[A-D]:' - ':nbrowser-^[E-L]:' - ':nbrowser-^[M-N]:' @@ -65,7 +64,7 @@ jobs: run: yarn run lint:ci - name: Make sure bucket is versioned - if: contains(matrix.tests, ':server-') || contains(matrix.tests, ':gen-server-') + if: contains(matrix.tests, ':server-') || contains(matrix.tests, ':gen-server:') env: AWS_ACCESS_KEY_ID: administrator AWS_SECRET_ACCESS_KEY: administrator @@ -98,13 +97,12 @@ jobs: if: contains(matrix.tests, ':stubs:') run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:stubs - - name: Run gen-server tests with minio and redis - if: contains(matrix.tests, ':gen-server-') + - name: Run gen-server tests with sqlite, minio and redis + if: contains(matrix.tests, ':gen-server:') run: | - PGPASSWORD=db_password psql -h localhost -U db_user -w db_name -c "SHOW ALL;" | grep ' jit ' - export TEST_SPLITS=$(echo $TESTS | sed "s/.*:gen-server-\([^:]*\).*/\1/") yarn run test:gen-server - TYPEORM_TYPE=postgres TYPEORM_HOST=localhost TYPEORM_DATABASE=db_name TYPEORM_USERNAME=db_user TYPEORM_PASSWORD=db_password yarn run test:gen-server + # Anchors should be used once available. Not supported yet as of December 2024. + # https://github.com/actions/runner/issues/1182 env: MOCHA_WEBDRIVER_HEADLESS: 1 TESTS: ${{ matrix.tests }} @@ -116,6 +114,27 @@ jobs: GRIST_DOCS_MINIO_PORT: 9000 GRIST_DOCS_MINIO_BUCKET: grist-docs-test + - name: Run gen-server tests with postgres, minio and redis + if: contains(matrix.tests, ':gen-server:') + run: | + PGPASSWORD=$TYPEORM_PASSWORD psql -h $TYPEORM_HOST -U $TYPEORM_USERNAME -w $TYPEORM_DATABASE -c "SHOW ALL;" | grep ' jit ' + yarn run test:gen-server + env: + MOCHA_WEBDRIVER_HEADLESS: 1 + TESTS: ${{ matrix.tests }} + GRIST_DOCS_MINIO_ACCESS_KEY: administrator + GRIST_DOCS_MINIO_SECRET_KEY: administrator + TEST_REDIS_URL: "redis://localhost/11" + GRIST_DOCS_MINIO_USE_SSL: 0 + GRIST_DOCS_MINIO_ENDPOINT: localhost + GRIST_DOCS_MINIO_PORT: 9000 + GRIST_DOCS_MINIO_BUCKET: grist-docs-test + TYPEORM_TYPE: postgres + TYPEORM_HOST: localhost + TYPEORM_DATABASE: db_name + TYPEORM_USERNAME: db_user + TYPEORM_PASSWORD: db_password + - name: Run server tests with minio and redis if: contains(matrix.tests, ':server-') run: |