diff --git a/tools/build/tests/_data/meta/che-theia-meta.yaml b/tools/build/tests/_data/meta/che-theia-meta.yaml index f9a95875ed..67aed839df 100644 --- a/tools/build/tests/_data/meta/che-theia-meta.yaml +++ b/tools/build/tests/_data/meta/che-theia-meta.yaml @@ -124,3 +124,16 @@ spec: - name: remote-endpoint mountPath: /remote-endpoint ephemeral: true + events: + preStart: + - init-container-command + postStart: + - init-editor-command + commands: + - id: init-container-command + apply: + component: remote-runtime-injector + - id: init-editor-command + exec: + component: editor-runtime-description + commandLine: 'entrypoint-volume.sh' diff --git a/tools/build/tests/devfile/meta-yaml-to-devfile-yaml.spec.ts b/tools/build/tests/devfile/meta-yaml-to-devfile-yaml.spec.ts index fcd8747093..898412cc9e 100644 --- a/tools/build/tests/devfile/meta-yaml-to-devfile-yaml.spec.ts +++ b/tools/build/tests/devfile/meta-yaml-to-devfile-yaml.spec.ts @@ -116,16 +116,28 @@ describe('Test MetaYamlToDevfileYaml', () => { expect(remoteEndpointVolumeComponent.volume.ephemeral).toBeTruthy(); expect(devfileYaml.commands).toBeDefined(); - expect(devfileYaml.commands?.length).toBe(1); + expect(devfileYaml.commands?.length).toBe(2); + const devfileFirstCommand = devfileYaml.commands[0]; expect(devfileFirstCommand.id).toBe('init-container-command'); expect(devfileFirstCommand.apply).toStrictEqual({ component: 'remote-runtime-injector' }); + const devfileSecondCommand = devfileYaml.commands[1]; + expect(devfileSecondCommand.id).toBe('init-editor-command'); + expect(devfileSecondCommand.exec).toStrictEqual({ + component: 'editor-runtime-description', + commandLine: 'entrypoint-volume.sh', + }); + expect(devfileYaml.events).toBeDefined(); expect(devfileYaml.events.preStart).toBeDefined(); expect(devfileYaml.events?.preStart?.length).toBe(1); const preStartFirstEvent = devfileYaml.events.preStart[0]; expect(preStartFirstEvent).toBe('init-container-command'); + + const postStartEvent = devfileYaml.events.postStart; + expect(postStartEvent).toBeDefined(); + expect(postStartEvent[0]).toBe('init-editor-command'); }); test('che-theia with multiple volumes which have identical name', async () => {