Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: sqlite test issues

mertmitcf4ff93f1ac4
diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml
index 3719b27f54..b3fc97d306 100644
--- a/.github/workflows/ci-cd.yml
+++ b/.github/workflows/ci-cd.yml
@@ -120,16 +120,27 @@ jobs:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- - name: Set CI env
- run: export CI=true
- name: setup pg
working-directory: ./
- run: docker-compose -f ./tests/playwright/scripts/docker-compose-playwright-pg.yml up -d &
+ run: docker-compose -f ./tests/playwright/scripts/docker-compose-playwright-pg.yml up -d
+ - name: Wait for PostgreSQL to be ready
+ run: |
+ echo "Waiting for PostgreSQL to be ready..."
+ for i in {1..30}; do
+ if docker-compose -f ./tests/playwright/scripts/docker-compose-playwright-pg.yml exec -T pg147 pg_isready -U postgres; then
+ echo "PostgreSQL is ready!"
+ break
+ fi
+ echo "Waiting for PostgreSQL... ($i/30)"
+ sleep 2
+ done
- name: install dependencies
run: pnpm bootstrap
- name: run unit tests
working-directory: ./packages/nocodb
run: pnpm run test:unit:pg
+ env:
+ CI: true
pre-build-for-playwright:
uses: ./.github/workflows/pre-build-for-playwright.yml
diff --git a/packages/nocodb/src/db/BaseModelSqlv2/insert.ts b/packages/nocodb/src/db/BaseModelSqlv2/insert.ts
index 853513e4f9..b7635d7d7f 100644
--- a/packages/nocodb/src/db/BaseModelSqlv2/insert.ts
+++ b/packages/nocodb/src/db/BaseModelSqlv2/insert.ts
@@ -92,11 +92,6 @@ export const baseModelInsert = (baseModel: IBaseModelSqlV2) => {
let id;
if (response?.length) {
id = response[0];
- } else {
- const res = await baseModel.execAndParse(query, null, {
- raw: true,
- });
- id = res?.id ?? res[0]?.insertId ?? res;
}
if (ai) {
diff --git a/packages/nocodb/tests/unit/formula/tests/formula-error.test.ts b/packages/nocodb/tests/unit/formula/tests/formula-error.test.ts
index 416dc01068..88c466b6ba 100644
--- a/packages/nocodb/tests/unit/formula/tests/formula-error.test.ts
+++ b/packages/nocodb/tests/unit/formula/tests/formula-error.test.ts
@@ -8,6 +8,7 @@ import {
updateColumn2,
} from '../../factory/column';
import { initInitialModel } from '../initModel';
+import { isSqlite } from '../../init/db';
function formulaErrorTests() {
let _setup;
@@ -187,6 +188,8 @@ function formulaErrorTests() {
describe(`long formula`, () => {
beforeEach(async () => {
+ if (isSqlite(_context)) return;
+
const longFormula = 'CONCAT("' + 'A'.repeat(1000) + '", "A")';
await createColumn(
_context,
@@ -219,6 +222,8 @@ function formulaErrorTests() {
);
});
it(`will create a formula longer than 500k characters`, async () => {
+ if (isSqlite(_context)) return;
+
const longFormula = 'CONCAT(' + '{long_fcol2},'.repeat(20) + ' "A")';
try {
await createColumn(
@@ -245,6 +250,8 @@ function formulaErrorTests() {
});
it(`will update a formula longer than 500k characters`, async () => {
+ if (isSqlite(_context)) return;
+
const longFormula = 'CONCAT(' + '{long_fcol2},'.repeat(20) + ' "A")';
try {
const createdFormulaColumn = await createColumn(