@cubejs-backend/testing-shared 0.30.45 → 0.30.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.30.50](https://github.com/cube-js/cube.js/compare/v0.30.49...v0.30.50) (2022-08-16)
7
+
8
+ **Note:** Version bump only for package @cubejs-backend/testing-shared
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.30.47](https://github.com/cube-js/cube.js/compare/v0.30.46...v0.30.47) (2022-08-12)
15
+
16
+
17
+ ### Features
18
+
19
+ * **cubejs:** LambdaView: hybrid query of source tables and pre-aggregation tables. ([#4718](https://github.com/cube-js/cube.js/issues/4718)) ([4ae826b](https://github.com/cube-js/cube.js/commit/4ae826b4d27afbfce366830150e130f29c7fcbbf))
20
+
21
+
22
+
23
+
24
+
25
+ ## [0.30.46](https://github.com/cube-js/cube.js/compare/v0.30.45...v0.30.46) (2022-08-10)
26
+
27
+
28
+ ### Features
29
+
30
+ * **drivers:** Bootstraps CrateDB driver ([#4929](https://github.com/cube-js/cube.js/issues/4929)) ([db87b8f](https://github.com/cube-js/cube.js/commit/db87b8f18686607498467c6ff0f71abcd1e38c5d))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [0.30.45](https://github.com/cube-js/cube.js/compare/v0.30.44...v0.30.45) (2022-08-05)
7
37
 
8
38
  **Note:** Version bump only for package @cubejs-backend/testing-shared
@@ -98,7 +98,7 @@ DriverTests.QUERY = `
98
98
  SELECT 2 AS id, 200 AS amount, 'new' AS status
99
99
  UNION ALL
100
100
  SELECT 3 AS id, 400 AS amount, 'processed' AS status
101
- )
101
+ ) AS data
102
102
  ORDER BY 1
103
103
  `;
104
104
  DriverTests.ROWS = [
@@ -0,0 +1,5 @@
1
+ import { DbRunnerAbstract, DBRunnerContainerOptions } from './db-runner.abstract';
2
+ export declare class CrateDBRunner extends DbRunnerAbstract {
3
+ static startContainer(options: DBRunnerContainerOptions): Promise<import("testcontainers").StartedTestContainer>;
4
+ }
5
+ //# sourceMappingURL=crate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crate.d.ts","sourceRoot":"","sources":["../../../src/db/crate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAElF,qBAAa,aAAc,SAAQ,gBAAgB;WACnC,cAAc,CAAC,OAAO,EAAE,wBAAwB;CAgB/D"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CrateDBRunner = void 0;
4
+ const testcontainers_1 = require("testcontainers");
5
+ const db_runner_abstract_1 = require("./db-runner.abstract");
6
+ class CrateDBRunner extends db_runner_abstract_1.DbRunnerAbstract {
7
+ static startContainer(options) {
8
+ const version = process.env.TEST_CRATE_DB_VERSION || '5.0.0';
9
+ const container = new testcontainers_1.GenericContainer(`crate/crate:${version}`)
10
+ .withExposedPorts(5432)
11
+ .withStartupTimeout(10 * 1000);
12
+ if (options.volumes) {
13
+ // eslint-disable-next-line no-restricted-syntax
14
+ for (const { source, target, bindMode } of options.volumes) {
15
+ container.withBindMount(source, target, bindMode);
16
+ }
17
+ }
18
+ return container.start();
19
+ }
20
+ }
21
+ exports.CrateDBRunner = CrateDBRunner;
22
+ //# sourceMappingURL=crate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crate.js","sourceRoot":"","sources":["../../../src/db/crate.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD,6DAAkF;AAElF,MAAa,aAAc,SAAQ,qCAAgB;IAC1C,MAAM,CAAC,cAAc,CAAC,OAAiC;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC;QAE7D,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,eAAe,OAAO,EAAE,CAAC;aAC7D,gBAAgB,CAAC,IAAI,CAAC;aACtB,kBAAkB,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,gDAAgD;YAChD,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,OAAO,CAAC,OAAO,EAAE;gBAC1D,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;aACnD;SACF;QAED,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF;AAjBD,sCAiBC"}
@@ -3,4 +3,5 @@ export * from './postgres';
3
3
  export * from './cubestore';
4
4
  export * from './questdb';
5
5
  export * from './materialize';
6
+ export * from './crate';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -15,4 +15,5 @@ __exportStar(require("./postgres"), exports);
15
15
  __exportStar(require("./cubestore"), exports);
16
16
  __exportStar(require("./questdb"), exports);
17
17
  __exportStar(require("./materialize"), exports);
18
+ __exportStar(require("./crate"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,gDAA8B;AAC9B,0CAAwB"}
@@ -1,9 +1,11 @@
1
+ import { StartedTestContainer } from 'testcontainers';
1
2
  import { DbRunnerAbstract, DBRunnerContainerOptions } from './db-runner.abstract';
2
3
  declare type PostgresStartOptions = DBRunnerContainerOptions & {
3
4
  version?: string;
4
5
  };
5
6
  export declare class PostgresDBRunner extends DbRunnerAbstract {
6
- static startContainer(options: PostgresStartOptions): Promise<import("testcontainers").StartedTestContainer>;
7
+ static startContainer(options: PostgresStartOptions): Promise<StartedTestContainer>;
8
+ static loadEcom(db: StartedTestContainer): Promise<void>;
7
9
  }
8
10
  export {};
9
11
  //# sourceMappingURL=postgres.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../src/db/postgres.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAElF,aAAK,oBAAoB,GAAG,wBAAwB,GAAG;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,gBAAgB;WACtC,cAAc,CAAC,OAAO,EAAE,oBAAoB;CA2B3D"}
1
+ {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../src/db/postgres.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAElF,aAAK,oBAAoB,GAAG,wBAAwB,GAAG;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,gBAAgB;WACtC,cAAc,CAAC,OAAO,EAAE,oBAAoB;WA4BtC,QAAQ,CAAC,EAAE,EAAE,oBAAoB;CAItD"}
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.PostgresDBRunner = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const child_process_1 = require("child_process");
4
9
  const testcontainers_1 = require("testcontainers");
5
10
  const db_runner_abstract_1 = require("./db-runner.abstract");
6
11
  class PostgresDBRunner extends db_runner_abstract_1.DbRunnerAbstract {
@@ -28,6 +33,10 @@ class PostgresDBRunner extends db_runner_abstract_1.DbRunnerAbstract {
28
33
  }
29
34
  return container.start();
30
35
  }
36
+ static async loadEcom(db) {
37
+ const ecom = await (await node_fetch_1.default('https://cube.dev/downloads/ecom-dump-d3-example.sql')).text();
38
+ child_process_1.execSync(`psql postgresql://test:test@${db.getHost()}:${db.getMappedPort(5432)}/test`, { input: ecom });
39
+ }
31
40
  }
32
41
  exports.PostgresDBRunner = PostgresDBRunner;
33
42
  //# sourceMappingURL=postgres.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../../src/db/postgres.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD,6DAAkF;AAMlF,MAAa,gBAAiB,SAAQ,qCAAgB;IAC7C,MAAM,CAAC,cAAc,CAAC,OAA6B;QACxD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC;QAE7E,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,YAAY,OAAO,EAAE,CAAC;aAC1D,OAAO,CAA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f,KAAK;YACL,2CAA2C;YAC3C,uDAAuD;aACtD,kBAAkB,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,gDAAgD;YAChD,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,OAAO,CAAC,OAAO,EAAE;gBAC1D,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;aACnD;SACF;QAED,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAwB;QACnD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,oBAAK,CAAC,qDAAqD,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/F,wBAAQ,CAAC,+BAA+B,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1G,CAAC;CACF;AAjCD,4CAiCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubejs-backend/testing-shared",
3
- "version": "0.30.45",
3
+ "version": "0.30.50",
4
4
  "description": "Cube.js Testing Helpers",
5
5
  "author": "Cube Dev, Inc.",
6
6
  "license": "Apache-2.0",
@@ -21,11 +21,12 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@cubejs-backend/dotenv": "^9.0.2",
24
- "@cubejs-backend/query-orchestrator": "^0.30.45",
25
- "@cubejs-backend/schema-compiler": "^0.30.45",
26
- "@cubejs-backend/shared": "^0.30.45",
24
+ "@cubejs-backend/query-orchestrator": "^0.30.50",
25
+ "@cubejs-backend/schema-compiler": "^0.30.50",
26
+ "@cubejs-backend/shared": "^0.30.50",
27
27
  "dedent": "^0.7.0",
28
- "testcontainers": "^7.5.0"
28
+ "node-fetch": "^2.6.7",
29
+ "testcontainers": "^8.12"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@cubejs-backend/linter": "^0.30.0",
@@ -52,5 +53,5 @@
52
53
  "eslintConfig": {
53
54
  "extends": "../cubejs-linter"
54
55
  },
55
- "gitHead": "103090c637da2a13d82a1dd44a45e9ad98553401"
56
+ "gitHead": "6b6b9539d695a4e6ab5ed35675294d4083ee38af"
56
57
  }