@squiz/component-cli-lib 1.2.1-alpha.105 → 1.2.1-alpha.107

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 (36) hide show
  1. package/.gitlab-ci.yml +18 -21
  2. package/CHANGELOG.md +16 -0
  3. package/jest.config.ts +3 -0
  4. package/lib/component-dev-folder-structures.spec.d.ts +1 -0
  5. package/lib/component-dev-folder-structures.spec.js +58 -0
  6. package/lib/component-dev-folder-structures.spec.js.map +1 -0
  7. package/lib/component-dev.d.ts +4 -1
  8. package/lib/component-dev.js +27 -18
  9. package/lib/component-dev.js.map +1 -1
  10. package/lib/component-dev.spec.js +28 -65
  11. package/lib/component-dev.spec.js.map +1 -1
  12. package/lib/integration-tests/__components__/big-package/manifest.json +3 -0
  13. package/lib/integration-tests/__components__/cmp-static-file-test/manifest.json +3 -0
  14. package/lib/integration-tests/__components__/invalid-manifest/manifest.json +3 -0
  15. package/lib/integration-tests/helper.d.ts +1 -0
  16. package/lib/integration-tests/helper.js +4 -1
  17. package/lib/integration-tests/helper.js.map +1 -1
  18. package/lib/integration-tests/service-deployment.spec.js +21 -1
  19. package/lib/integration-tests/service-deployment.spec.js.map +1 -1
  20. package/lib/integration-tests/upload-and-render-component.spec.js +24 -19
  21. package/lib/integration-tests/upload-and-render-component.spec.js.map +1 -1
  22. package/lib/upload-component-folder.d.ts +1 -1
  23. package/lib/upload-component-folder.js +9 -6
  24. package/lib/upload-component-folder.js.map +1 -1
  25. package/package.json +9 -9
  26. package/src/component-dev-folder-structures.spec.ts +69 -0
  27. package/src/component-dev.spec.ts +31 -83
  28. package/src/component-dev.ts +44 -18
  29. package/src/integration-tests/__components__/big-package/manifest.json +3 -0
  30. package/src/integration-tests/__components__/cmp-static-file-test/manifest.json +3 -1
  31. package/src/integration-tests/__components__/invalid-manifest/manifest.json +3 -0
  32. package/src/integration-tests/helper.ts +4 -0
  33. package/src/integration-tests/service-deployment.spec.ts +26 -2
  34. package/src/integration-tests/upload-and-render-component.spec.ts +51 -19
  35. package/src/upload-component-folder.ts +15 -7
  36. package/tsconfig.tsbuildinfo +1 -1
package/.gitlab-ci.yml CHANGED
@@ -4,25 +4,21 @@
4
4
  rules:
5
5
  - if: $CI_DEPLOY_TO_PROD && $CI_COMMIT_REF_NAME == $TARGET_BRANCH_PRODUCTION
6
6
  when: on_success
7
- - when: never
8
7
 
9
8
  .rules:when-uat:
10
9
  rules:
11
10
  - if: $CI_COMMIT_REF_NAME == $TARGET_BRANCH_UAT && $CI_DEPLOY_TO_PROD == null
12
11
  when: on_success
13
- - when: never
14
12
 
15
13
  .rules:when-development:
16
14
  rules:
17
15
  - if: $CI_COMMIT_REF_NAME == $TARGET_BRANCH_DEVELOPMENT && $CI_DEPLOY_TO_PROD == null
18
16
  when: on_success
19
- - when: never
20
17
 
21
18
  .rules:when-other-branch:
22
19
  rules:
23
20
  - if: $CI_COMMIT_REF_NAME != $TARGET_BRANCH_DEVELOPMENT && $CI_COMMIT_REF_NAME != $TARGET_BRANCH_UAT && $CI_COMMIT_REF_NAME != $TARGET_BRANCH_PRODUCTION && $CI_DEPLOY_TO_PROD == null
24
21
  when: on_success
25
- - when: never
26
22
 
27
23
  .get-service-urls:
28
24
  stage: smoke-test-setup
@@ -63,7 +59,7 @@
63
59
  reports:
64
60
  dotenv: dot.env
65
61
 
