@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.
Files changed (69) hide show
  1. package/README.md +16 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +18 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/performance/index.d.ts +3 -0
  7. package/dist/performance/index.d.ts.map +1 -0
  8. package/dist/performance/index.js +19 -0
  9. package/dist/performance/index.js.map +1 -0
  10. package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.d.ts +22 -0
  11. package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.d.ts.map +1 -0
  12. package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.js +71 -0
  13. package/dist/performance/plugins/inbox-outbox-report-endpoint-plugin.js.map +1 -0
  14. package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.d.ts +23 -0
  15. package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.d.ts.map +1 -0
  16. package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.js +81 -0
  17. package/dist/performance/plugins/inbox-outbox-state-endpoint-plugin.js.map +1 -0
  18. package/dist/performance/plugins/index.d.ts +3 -0
  19. package/dist/performance/plugins/index.d.ts.map +1 -0
  20. package/dist/performance/plugins/index.js +8 -0
  21. package/dist/performance/plugins/index.js.map +1 -0
  22. package/dist/performance/scripts/index.d.ts +4 -0
  23. package/dist/performance/scripts/index.d.ts.map +1 -0
  24. package/dist/performance/scripts/index.js +20 -0
  25. package/dist/performance/scripts/index.js.map +1 -0
  26. package/dist/performance/scripts/make-graphql-request.d.ts +29 -0
  27. package/dist/performance/scripts/make-graphql-request.d.ts.map +1 -0
  28. package/dist/performance/scripts/make-graphql-request.js +23 -0
  29. package/dist/performance/scripts/make-graphql-request.js.map +1 -0
  30. package/dist/performance/scripts/run-inbox-outbox-scenario.d.ts +97 -0
  31. package/dist/performance/scripts/run-inbox-outbox-scenario.d.ts.map +1 -0
  32. package/dist/performance/scripts/run-inbox-outbox-scenario.js +178 -0
  33. package/dist/performance/scripts/run-inbox-outbox-scenario.js.map +1 -0
  34. package/dist/performance/scripts/run-scenario.d.ts +54 -0
  35. package/dist/performance/scripts/run-scenario.d.ts.map +1 -0
  36. package/dist/performance/scripts/run-scenario.js +37 -0
  37. package/dist/performance/scripts/run-scenario.js.map +1 -0
  38. package/dist/performance/utils/colorize-text.d.ts +3 -0
  39. package/dist/performance/utils/colorize-text.d.ts.map +1 -0
  40. package/dist/performance/utils/colorize-text.js +8 -0
  41. package/dist/performance/utils/colorize-text.js.map +1 -0
  42. package/dist/performance/utils/index.d.ts +4 -0
  43. package/dist/performance/utils/index.d.ts.map +1 -0
  44. package/dist/performance/utils/index.js +20 -0
  45. package/dist/performance/utils/index.js.map +1 -0
  46. package/dist/performance/utils/report-generation.d.ts +14 -0
  47. package/dist/performance/utils/report-generation.d.ts.map +1 -0
  48. package/dist/performance/utils/report-generation.js +245 -0
  49. package/dist/performance/utils/report-generation.js.map +1 -0
  50. package/dist/performance/utils/stub-helpers.d.ts +12 -0
  51. package/dist/performance/utils/stub-helpers.d.ts.map +1 -0
  52. package/dist/performance/utils/stub-helpers.js +38 -0
  53. package/dist/performance/utils/stub-helpers.js.map +1 -0
  54. package/package.json +59 -0
  55. package/src/index.ts +1 -0
  56. package/src/performance/index.ts +2 -0
  57. package/src/performance/plugins/inbox-outbox-report-endpoint-plugin.spec.ts +1135 -0
  58. package/src/performance/plugins/inbox-outbox-report-endpoint-plugin.ts +92 -0
  59. package/src/performance/plugins/inbox-outbox-state-endpoint-plugin.spec.ts +99 -0
  60. package/src/performance/plugins/inbox-outbox-state-endpoint-plugin.ts +101 -0
  61. package/src/performance/plugins/index.ts +2 -0
  62. package/src/performance/scripts/index.ts +3 -0
  63. package/src/performance/scripts/make-graphql-request.ts +50 -0
  64. package/src/performance/scripts/run-inbox-outbox-scenario.ts +279 -0
  65. package/src/performance/scripts/run-scenario.ts +96 -0
  66. package/src/performance/utils/colorize-text.ts +4 -0
  67. package/src/performance/utils/index.ts +3 -0
  68. package/src/performance/utils/report-generation.ts +408 -0
  69. 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';
@@ -0,0 +1,2 @@
1
+ export * from './plugins';
2
+ export * from './scripts';