mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 15:16:01 +00:00
next test + test reporting
This commit is contained in:
4
.github/workflows/integration-tests.yaml
vendored
4
.github/workflows/integration-tests.yaml
vendored
@@ -25,6 +25,10 @@ jobs:
|
|||||||
cd integration-tests
|
cd integration-tests
|
||||||
yarn wait:ci
|
yarn wait:ci
|
||||||
yarn test:ci
|
yarn test:ci
|
||||||
|
- uses: tanmen/jest-reporter@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
result-file: integration-tests/result.json
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ describe('Query', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
test.each(engines.map(engine => [engine.label, engine]))(
|
test.each(engines.map(engine => [engine.label, engine]))(
|
||||||
'Combined query - %s',
|
'More queries - %s',
|
||||||
testWrapper(async (conn, driver, engine) => {
|
testWrapper(async (conn, driver, engine) => {
|
||||||
for (const sql of initSql) await driver.query(conn, sql);
|
for (const sql of initSql) await driver.query(conn, sql);
|
||||||
const results = await executeStream(
|
const results = await executeStream(
|
||||||
@@ -107,4 +107,21 @@ describe('Query', () => {
|
|||||||
expect(res2.rows).toEqual([expect.dataRow({ id: 2 }), expect.dataRow({ id: 1 })]);
|
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 })]);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"wait:ci": "cross-env DEVMODE=1 CITEST=1 node wait.js",
|
"wait:ci": "cross-env DEVMODE=1 CITEST=1 node wait.js",
|
||||||
|
|
||||||
"test:local": "cross-env DEVMODE=1 LOCALTEST=1 jest",
|
"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"
|
"run:local": "docker-compose down && docker-compose up -d && yarn wait:local && yarn test:local"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user