66
- smoke-test:
62
+ .smoke-test:
67
63
  stage: smoke-test
68
64
  tags:
69
65
  - size/l
@@ -83,13 +79,24 @@ smoke-test:
83
79
  - runner_system_failure
84
80
  - stuck_or_timeout_failure
85
81
 
86
- get-branch-service-urls:
82
+ smoke-test:development:
87
83
  extends:
88
- - .rules:when-other-branch
89
- - .get-service-urls
90
- environment:
91
- name: non-production-development
92
- url: components.dev.dx.squiz.cloud
84
+ - .smoke-test
85
+ - .rules:when-development
86
+
87
+ smoke-test:uat:
88
+ extends:
89
+ - .smoke-test
90
+ - .rules:when-uat
91
+
92
+ # TODO: Do we need this running for feature branches?
93
+ # get-branch-service-urls:
94
+ # extends:
95
+ # - .rules:when-other-branch
96
+ # - .get-service-urls
97
+ # environment:
98
+ # name: non-production-development
99
+ # url: components.dev.dx.squiz.cloud
93
100
 
94
101
  get-development-service-urls:
95
102
  extends:
@@ -106,13 +113,3 @@ get-uat-service-urls:
106
113
  environment:
107
114
  name: non-production-development
108
115
  url: components.dev.dx.squiz.cloud
109
-
110
- get-production-service-urls:
111
- extends:
112
- - .rules:when-production
113
- - .get-service-urls
114
- environment:
115
- name: production
116
- url: components.prod.dx.squiz.cloud
117
- tags:
118
- - access/aws-dx-prod
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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
+ ## [1.2.1-alpha.107](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.107) (2022-09-21)
7
+
8
+ **Note:** Version bump only for package @squiz/component-cli-lib
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.2.1-alpha.106](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.106) (2022-09-02)
15
+
16
+ **Note:** Version bump only for package @squiz/component-cli-lib
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.2.1-alpha.105](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.105) (2022-08-26)
7
23
 
8
24
  **Note:** Version bump only for package @squiz/component-cli-lib
package/jest.config.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { Config } from 'jest';
2
+ import path from 'path';
3
+
4
+ process.env.DATA_MOUNT_POINT = path.join(__dirname, '..', '..', 'test-components');
2
5
 
3
6
  // Sync object
