Skip to content

Commit e566821

Browse files
authored
chore(ci): Enable smoke testing for Oracle (#6196)
1 parent 2e8f6a4 commit e566821

20 files changed

+103
-43
lines changed

.github/actions/smoke.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Debug log for test containers
5+
export DEBUG=testcontainers
6+
7+
echo "::group::Oracle"
8+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:oracle
9+
echo "::endgroup::"
10+
11+
echo "::group::Postgres"
12+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:postgres
13+
echo "::endgroup::"
14+
15+
echo "::group::QuestDB"
16+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:questdb
17+
echo "::endgroup::"
18+
19+
echo "::group::Crate"
20+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:crate
21+
echo "::endgroup::"
22+
23+
echo "::group::Lambda"
24+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:lambda
25+
echo "::endgroup::"
26+
27+
echo "::group::Materialize"
28+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:materialize
29+
echo "::endgroup::"
30+
31+
echo "::group::Multidb"
32+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:multidb
33+
echo "::endgroup::"
34+
35+
echo "::group::Prestodb"
36+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:prestodb
37+
echo "::endgroup::"
38+
39+
echo "::group::Trino"
40+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:trino
41+
echo "::endgroup::"
42+
43+
echo "::group::MS SQL"
44+
yarn lerna run --concurrency 1 --stream --no-prefix smoke:mssql
45+
echo "::endgroup::"

.github/workflows/push.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,19 +494,13 @@ jobs:
494494
with:
495495
command: build
496496
args: --manifest-path rust/cubestore/Cargo.toml -j 4
497-
- name: Run Integration smoke tests
498-
timeout-minutes: 30
499-
env:
500-
CUBEJS_AWS_KEY: ${{ secrets.CUBEJS_AWS_KEY }}
501-
CUBEJS_AWS_SECRET: ${{ secrets.CUBEJS_AWS_SECRET }}
502-
CUBEJS_AWS_REGION: us-east-1
503-
CUBEJS_AWS_S3_OUTPUT_LOCATION: s3://cubejs-opensource/testing/output
504-
CUBEJS_DB_EXPORT_BUCKET: s3://cubejs-opensource/testing/export
497+
- name: Copy Cube Store
505498
run: |
506499
mkdir -p rust/cubestore/downloaded/latest/bin
507500
cp rust/cubestore/target/debug/cubestored rust/cubestore/downloaded/latest/bin/cubestored
508-
cd packages/cubejs-testing/
509-
yarn run smoke
501+
- name: Run Integration smoke tests
502+
timeout-minutes: 30
503+
run: ./.github/actions/smoke.sh
510504

511505
docker-image-latest-set-tag:
512506
# At least git should be completed pushed up until this moment

packages/cubejs-backend-shared/src/process.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ let i = 0;
2020
export function getNext(): number {
2121
return i++;
2222
}
23+
24+
export function isCI(): boolean {
25+
if (process.env.GITHUB_EVENT_NAME) {
26+
return true;
27+
}
28+
29+
return false;
30+
}

packages/cubejs-testing-shared/src/db/oracle.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { GenericContainer } from 'testcontainers';
1+
import { GenericContainer, Wait } from 'testcontainers';
2+
import { isCI } from '@cubejs-backend/shared';
3+
24
import { DbRunnerAbstract, DBRunnerContainerOptions } from './db-runner.abstract';
35

46
type OracleStartOptions = DBRunnerContainerOptions & {
@@ -11,8 +13,15 @@ export class OracleDBRunner extends DbRunnerAbstract {
1113

1214
const container = new GenericContainer(`gvenzl/oracle-xe:${version}`)
1315
.withEnv('ORACLE_PASSWORD', 'test')
14-
.withExposedPorts(1521)
15-
.withStartupTimeout(30 * 1000);
16+
.withHealthCheck({
17+
test: 'healthcheck.sh',
18+
interval: 2 * 1000,
19+
timeout: 5 * 1000,
20+
retries: 5,
21+
startPeriod: (isCI() ? 45 : 15) * 1000
22+
})
23+
.withWaitStrategy(Wait.forHealthCheck())
24+
.withExposedPorts(1521);
1625

1726
if (options.volumes) {
1827
// eslint-disable-next-line no-restricted-syntax

packages/cubejs-testing/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"driver:databricks:snap": "jest --verbose --updateSnapshot -i dist/test/driver-databricks.test.js",
4949
"integration:cubestore": "jest --verbose --updateSnapshot -i dist/test/driver-cubestore.test.js",
5050
"rest:postgres": "yarn tsc && clear && jest --verbose -i dist/test/rest-postgres.test.js",
51-
"smoke": "jest --verbose -i 'dist/test/smoke-(?!.*?(redshift|athena|bigquery|firebolt|cubesql|oracle))'",
5251
"smoke:athena": "jest --verbose -i dist/test/smoke-athena.test.js",
5352
"smoke:athena:snapshot": "jest --verbose --updateSnapshot -i dist/test/smoke-athena.test.js",
5453
"smoke:bigquery": "jest --verbose -i dist/test/smoke-bigquery.test.js",

packages/cubejs-testing/test/smoke-athena.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cubejs, { CubejsApi } from '@cubejs-client/core';
33
// eslint-disable-next-line import/no-extraneous-dependencies
44
import { afterAll, beforeAll, jest, expect } from '@jest/globals';
55
import { BirdBox, getBirdbox } from '../src';
6-
import { DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
6+
import { DEFAULT_API_TOKEN, DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
77

88
const delay = (t: number) => new Promise(resolve => setTimeout(() => resolve(null), t));
99

@@ -25,7 +25,7 @@ describe('athena', () => {
2525
schemaDir: 'postgresql/schema',
2626
}
2727
);
28-
client = cubejs(async () => 'test', {
28+
client = cubejs(async () => DEFAULT_API_TOKEN, {
2929
apiUrl: birdbox.configuration.apiUrl,
3030
});
3131
});

packages/cubejs-testing/test/smoke-bigquery.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import cubejs, { CubejsApi } from '@cubejs-client/core';
22
// eslint-disable-next-line import/no-extraneous-dependencies
33
import { afterAll, beforeAll, jest } from '@jest/globals';
44
import { BirdBox, getBirdbox } from '../src';
5-
import { DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
5+
import { DEFAULT_API_TOKEN, DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
66

77
describe('bigquery', () => {
88
jest.setTimeout(60 * 5 * 1000);
@@ -21,7 +21,7 @@ describe('bigquery', () => {
2121
schemaDir: 'postgresql/schema',
2222
}
2323
);
24-
client = cubejs(async () => 'test', {
24+
client = cubejs(async () => DEFAULT_API_TOKEN, {
2525
apiUrl: birdbox.configuration.apiUrl,
2626
});
2727
});

packages/cubejs-testing/test/smoke-crate.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { afterAll, beforeAll, jest } from '@jest/globals';
44
import { StartedTestContainer } from 'testcontainers';
55
import { CrateDBRunner } from '@cubejs-backend/testing-shared';
66
import { BirdBox, getBirdbox } from '../src';
7-
import { DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
7+
import { DEFAULT_API_TOKEN, DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
88

99
describe('crate', () => {
1010
jest.setTimeout(60 * 5 * 1000);
@@ -30,7 +30,7 @@ describe('crate', () => {
3030
schemaDir: 'postgresql/schema',
3131
}
3232
);
33-
client = cubejs(async () => 'test', {
33+
client = cubejs(async () => DEFAULT_API_TOKEN, {
3434
apiUrl: birdbox.configuration.apiUrl,
3535
});
3636
});

packages/cubejs-testing/test/smoke-firebolt.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import cubejs, { CubejsApi } from '@cubejs-client/core';
22
// eslint-disable-next-line import/no-extraneous-dependencies
33
import { afterAll, beforeAll, jest, expect } from '@jest/globals';
44
import { BirdBox, getBirdbox } from '../src';
5-
import { DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
5+
import { DEFAULT_API_TOKEN, DEFAULT_CONFIG, testQueryMeasure } from './smoke-tests';
66

77
describe('firebolt', () => {
88
jest.setTimeout(60 * 5 * 1000);
@@ -20,7 +20,7 @@ describe('firebolt', () => {
2020
schemaDir: 'firebolt/schema',
2121
}
2222
);
23-
client = cubejs(async () => 'test', {
23+
client = cubejs(async () => DEFAULT_API_TOKEN, {
2424
apiUrl: birdbox.configuration.apiUrl,
2525
});
2626
});

packages/cubejs-testing/test/smoke-lambda.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import cubejs, { CubejsApi, Query } from '@cubejs-client/core';
77
// eslint-disable-next-line import/no-extraneous-dependencies
88
import { afterAll, beforeAll, expect, jest } from '@jest/globals';
99
import { BirdBox, getBirdbox } from '../src';
10-
import { DEFAULT_CONFIG } from './smoke-tests';
10+
import { DEFAULT_API_TOKEN, DEFAULT_CONFIG } from './smoke-tests';
1111

1212
const CubeStoreDriver = require('@cubejs-backend/cubestore-driver');
1313
const PostgresDriver = require('@cubejs-backend/postgres-driver');
@@ -85,7 +85,7 @@ describe('lambda', () => {
8585
cubejsConfig: 'lambda/cube.js',
8686
}
8787
);
88-
client = cubejs(async () => 'test', {
88+
client = cubejs(async () => DEFAULT_API_TOKEN, {
8989
apiUrl: birdbox.configuration.apiUrl,
9090
});
9191
postgres = new PostgresDriver({

0 commit comments

Comments
 (0)