Skip to content

Commit 33cff42

Browse files
Make CI Faster (#2071)
* shuffle tests around for faster ci maybe * fix core files * fix duckdb split * maybe fix motherduck? * gteduckdb-other name correct * add comment back * get names right * fix tests on local duckdbs * changes test-core back to test-all * tweak file order * add test for ci sanity * remove forced failure * add bigquery and postgres credentials to core tests * oops * fix gts lint warning * start postgres for core * keep trying to get bigquery auth in core * Add comment to core job * spling * add more googlue auth * comment on order * populate postgres in core
1 parent 9cbdd4d commit 33cff42

36 files changed

+478
-54
lines changed

.github/workflows/db-bigquery.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: BigQuery DB
1+
name: "DB:BigQuery"
22

33
on:
44
pull_request:
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
npm ci --loglevel error
3333
npm run build
34-
npm run test-silent -- -- test packages/malloy-db-bigquery
34+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.bigquery.config.ts
3535
env:
3636
CI: true
3737
MALLOY_DATABASES: bigquery

.github/workflows/db-duckdb-wasm.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "DB:DuckDB(WASM)"
2+
3+
on: [pull_request, workflow_call]
4+
5+
jobs:
6+
test-duckdb-wasm:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [18.x]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'true'
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: npm install, build, and test
22+
run: |
23+
npm ci --loglevel error
24+
npm run build
25+
npm run build-duckdb-db
26+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.duckdb-other.config.ts --runInBand
27+
env:
28+
CI: true
29+
MALLOY_DATABASES: duckdb_wasm

.github/workflows/db-duckdb.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "DB:DuckDB"
2+
3+
on: [pull_request, workflow_call]
4+
5+
jobs:
6+
test-duckdb:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [18.x]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'true'
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: npm install, build, and test
22+
run: |
23+
npm ci --loglevel error
24+
npm run build
25+
npm run build-duckdb-db
26+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.duckdb.config.ts --runInBand
27+
env:
28+
CI: true
29+
MALLOY_DATABASES: duckdb

.github/workflows/db-motherduck.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MotherDuck DB
1+
name: "DB:MotherDuck"
22

33
on:
44
pull_request:
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
npm ci --loglevel error
2929
npm run build
30-
npm run test-silent -- -- test packages/malloy-duckdb
30+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.duckdb-other.config.ts
3131
env:
3232
CI: true
3333
MALLOY_DATABASES: motherduck

.github/workflows/db-mysql.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MySQL DB
1+
name: "DB:MySQL"
22

33
on: [pull_request, workflow_call]
44

@@ -25,7 +25,7 @@ jobs:
2525
npm run build
2626
npm run build-duckdb-db
2727
./test/mysql/mysql_start.sh
28-
npm run test-silent -- -- test
28+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.mysql.config.ts
2929
./test/mysql/mysql_stop.sh
3030
env:
3131
MALLOY_DATABASES: mysql

.github/workflows/db-postgres.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Postgres DB
1+
name: "DB:Postgres"
22

33
on: [pull_request, workflow_call]
44

@@ -39,10 +39,7 @@ jobs:
3939
npm run build
4040
echo CREATE EXTENSION tsm_system_rows\; | psql
4141
gunzip -c test/data/postgres/malloytest-postgres.sql.gz | psql
42-
npm run test-silent -- -- test packages/malloy-db-postgres
43-
export MALLOY_DATABASES=duckdb,postgres
44-
npm run build-duckdb-db
45-
npm run test-silent -- -- test/src/databases/multi-connection/multi_connection.spec.ts
42+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.postgres.config.ts
4643
env:
4744
MALLOY_DATABASES: postgres
4845
PGHOST: localhost

.github/workflows/db-presto.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Presto DB
1+
name: "DB:Presto"
22

33
on:
44
pull_request:
@@ -30,8 +30,7 @@ jobs:
3030
npm run build
3131
npm run build-duckdb-db
3232
./test/presto/presto_start.sh
33-
npm run test-silent -- -- packages/malloy-db-trino
34-
npm run test-silent -- -- test
33+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.presto.config.ts
3534
./test/presto/presto_stop.sh
3635
env:
3736
MALLOY_DATABASES: presto

.github/workflows/db-snowflake.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Snowflake DB
1+
name: "DB:Snowflake"
22

33
on:
44
pull_request:
@@ -28,7 +28,7 @@ jobs:
2828
npm ci --loglevel error
2929
npm run build
3030
./scripts/gen-snowflake-auth.sh
31-
npm run test-silent -- -- test packages/malloy-db-snowflake
31+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.snowflake.config.ts
3232
env:
3333
CI: true
3434
MALLOY_DATABASES: snowflake

.github/workflows/db-trino.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Trino DB
1+
name: "DB:Trino"
22

33
on:
44
pull_request:
@@ -30,8 +30,7 @@ jobs:
3030
npm run build
3131
npm run build-duckdb-db
3232
./test/trino/trino_start.sh
33-
npm run test-silent -- -- packages/malloy-db-trino
34-
npm run test-silent -- -- test
33+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.trino.config.ts
3534
./test/trino/trino_stop.sh
3635
env:
3736
MALLOY_DATABASES: trino

.github/workflows/main.yaml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
# The "Core" job runs through all the tests which are not dialect specific.
2+
# This includes tests which don't touch the database at all, and tests
3+
# which touch some combination of duckdb,bigquery,postgres but do
4+
# not need to be once times for each dialect.
15
name: Core
26

3-
on: [pull_request, workflow_call]
7+
on:
8+
pull_request:
9+
workflow_call:
10+
secrets:
11+
BIGQUERY_KEY:
12+
required: true
413

514
jobs:
615
test-all:
@@ -10,6 +19,20 @@ jobs:
1019
matrix:
1120
node-version: [18.x]
1221

22+
services:
23+
postgres:
24+
image: postgres
25+
env:
26+
POSTGRES_USER: root
27+
POSTGRES_PASSWORD: postgres
28+
options: >-
29+
--health-cmd pg_isready
30+
--health-interval 10s
31+
--health-timeout 5s
32+
--health-retries 5
33+
ports:
34+
- 5432:5432
35+
1336
steps:
1437
- uses: actions/checkout@v4
1538
with:
@@ -18,13 +41,23 @@ jobs:
1841
uses: actions/setup-node@v4
1942
with:
2043
node-version: ${{ matrix.node-version }}
44+
- name: GCloud auth
45+
uses: 'google-github-actions/auth@v2'
46+
with:
47+
credentials_json: '${{ secrets.BIGQUERY_KEY }}'
2148
- name: npm install, build, and test
2249
run: |
2350
npm ci --loglevel error
51+
sh scripts/ci-test-sanity-check.sh
2452
npm run lint
2553
npm run build
2654
npm run build-duckdb-db
27-
npm run test-silent
55+
echo CREATE EXTENSION tsm_system_rows\; | psql
56+
gunzip -c test/data/postgres/malloytest-postgres.sql.gz | psql
57+
npx jest --reporters jest-silent-reporter --reporters summary --config jest.core.config.ts --runInBand
2858
env:
2959
CI: true
30-
MALLOY_DATABASES: duckdb,duckdb_wasm
60+
PGHOST: localhost
61+
PGPORT: 5432
62+
PGUSER: root
63+
PGPASSWORD: postgres

.github/workflows/run-tests.yaml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ name: Malloy Tests
33
on: [workflow_dispatch]
44

55
jobs:
6+
main:
7+
uses: './.github/workflows/main.yaml'
8+
secrets:
9+
BIGQUERY_KEY: ${{ secrets.BIGQUERY_KEY }}
10+
db-trino:
11+
uses: './.github/workflows/db-trino.yaml'
12+
secrets:
13+
BQ_PRESTO_TRINO_KEY: ${{ secrets.BQ_PRESTO_TRINO_KEY }}
14+
db-presto:
15+
uses: './.github/workflows/db-presto.yaml'
16+
secrets:
17+
BQ_PRESTO_TRINO_KEY: ${{ secrets.BQ_PRESTO_TRINO_KEY }}
18+
db-duckdb:
19+
uses: './github/workflows/db-duckdb.yaml'
620
db-bigquery:
721
uses: './.github/workflows/db-bigquery.yaml'
822
secrets:
@@ -11,35 +25,33 @@ jobs:
1125
uses: './.github/workflows/db-motherduck.yaml'
1226
secrets:
1327
MOTHERDUCK_TOKEN_10: ${{ secrets.MOTHERDUCK_TOKEN_10 }}
14-
db-mysql:
15-
uses: './.github/workflows/db-mysql.yaml'
1628
db-postgres:
1729
uses: './.github/workflows/db-postgres.yaml'
18-
db-presto:
19-
uses: './.github/workflows/db-presto.yaml'
20-
secrets:
21-
BQ_PRESTO_TRINO_KEY: ${{ secrets.BQ_PRESTO_TRINO_KEY }}
2230
db-snowflake:
2331
uses: './.github/workflows/db-snowflake.yaml'
2432
secrets:
2533
SNOWFLAKE_CONNECTION: ${{ secrets.SNOWFLAKE_CONNECTION }}
26-
db-trino:
27-
uses: './.github/workflows/db-trino.yaml'
28-
secrets:
29-
BQ_PRESTO_TRINO_KEY: ${{ secrets.BQ_PRESTO_TRINO_KEY }}
30-
main:
31-
uses: './.github/workflows/main.yaml'
34+
db-mysql:
35+
uses: './.github/workflows/db-mysql.yaml'
36+
db-duckdb-wasm:
37+
uses: './github/workflows/db-duckdb-wasm.yaml'
3238

39+
40+
# I think I have the sorted roughly longest to shortest
41+
# so the longer running jobs get wrokers sooner, not sure
42+
# that is the right plan
3343
malloy-tests:
3444
needs:
45+
- main
46+
- db-snowflake
3547
- db-bigquery
36-
- db-motherduck
37-
- db-mysql
38-
- db-postgres
48+
- db-duckdb
3949
- db-presto
40-
- db-snowflake
50+
- db-duckdb-wasm
4151
- db-trino
42-
- main
52+
- db-postgres
53+
- db-motherduck
54+
- db-mysql
4355
runs-on: ubuntu-latest
4456
steps:
4557
- name: Success

jest.bigquery.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-db-bigquery/src/',
5+
'<rootDir>/test/src/databases/all/',
6+
'<rootDir>/test/src/databases/bigquery/',
7+
],
8+
};

