diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index ec270efe0..fba2a7937 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -25,6 +25,10 @@ jobs: cd integration-tests yarn wait:ci yarn test:ci + - uses: tanmen/jest-reporter@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + result-file: integration-tests/result.json services: postgres: diff --git a/integration-tests/__tests__/query.spec.js b/integration-tests/__tests__/query.spec.js index f75767ced..aaadf82a6 100644 --- a/integration-tests/__tests__/query.spec.js +++ b/integration-tests/__tests__/query.spec.js @@ -88,7 +88,7 @@ describe('Query', () => { ); test.each(engines.map(engine => [engine.label, engine]))( - 'Combined query - %s', + 'More queries - %s', testWrapper(async (conn, driver, engine) => { for (const sql of initSql) await driver.query(conn, sql); const results = await executeStream( @@ -107,4 +107,21 @@ describe('Query', () => { expect(res2.rows).toEqual([expect.dataRow({ id: 2 }), expect.dataRow({ id: 1 })]); }) ); + + test.each(engines.map(engine => [engine.label, engine]))( + 'Script - %s', + testWrapper(async (conn, driver, engine) => { + const results = await executeStream( + driver, + conn, + 'CREATE TABLE t1 (id int); INSERT INTO t1 (id) VALUES (1); INSERT INTO t1 (id) VALUES (2); SELECT id FROM t1 ORDER BY id; ' + ); + expect(results.length).toEqual(1); + + const res1 = results[0]; + expect(res1.columns).toEqual([expect.objectContaining({ columnName: 'id' })]); + expect(res1.rows).toEqual([expect.dataRow({ id: 1 }), expect.dataRow({ id: 2 })]); + }) + ); + }); diff --git a/integration-tests/package.json b/integration-tests/package.json index bbf0206c2..d0fc1057a 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -13,7 +13,7 @@ "wait:ci": "cross-env DEVMODE=1 CITEST=1 node wait.js", "test:local": "cross-env DEVMODE=1 LOCALTEST=1 jest", - "test:ci": "cross-env DEVMODE=1 CITEST=1 jest --runInBand", + "test:ci": "cross-env DEVMODE=1 CITEST=1 jest --runInBand --json --outputFile=result.json --testLocationInResults", "run:local": "docker-compose down && docker-compose up -d && yarn wait:local && yarn test:local" },