@axinom/mosaic-testing 0.1.0-rc.4
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/README.md +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/performance/index.d.ts +3 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +19 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.d.ts +22 -0
- package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.d.ts.map +1 -0
- package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.js +71 -0
- package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.js.map +1 -0
- package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.d.ts +23 -0
- package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.d.ts.map +1 -0
- package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.js +81 -0
- package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.js.map +1 -0
- package/dist/performance/plugins/index.d.ts +3 -0
- package/dist/performance/plugins/index.d.ts.map +1 -0
- package/dist/performance/plugins/index.js +8 -0
- package/dist/performance/plugins/index.js.map +1 -0
- package/dist/performance/scripts/index.d.ts +4 -0
- package/dist/performance/scripts/index.d.ts.map +1 -0
- package/dist/performance/scripts/index.js +20 -0
- package/dist/performance/scripts/index.js.map +1 -0
- package/dist/performance/scripts/make-graphql-request.d.ts +29 -0
- package/dist/performance/scripts/make-graphql-request.d.ts.map +1 -0
- package/dist/performance/scripts/make-graphql-request.js +23 -0
- package/dist/performance/scripts/make-graphql-request.js.map +1 -0
- package/dist/performance/scripts/run-inbox-outbox-scenario.d.ts +97 -0
- package/dist/performance/scripts/run-inbox-outbox-scenario.d.ts.map +1 -0
- package/dist/performance/scripts/run-inbox-outbox-scenario.js +178 -0
- package/dist/performance/scripts/run-inbox-outbox-scenario.js.map +1 -0
- package/dist/performance/scripts/run-scenario.d.ts +54 -0
- package/dist/performance/scripts/run-scenario.d.ts.map +1 -0
- package/dist/performance/scripts/run-scenario.js +37 -0
- package/dist/performance/scripts/run-scenario.js.map +1 -0
- package/dist/performance/utils/colorize-text.d.ts +3 -0
- package/dist/performance/utils/colorize-text.d.ts.map +1 -0
- package/dist/performance/utils/colorize-text.js +8 -0
- package/dist/performance/utils/colorize-text.js.map +1 -0
- package/dist/performance/utils/index.d.ts +4 -0
- package/dist/performance/utils/index.d.ts.map +1 -0
- package/dist/performance/utils/index.js +20 -0
- package/dist/performance/utils/index.js.map +1 -0
- package/dist/performance/utils/report-generation.d.ts +14 -0
- package/dist/performance/utils/report-generation.d.ts.map +1 -0
- package/dist/performance/utils/report-generation.js +245 -0
- package/dist/performance/utils/report-generation.js.map +1 -0
- package/dist/performance/utils/stub-helpers.d.ts +12 -0
- package/dist/performance/utils/stub-helpers.d.ts.map +1 -0
- package/dist/performance/utils/stub-helpers.js +38 -0
- package/dist/performance/utils/stub-helpers.js.map +1 -0
- package/package.json +59 -0
- package/src/index.ts +1 -0
- package/src/performance/index.ts +2 -0
- package/src/performance/plugins/inbox-outbox-report-endpoint-plugin.spec.ts +1135 -0
- package/src/performance/plugins/inbox-outbox-report-endpoint-plugin.ts +92 -0
- package/src/performance/plugins/inbox-outbox-state-endpoint-plugin.spec.ts +99 -0
- package/src/performance/plugins/inbox-outbox-state-endpoint-plugin.ts +101 -0
- package/src/performance/plugins/index.ts +2 -0
- package/src/performance/scripts/index.ts +3 -0
- package/src/performance/scripts/make-graphql-request.ts +50 -0
- package/src/performance/scripts/run-inbox-outbox-scenario.ts +279 -0
- package/src/performance/scripts/run-scenario.ts +96 -0
- package/src/performance/utils/colorize-text.ts +4 -0
- package/src/performance/utils/index.ts +3 -0
- package/src/performance/utils/report-generation.ts +408 -0
- package/src/performance/utils/stub-helpers.ts +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-helpers.d.ts","sourceRoot":"","sources":["../../../src/performance/utils/stub-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,SAAS,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,yBAAyB,aAC1B,MAAM,iBACD,MAAM,EAAE,KACtB,kBAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,yBACA,MAAM,KAAK,OAAO,EAAE,KACzC,IAWF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPoolStub = exports.getGraphQLResolveInfoStub = void 0;
|
|
4
|
+
const jest_auto_stub_1 = require("jest-auto-stub");
|
|
5
|
+
/**
|
|
6
|
+
* A stub for a `GraphQLResolveInfo` to return minimal info for specific
|
|
7
|
+
* endpoint and include requested properties in selection set.
|
|
8
|
+
*/
|
|
9
|
+
const getGraphQLResolveInfoStub = (endpoint, ...properties) => {
|
|
10
|
+
return (0, jest_auto_stub_1.stub)({
|
|
11
|
+
fieldNodes: [
|
|
12
|
+
{
|
|
13
|
+
name: { value: endpoint },
|
|
14
|
+
selectionSet: (0, jest_auto_stub_1.stub)({
|
|
15
|
+
selections: properties.map((p) => ({ name: { value: p } })),
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.getGraphQLResolveInfoStub = getGraphQLResolveInfoStub;
|
|
22
|
+
/**
|
|
23
|
+
* A stub for a pg Pool with explicit overrides for `query` and `release`
|
|
24
|
+
*/
|
|
25
|
+
const getPoolStub = (returnResult) => {
|
|
26
|
+
return (0, jest_auto_stub_1.stub)({
|
|
27
|
+
connect: () => ({
|
|
28
|
+
query: (q) => ({
|
|
29
|
+
rows: returnResult(q),
|
|
30
|
+
}),
|
|
31
|
+
release: () => {
|
|
32
|
+
return;
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.getPoolStub = getPoolStub;
|
|
38
|
+
//# sourceMappingURL=stub-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-helpers.js","sourceRoot":"","sources":["../../../src/performance/utils/stub-helpers.ts"],"names":[],"mappings":";;;AACA,mDAAsC;AAGtC;;;GAGG;AACI,MAAM,yBAAyB,GAAG,CACvC,QAAgB,EAChB,GAAG,UAAoB,EACH,EAAE;IACtB,OAAO,IAAA,qBAAI,EAAqB;QAC9B,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACzB,YAAY,EAAE,IAAA,qBAAI,EAAmB;oBACnC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;iBAC5D,CAAC;aACH;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,yBAAyB,6BAcpC;AAEF;;GAEG;AACI,MAAM,WAAW,GAAG,CACzB,YAA0C,EACpC,EAAE;IACR,OAAO,IAAA,qBAAI,EAAO;QAChB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;YACd,KAAK,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC;gBACrB,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;aACtB,CAAC;YACF,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO;YACT,CAAC;SACF,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC;AAbW,QAAA,WAAW,eAatB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axinom/mosaic-testing",
|
|
3
|
+
"version": "0.1.0-rc.4",
|
|
4
|
+
"description": "This library encapsulates testing-related functionality for Mosaic based services.",
|
|
5
|
+
"author": "Axinom",
|
|
6
|
+
"license": "PROPRIETARY",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"axinom",
|
|
9
|
+
"mosaic",
|
|
10
|
+
"axinom mosaic"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"src"
|
|
15
|
+
],
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"clean": "rimraf dist",
|
|
20
|
+
"build": "yarn clean && tsc --project tsconfig.build.json",
|
|
21
|
+
"ts:validate": "tsc",
|
|
22
|
+
"build:ci": "yarn workspaces focus && yarn build",
|
|
23
|
+
"dev": "tsc -w --project tsconfig.build.json",
|
|
24
|
+
"test": "jest --silent",
|
|
25
|
+
"test:watch": "jest --watch --silent",
|
|
26
|
+
"test:cov": "jest --coverage --silent && yarn posttest:cov",
|
|
27
|
+
"posttest:cov": "ts-node ../../scripts/open-test-coverage.ts -- libs/testing",
|
|
28
|
+
"test:debug": "node --inspect -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --silent",
|
|
29
|
+
"test:ci": "jest --reporters=default --reporters=jest-junit --coverage --coverageReporters=cobertura --coverageReporters=html",
|
|
30
|
+
"lint": "eslint . --ext .ts,.tsx,.js --color --cache"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@axinom/mosaic-id-link-be": "^0.25.0-rc.7",
|
|
34
|
+
"@axinom/mosaic-message-bus": "^0.31.0-rc.7",
|
|
35
|
+
"@axinom/mosaic-message-bus-abstractions": "^0.18.0-rc.7",
|
|
36
|
+
"@axinom/mosaic-service-common": "^0.53.0-rc.7",
|
|
37
|
+
"axios": "1.7.4",
|
|
38
|
+
"graphile-build": "^4.13.0",
|
|
39
|
+
"graphile-build-pg": "^4.13.0",
|
|
40
|
+
"graphile-utils": "^4.13.0",
|
|
41
|
+
"graphql": "^15.4.0",
|
|
42
|
+
"graphql-tag": "^2.11.0",
|
|
43
|
+
"pg": "^8.11.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^18.11.18",
|
|
47
|
+
"@types/pg": "^8.6.1",
|
|
48
|
+
"eslint": "^8.35.0",
|
|
49
|
+
"jest": "^29",
|
|
50
|
+
"jest-auto-stub": "^1.0.8",
|
|
51
|
+
"rimraf": "^3.0.2",
|
|
52
|
+
"ts-node": "^10.9.1",
|
|
53
|
+
"typescript": "^5.0.4"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "9ead9a5dd5273cca0368387d55421b9ad6778048"
|
|
59
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './performance';
|