jest.core.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-malloy-sql/',
5+
'<rootDir>/packages/malloy-syntax-highlight/',
6+
'<rootDir>/packages/malloy/',
7+
'<rootDir>/test/src/core/',
8+
'<rootDir>/test/src/render/',
9+
],
10+
};

jest.duckdb-other.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// For motherduck and duckdb-wasm
2+
module.exports = {
3+
...require('./jest.config.ts'),
4+
roots: [
5+
'<rootDir>/packages/malloy-db-duckdb/',
6+
'<rootDir>/test/src/databases/all/',
7+
'<rootDir>/test/src/databases/duckdb-all/',
8+
],
9+
};

jest.duckdb.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-db-duckdb/',
5+
'<rootDir>/test/src/databases/all/',
6+
'<rootDir>/test/src/databases/duckdb/',
7+
'<rootDir>/test/src/databases/duckdb-all/',
8+
],
9+
};

jest.mysql.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: ['<rootDir>/test/src/databases/all/'],
4+
};

jest.postgres.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-db-postgres/',
5+
'<rootDir>/test/src/databases/all/',
6+
'<rootDir>/test/src/databases/postgres/',
7+
],
8+
};

jest.presto.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/test/src/databases/all/',
5+
'<rootDir>/test/src/databases/presto-trino/',
6+
],
7+
};

jest.snowflake.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-db-snowflake/',
5+
'<rootDir>/test/src/databases/all/',
6+
],
7+
};

jest.trino.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
...require('./jest.config.ts'),
3+
roots: [
4+
'<rootDir>/packages/malloy-db-trino/src/',
5+
'<rootDir>/test/src/databases/all/',
6+
'<rootDir>/test/src/databases/presto-trino/',
7+
],
8+
};

0 commit comments

Comments
 (0)