4
7
  const config: Config = {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const supertest_1 = __importDefault(require("supertest"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const promises_1 = __importDefault(require("fs/promises"));
9
+ const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
10
+ const component_dev_1 = require("./component-dev");
11
+ jest.setTimeout(20000);
12
+ describe('component-dev', () => {
13
+ describe('production style folder structure', () => {
14
+ let server;
15
+ let request;
16
+ beforeAll(async () => {
17
+ server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0 });
18
+ request = (0, supertest_1.default)(server);
19
+ });
20
+ afterAll(async () => {
21
+ server.close();
22
+ });
23
+ it('should find the component', async () => {
24
+ const response = await request.get(`/r/set/unit-test-components/test-component/1.0.0?something=hello`);
25
+ expect(response.text).toEqual('<h1>hello</h1>');
26
+ });
27
+ });
28
+ describe('local developer style folders', () => {
29
+ let version;
30
+ let componentName;
31
+ let fixtureDirectory;
32
+ let server;
33
+ let request;
34
+ beforeAll(async () => {
35
+ const { fixtureDirectory: createdFixtureDirectory, version: createdVersion, componentName: createdName, } = await render_runtime_lib_1.TestHelpers.ComponentFixture.setupFullComponentDirectory('<h1>Hello World</h1>');
36
+ version = createdVersion;
37
+ fixtureDirectory = createdFixtureDirectory;
38
+ componentName = createdName;
39
+ server = (0, component_dev_1.startDevelopmentRender)(fixtureDirectory, { port: 0 });
40
+ request = (0, supertest_1.default)(server);
41
+ });
42
+ afterAll(async () => {
43
+ server.close();
44
+ });
45
+ afterAll(async () => {
46
+ await promises_1.default.rm(path_1.default.join(fixtureDirectory, componentName), { force: true, recursive: true });
47
+ });
48
+ it('should handle recursing folders to find the component', async () => {
49
+ const response = await request.get(`/r/set/some-namespace/${componentName}/${version}/`);
50
+ expect(response.text).toEqual('<h1>Hello World</h1>');
51
+ });
52
+ it('should handle serving static files from single component directory', async () => {
53
+ const response = await request.get(`/s/some-namespace/${componentName}/${version}/static.txt`);
54
+ expect(response.text).toEqual('hello');
55
+ });
56
+ });
57
+ });
58
+ //# sourceMappingURL=component-dev-folder-structures.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dev-folder-structures.spec.js","sourceRoot":"","sources":["../src/component-dev-folder-structures.spec.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAClC,gDAAwB;AACxB,2DAA8B;AAE9B,kEAAwD;AACxD,mDAAyD;AAGzD,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC;AAExB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;QACjD,IAAI,MAAc,CAAC;QACnB,IAAI,OAA4C,CAAC;QACjD,SAAS,CAAC,KAAK,IAAI,EAAE;YACnB,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACnF,OAAO,GAAG,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;YACvG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,IAAI,OAAe,CAAC;QACpB,IAAI,aAAqB,CAAC;QAC1B,IAAI,gBAAwB,CAAC;QAC7B,IAAI,MAAc,CAAC;QACnB,IAAI,OAA4C,CAAC;QAEjD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AC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ import { LoggerOptions } from '@squiz/dx-logger-lib';
1
3
  /**
2
4
  * startDevelopmentRender starts a dev-mode render stack for any
3
5
  * local directory. This should start an express server on a random unused port
@@ -10,4 +12,5 @@
10
12
  export declare function startDevelopmentRender(componentPath: string, options: {
11
13
  port: number;
12
14
  previewFile?: string;
13
- }): Promise<() => Promise<void>>;
15
+ loggingFormat?: LoggerOptions['format'];
16
+ }): import("http").Server;
@@ -7,6 +7,7 @@ exports.startDevelopmentRender = void 0;
7
7
  const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
8
8
  const dx_logger_lib_1 = require("@squiz/dx-logger-lib");
9
9
  const path_1 = __importDefault(require("path"));
10
+ const component_lib_1 = require("@squiz/component-lib");
10
11
  /**
11
12
  * startDevelopmentRender starts a dev-mode render stack for any
12
13
  * local directory. This should start an express server on a random unused port
@@ -16,25 +17,33 @@ const path_1 = __importDefault(require("path"));
16
17
  * @param {object} options - Additional configuration for the dev stack
17
18
  * @returns a function to stop the render stack
18
19
  */
19
- async function startDevelopmentRender(componentPath, options) {
20
- const logger = (0, dx_logger_lib_1.getLogger)({ name: 'component-dev', format: 'human' });
21
- await (0, render_runtime_lib_1.startRenderStack)({
22
- logger: logger,
23
- webserver: {
24
- port: options.port,
25
- rootUrl: `http://localhost:${options.port}`,
26
- shouldRunMigrations: false,
27
- },
28
- componentRunner: {
29
- // Considering the component path will be passed in from CLI
30
- // We need to generate the path from the calling directory
31
- dataMountPoint: path_1.default.resolve(process.cwd(), componentPath),
32
- localDevMode: true,
33
- previewFile: options.previewFile,
34
- workerTimeout: 20000,
35
- },
20
+ function startDevelopmentRender(componentPath, options) {
21
+ const logger = (0, dx_logger_lib_1.getLogger)({ name: 'component-dev', format: options.loggingFormat || 'human' });
22
+ const rootUrl = `http://localhost:${options.port}`;
23
+ const dataMountPoint = path_1.default.resolve(process.cwd(), componentPath);
24
+ const componentRunnerService = new render_runtime_lib_1.ComponentRunnerServiceWithWorkers({
25
+ dataMountPoint,
26
+ shouldCacheResponses: false,
27
+ workerTimeout: 5000,
28
+ }, logger);
29
+ const webServer = (0, render_runtime_lib_1.setupRenderRuntimeServer)({
30
+ logger,
31
+ componentRunnerService,
32
+ componentSetService: new component_lib_1.ComponentSetServiceForLocalDev(logger),
33
+ componentFunctionService: new component_lib_1.ComponentFunctionService(rootUrl),
34
+ componentPreviewService: new render_runtime_lib_1.ComponentPreviewService(options.previewFile),
35
+ manifestService: new component_lib_1.ManifestServiceForDev(dataMountPoint, logger),
36
+ }, { rootUrl });
37
+ const server = webServer.listen(options.port, () => {
38
+ logger.info(`Component development webserver started on port ${options.port}`);
36
39
  });
37
- return () => (0, render_runtime_lib_1.stopRenderStack)();
40
+ server.on('close', async () => {
41
+ await componentRunnerService.stop();
42
+ });
43
+ process.on('SIGINT', () => {
44
+ server.close();
45
+ });
46
+ return server;
38
47
  }
39
48
  exports.startDevelopmentRender = startDevelopmentRender;
40
49
  //# sourceMappingURL=component-dev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA8E;AAC9E,wDAAiD;AACjD,gDAAwB;AAExB;;;;;;;;GAQG;AACI,KAAK,UAAU,sBAAsB,CAAC,aAAqB,EAAE,OAA+C;IACjH,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACrE,MAAM,IAAA,qCAAgB,EAAC;QACrB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE;YACT,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YAC3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Ae,EAAE,IAAI,qCAAqB,CAAC,cAAc,EAAE,MAAM,CAAC;KACnE,EACD,EAAE,OAAO,EAAE,CACZ,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,IAAI,CAAC,mDAAmD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QAC5B,MAAM,sBAAsB,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAzCD,wDAyCC"}
@@ -3,87 +3,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
7
- const promises_1 = __importDefault(require("fs/promises"));
8
6
  const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
9
7
  const component_dev_1 = require("./component-dev");
10
8
  const supertest_1 = __importDefault(require("supertest"));
11
9
  jest.setTimeout(20000);
12
10
  describe('component-dev', () => {
13
- describe('production style folder structure', () => {
14
- let doStopStack;
15
- beforeAll(async () => {
16
- doStopStack = await (0, component_dev_1.startDevelopmentRender)(path_1.default.join(__dirname, '../../../test-components'), { port: 0 });
17
- });
18
- afterAll(async () => {
19
- await doStopStack();
20
- });
21
- it('should find the component', async () => {
22
- const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
23
- const response = await testServer.get(`/r/set/test-component/1.0.0?something=hello`);
24
- expect(response.text).toEqual('<h1>hello</h1>');
25
- });
26
- });
27
- describe('local developer style folders', () => {
28
- let doStopStack;
29
- let version;
30
- let componentName;
31
- let fixtureDirectory;
11
+ describe('accessing local dev routes', () => {
12
+ let server;
13
+ let request;
32
14
  beforeAll(async () => {
33
- const { fixtureDirectory: ceratedFixtureDirectory, version: createdVersion, componentName: createdName, } = await render_runtime_lib_1.TestHelpers.ComponentFixture.setupFullComponentDirectory('<h1>Hello World</h1>');
34
- version = createdVersion;
35
- fixtureDirectory = ceratedFixtureDirectory;
36
- componentName = createdName;
37
- doStopStack = await (0, component_dev_1.startDevelopmentRender)(fixtureDirectory, { port: 0 });
15
+ server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0 });
16
+ request = (0, supertest_1.default)(server);
38
17
  });
39
18
  afterAll(async () => {
40
- await doStopStack();
41
- await promises_1.default.rm(path_1.default.join(fixtureDirectory, componentName), { force: true, recursive: true });
42
- });
43
- it('should handle recursing folders to find the component', async () => {
44
- const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
45
- const response = await testServer.get(`/r/set/${componentName}/${version}/`);
46
- expect(response.text).toEqual('<h1>Hello World</h1>');
47
- });
48
- it('should handle serving static files from single component directory', async () => {
49
- const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
50
- const response = await testServer.get(`/s/${componentName}/${version}/static.txt`);
51
- expect(response.text).toEqual('hello');
19
+ server.close();
52
20
  });
53
- });
54
- describe('accessing local dev routes', () => {
55
- let stopServer;
56
- const port = 3006;
57
- const url = `http://localhost:${port}`;
58
- const request = (0, supertest_1.default)(url);
59
- beforeAll(async () => {
60
- const compDir = path_1.default.join(__dirname, '../', '../../test-components');
61
- stopServer = await (0, component_dev_1.startDevelopmentRender)(compDir, {
62
- port: port,
21
+ it('should fail validation when requesting a function with a missing entry file', async () => {
22
+ const response = await request.get('/r/set/unit-test-components/test-component/1.0.3/non-existent-entry-file?something=not-used');
23
+ expect(response.body).toEqual({
24
+ message: '"main\'s" entry file "missing-entry-file.js" is inaccessible',
63
25
  });
64
- });
65
- afterAll(async () => {
66
- await stopServer();
26
+ expect(response.statusCode).toEqual(500);
67
27
  });
68
28
  describe('definition routes', () => {
69
- render_runtime_lib_1.routeTests.definition(url, url);
29
+ const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0 });
30
+ const request = () => (0, supertest_1.default)(server);
31
+ render_runtime_lib_1.routeTests.definition(request, 'http://localhost:0');
32
+ afterAll(() => {
33
+ server.close();
34
+ });
70
35
  });
71
36
  describe('static routes', () => {
72
- render_runtime_lib_1.routeTests.static(url);
37
+ const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0 });
38
+ const request = () => (0, supertest_1.default)(server);
39
+ render_runtime_lib_1.routeTests.static(request);
40
+ afterAll(() => {
41
+ server.close();
42
+ });
73
43
  });
74
44
  describe('render routes', () => {
75
- render_runtime_lib_1.routeTests.render(url, url);
76
- });
77
- describe('GET /r/set/test-component/1.0.1', () => {
78
- //
79
- // this scenario is different to the 'production' tests
80
- // this is should 500 in prod and 404 locally
81
- it('should fail validation if trying to render a component with an invalid schema', async () => {
82
- const response = await request.get('/r/set/test-component/1.0.1?something=not-used');
83
- expect(response.statusCode).toEqual(404);
84
- expect(response.body).toEqual({
85
- message: 'manifest could not be found',
86
- });
45
+ const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0 });
46
+ const request = () => (0, supertest_1.default)(server);
47
+ render_runtime_lib_1.routeTests.render(request, 'http://localhost:0');
48
+ afterAll(() => {
49
+ server.close();
87
50
  });
88
51
  });
89
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"component-dev.spec.js","sourceRoot":"","sources":["../src/component-dev.spec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,2DAA8B;AAE9B,kEAAoE;AACpE,mDAAyD;AACzD,0DAAkC;AAElC,IAAI,CAAC,UAAU,CAAC,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O,EAAE,oBAAoB,CAAC,CAAC;YACrD,QAAQ,CAAC,GAAG,EAAE;gBACZ,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACzF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;YACxC,+BAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,QAAQ,CAAC,GAAG,EAAE;gBACZ,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACzF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;YACxC,+BAAU,CAAC,MAAM,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YACjD,QAAQ,CAAC,GAAG,EAAE;gBACZ,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -3,6 +3,9 @@
3
3
  "name": "big-package",
4
4
  "version": "1.0.2",
5
5
  "main-function": "render-json",
6
+ "namespace": "smoke-test-components",
7
+ "display-name": "some-display-name",
8
+ "description": "some-description",
6
9
  "functions": [
7
10
  {
8
11
  "name": "render-json",
@@ -3,6 +3,9 @@
3
3
  "name": "cmp-static-file-test",
4
4
  "version": "1.0.0",
5
5
  "main-function": "main",
6
+ "namespace": "smoke-test-components",
7
+ "display-name": "some-display-name",
8
+ "description": "some-description",
6
9
  "functions": [
7
10
  {
8
11
  "entry": "main.js",
@@ -3,6 +3,9 @@
3
3
  "name": "invalid-manifes@t",
4
4
  "version": "1.0.0",
5
5
  "main-function": "main",
6
+ "namespace": "smoke-test-components",
7
+ "display-name": "some-display-name",
8
+ "description": "some-description",
6
9
  "functions": [
7
10
  {
8
11
  "entry": "main.js",
@@ -8,6 +8,7 @@ interface Config {
8
8
  declare const configObj: Config;
9
9
  export default configObj;
10
10
  export declare const managementService: import("axios").AxiosInstance;
11
+ export declare const managementServiceRoot: import("axios").AxiosInstance;
11
12
  export declare const renderService: import("axios").AxiosInstance;
12
13
  export declare const ci_buildVersion: string;
13
14
  export declare const ci_buildBranch: string;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.addComponentSet = exports.deleteComponentSet = exports.removeFile = exports.createFile = exports.getTestComponents = exports.ci_buildBranch = exports.ci_buildVersion = exports.renderService = exports.managementService = void 0;
6
+ exports.addComponentSet = exports.deleteComponentSet = exports.removeFile = exports.createFile = exports.getTestComponents = exports.ci_buildBranch = exports.ci_buildVersion = exports.renderService = exports.managementServiceRoot = exports.managementService = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
@@ -20,6 +20,9 @@ const configObj = {
20
20
  };
21
21
  exports.default = configObj;
22
22
  exports.managementService = axios_1.default.create({
23
+ baseURL: configObj.managementServiceUrl + '/v1',
24
+ });
25
+ exports.managementServiceRoot = axios_1.default.create({
23
26
  baseURL: configObj.managementServiceUrl,
24
27
  });
25
28
  exports.renderService = axios_1.default.create({
@@ -1 +1 @@
1
- {"version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C;SACtB;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,8CAWC;AACM,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IACjE,MAAM,OAAO,GAAG,IAAA,oBAAW,EAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;IAChD,MAAM,kBAAG,CAAC,SAAS,CAAC,GAAG,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAHD,gCAGC;AAED,SAAgB,UAAU,CAAC,QAAgB;IACzC,kBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC;AAFD,gCAEC;AAEM,KAAK,UAAU,kBAAkB,CAAC,OAAe;IACtD,IAAI;QACF,MAAM,yBAAiB,CAAC,MAAM,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;KAC7D;IAAC,OAAO,KAAK,EAAE;QACd,SAAS;KACV;AACH,CAAC;AAND,gDAMC;AAEM,KAAK,UAAU,eAAe,CAAC,YAAkC;IACtE,IAAI;QACF,MAAM,yBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;KAC9D;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ;KACT;AACH,CAAC;AAND,0CAMC"}
@@ -3,14 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const helper_1 = require("./helper");
4
4
  describe('Verify latest services deployments', () => {
5
5
  it('Should have latest Management API service', async () => {
6
- const response = (await helper_1.managementService.get('/health')).data;
6
+ const response = (await helper_1.managementServiceRoot.get('/health')).data;
7
7
  expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
8
8
  expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
9
9
  });
10
+ it('Should return 200 for Management API docs', async () => {
11
+ const req = await helper_1.managementService.get('/docs');
12
+ expect(req.status).toBe(200);
13
+ expect(req.headers['content-type']).toEqual('text/html; charset=utf-8');
14
+ });
15
+ it('Should return 200 for Management API docs.json', async () => {
16
+ const req = await helper_1.managementService.get('/docs.json');
17
+ expect(req.status).toBe(200);
18
+ expect(req.headers['content-type']).toEqual('application/json; charset=UTF-8');
19
+ });
10
20
  it('Should have latest Render Runtime service', async () => {
11
21
  const response = (await helper_1.renderService.get('/health')).data;
12
22
  expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
13
23
  expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
14
24
  });
25
+ it('Should return 200 for Render Runtime API docs', async () => {
26
+ const req = await helper_1.renderService.get('/docs');
27
+ expect(req.status).toBe(200);
28
+ expect(req.headers['content-type']).toEqual('text/html; charset=utf-8');
29
+ });
30
+ it('Should return 200 for Render Runtime API docs.json', async () => {
31
+ const req = await helper_1.renderService.get('/docs.json');
32
+ expect(req.status).toBe(200);
33
+ expect(req.headers['content-type']).toEqual('application/json; charset=UTF-8');
34
+ });
15
35
  });
16
36
  //# sourceMappingURL=service-deployment.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-deployment.spec.js","sourceRoot":"","sources":["../../src/integration-tests/service-deployment.spec.ts"],"names":[],"mappings":";;AAAA,qCAA6F;AAQ7F,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,0BAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3E,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,uBAAc,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,sBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,MAA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