From 3790550ffca75371dacf63242d9bb3b04647521a Mon Sep 17 00:00:00 2001 From: Christina Ying Wang Date: Tue, 5 Dec 2023 11:23:09 -0800 Subject: [PATCH] WIP --- .../compose/application-manager.spec.ts | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/integration/compose/application-manager.spec.ts b/test/integration/compose/application-manager.spec.ts index 7683a004..48b05304 100644 --- a/test/integration/compose/application-manager.spec.ts +++ b/test/integration/compose/application-manager.spec.ts @@ -661,6 +661,57 @@ describe('compose/application-manager', () => { ).to.have.lengthOf(1); }); + it('should test', async () => { + const targetApps = createApps( + { + services: [ + await createService({ + image: 'image-one', + serviceName: 'one', + commit: 'new-release', + }), + await createService({ + image: 'image-new', + serviceName: 'new', + commit: 'new-release', + }), + ], + networks: [DEFAULT_NETWORK], + }, + true, + ); + const { currentApps, availableImages, downloading, containerIdsByAppId } = + createCurrentState({ + services: [ + await createService({ + image: 'image-one', + serviceName: 'one', + commit: 'old-release', + }), + ], + networks: [DEFAULT_NETWORK], + images: [ + createImage({ + name: 'image-one', + serviceName: 'one', + commit: 'old-release', + }), + ], + }); + + const steps = await applicationManager.inferNextSteps( + currentApps, + targetApps, + { + downloading, + availableImages, + containerIdsByAppId, + }, + ); + + console.log({ steps }); + }); + it('should not remove an app volumes when they are no longer referenced', async () => { const targetApps = createApps({ networks: [DEFAULT_NETWORK] }, true); const { currentApps, availableImages, downloading, containerIdsByAppId } =