From aefbe36822bec77b396b38d9b745008d22186db0 Mon Sep 17 00:00:00 2001 From: gilbysunil14 Date: Tue, 14 Jan 2025 12:29:48 +0530 Subject: [PATCH 1/2] start in container test enable in linux --- src/test/GradleTestDevModeActions.ts | 62 ++++++++++++++-------------- src/test/MavenTestDevModeActions.ts | 62 ++++++++++++++-------------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/test/GradleTestDevModeActions.ts b/src/test/GradleTestDevModeActions.ts index 55994e41..e4d9c81f 100755 --- a/src/test/GradleTestDevModeActions.ts +++ b/src/test/GradleTestDevModeActions.ts @@ -64,6 +64,37 @@ it('Start gradle project from liberty dashboard', async () => { expect (serverStartStatus).to.be.true; +}).timeout(350000); + +it('start gradle with docker from liberty dashboard', async () => { + + if((process.platform === 'darwin' ) || (process.platform === 'win32')) + { + //skip running for platforms , enable them for linux after resolving docker setup in GHA + return true; + } + + + await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITHDOCKER, constants.START_DASHBOARD_MAC_ACTION_WITHDOCKER); + await utils.delay(60000); + const serverStartStatus = await utils.checkTerminalforServerState(constants.SERVER_START_STRING); + if(!serverStartStatus) + console.log("Server started message not found in the terminal"); + else + { + console.log("Server succuessfully started"); + await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); + const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); + if(!serverStopStatus){ + console.error("Server stopped message not found in the terminal"); + } + else + console.log("Server stopped successfully"); + expect (serverStopStatus).to.be.true; +} + expect (serverStartStatus).to.be.true; + + }).timeout(350000); it('Run tests for gradle project', async () => { @@ -217,37 +248,6 @@ it('attach debugger for gradle with custom parameter event', async () => { expect(attachStatus).to.be.true; }).timeout(550000); -it('start gradle with docker from liberty dashboard', async () => { - - if((process.platform === 'darwin' ) || (process.platform === 'win32') || (process.platform == 'linux')) - { - //skip running for platforms , enable them for linux after resolving docker setup in GHA - return true; - } - - - await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITHDOCKER, constants.START_DASHBOARD_MAC_ACTION_WITHDOCKER); - await utils.delay(60000); - const serverStartStatus = await utils.checkTerminalforServerState(constants.SERVER_START_STRING); - if(!serverStartStatus) - console.log("Server started message not found in the terminal"); - else - { - console.log("Server succuessfully started"); - await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); - const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); - if(!serverStopStatus){ - console.error("Server stopped message not found in the terminal"); - } - else - console.log("Server stopped successfully"); - expect (serverStopStatus).to.be.true; -} - expect (serverStartStatus).to.be.true; - - -}).timeout(350000); - it('View test report for gradle project', async () => { if((process.platform === 'darwin' ) || (process.platform === 'win32') || (process.platform == 'linux')) diff --git a/src/test/MavenTestDevModeActions.ts b/src/test/MavenTestDevModeActions.ts index 967a0210..4cc202e7 100755 --- a/src/test/MavenTestDevModeActions.ts +++ b/src/test/MavenTestDevModeActions.ts @@ -67,6 +67,37 @@ it('Start maven project from liberty dashboard', async () => { }).timeout(550000); +it('start maven with docker from liberty dashboard', async () => { + + if((process.platform === 'darwin' ) || (process.platform === 'win32')) + { + //skip running for platforms , enable them for linux after resolving docker setup in GHA + return true; + } + + + await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITHDOCKER, constants.START_DASHBOARD_MAC_ACTION_WITHDOCKER); + await utils.delay(60000); + const serverStartStatus = await utils.checkTerminalforServerState(constants.SERVER_START_STRING); + if(!serverStartStatus) + console.log("Server started message not found in the terminal"); + else + { + console.log("Server succuessfully started"); + await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); + const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); + if(!serverStopStatus){ + console.error("Server stopped message not found in the terminal"); + } + else + console.log("Server stopped successfully"); + expect (serverStopStatus).to.be.true; +} + expect (serverStartStatus).to.be.true; + + +}).timeout(350000); + it('Run tests for sample maven project', async () => { await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION, constants.START_DASHBOARD_MAC_ACTION); @@ -236,37 +267,6 @@ it('attach debugger for start with custom parameter event', async () => { console.log("good to close test - Attach Debugger for start with custom parameter(-DdebugPort=7777) event"); } expect(attachStatus).to.be.true; -}).timeout(350000); - - it('start maven with docker from liberty dashboard', async () => { - - if((process.platform === 'darwin' ) || (process.platform === 'win32') || (process.platform == 'linux')) - { - //skip running for platforms , enable them for linux after resolving docker setup in GHA - return true; - } - - - await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITHDOCKER, constants.START_DASHBOARD_MAC_ACTION_WITHDOCKER); - await utils.delay(60000); - const serverStartStatus = await utils.checkTerminalforServerState(constants.SERVER_START_STRING); - if(!serverStartStatus) - console.log("Server started message not found in the terminal"); - else - { - console.log("Server succuessfully started"); - await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); - const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); - if(!serverStopStatus){ - console.error("Server stopped message not found in the terminal"); - } - else - console.log("Server stopped successfully"); - expect (serverStopStatus).to.be.true; -} - expect (serverStartStatus).to.be.true; - - }).timeout(350000); From 0deb358161284e3f309b7dc33825b19b58cf3a57 Mon Sep 17 00:00:00 2001 From: gilbysunil14 Date: Wed, 15 Jan 2025 16:27:40 +0530 Subject: [PATCH 2/2] added comment --- src/test/GradleTestDevModeActions.ts | 19 ++++--------------- src/test/MavenTestDevModeActions.ts | 4 ++++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/test/GradleTestDevModeActions.ts b/src/test/GradleTestDevModeActions.ts index e4d9c81f..af3a45d0 100755 --- a/src/test/GradleTestDevModeActions.ts +++ b/src/test/GradleTestDevModeActions.ts @@ -184,21 +184,10 @@ it('start gradle with history from liberty dashboard', async () => { }).timeout(350000); - - - - - - - - - - - - - - - +/** + * All future test cases should be written before the test that attaches the debugger, as this will switch the UI to the debugger view. + * If, for any reason, a test case needs to be written after the debugger test, ensure that the UI is switched back to the explorer view before executing the subsequent tests. + */ it('attach debugger for gradle with custom parameter event', async () => { console.log("start attach debugger"); let isServerRunning: Boolean = true; diff --git a/src/test/MavenTestDevModeActions.ts b/src/test/MavenTestDevModeActions.ts index 4cc202e7..5c1e6541 100755 --- a/src/test/MavenTestDevModeActions.ts +++ b/src/test/MavenTestDevModeActions.ts @@ -219,6 +219,10 @@ it('View Integration test report for maven project', async () => { }).timeout(10000); +/** + * All future test cases should be written before the test that attaches the debugger, as this will switch the UI to the debugger view. + * If, for any reason, a test case needs to be written after the debugger test, ensure that the UI is switched back to the explorer view before executing the subsequent tests. + */ it('attach debugger for start with custom parameter event', async () => { console.log("start attach debugger"); let isServerRunning: Boolean = true;