From 768a565b5cb634cec9a9ced0371e2356a3a59ebf Mon Sep 17 00:00:00 2001 From: Volha Mardvilka Date: Fri, 9 May 2025 10:53:39 +0000 Subject: [PATCH 1/4] 413636459: (fix) changes to continue pulling status on cancelling the test --- modules/ui/src/app/store/effects.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ui/src/app/store/effects.ts b/modules/ui/src/app/store/effects.ts index 69c86f2bd..1d0209a1a 100644 --- a/modules/ui/src/app/store/effects.ts +++ b/modules/ui/src/app/store/effects.ts @@ -163,7 +163,6 @@ export class AppEffects { return this.actions$.pipe( ofType(AppActions.setIsStopTestrun), switchMap(() => { - this.store.dispatch(stopInterval()); return this.testrunService.stopTestrun().pipe( map(stopped => { if (stopped) { @@ -200,7 +199,10 @@ export class AppEffects { isTestingComplete: this.isTestrunFinished(systemStatus.status), }) ); - if (this.testrunService.testrunInProgress(systemStatus.status)) { + if ( + this.testrunService.testrunInProgress(systemStatus.status) || + systemStatus.status === StatusOfTestrun.Cancelling + ) { this.pullingSystemStatusData(); this.fetchInternetConnection(); } else if ( From 4460bab28196241d944eda549f8eda89f097fbe8 Mon Sep 17 00:00:00 2001 From: Volha Mardvilka Date: Mon, 12 May 2025 09:33:20 +0000 Subject: [PATCH 2/4] 413636459: (fix) remove fetching status after stop test attemp --- modules/ui/src/app/store/effects.spec.ts | 2 -- modules/ui/src/app/store/effects.ts | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/modules/ui/src/app/store/effects.spec.ts b/modules/ui/src/app/store/effects.spec.ts index 7ca894c27..952b9dbf6 100644 --- a/modules/ui/src/app/store/effects.spec.ts +++ b/modules/ui/src/app/store/effects.spec.ts @@ -37,7 +37,6 @@ import { MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE, } from '../mocks/testrun.mock'; import { - fetchSystemStatus, fetchSystemStatusSuccess, setReports, setStatus, @@ -339,7 +338,6 @@ describe('Effects', () => { effects.onStopTestrun$.subscribe(() => { expect(testRunServiceMock.stopTestrun).toHaveBeenCalled(); - expect(dispatchSpy).toHaveBeenCalledWith(fetchSystemStatus()); done(); }); }); diff --git a/modules/ui/src/app/store/effects.ts b/modules/ui/src/app/store/effects.ts index 1d0209a1a..b306cf979 100644 --- a/modules/ui/src/app/store/effects.ts +++ b/modules/ui/src/app/store/effects.ts @@ -38,7 +38,6 @@ import { TestrunStatus, } from '../model/testrun-status'; import { - fetchSystemStatus, fetchSystemStatusSuccess, setIsTestingComplete, setReports, @@ -163,13 +162,7 @@ export class AppEffects { return this.actions$.pipe( ofType(AppActions.setIsStopTestrun), switchMap(() => { - return this.testrunService.stopTestrun().pipe( - map(stopped => { - if (stopped) { - this.store.dispatch(fetchSystemStatus()); - } - }) - ); + return this.testrunService.stopTestrun(); }) ); }, From 116494e9286d602445a667957059fde4c9e4babc Mon Sep 17 00:00:00 2001 From: Volha Mardvilka Date: Tue, 13 May 2025 07:43:41 +0000 Subject: [PATCH 3/4] 413636459: (fix) use stopping status to continue polling statuses --- modules/ui/src/app/model/testrun-status.ts | 1 + modules/ui/src/app/store/effects.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ui/src/app/model/testrun-status.ts b/modules/ui/src/app/model/testrun-status.ts index a990a2a45..77473aa2b 100644 --- a/modules/ui/src/app/model/testrun-status.ts +++ b/modules/ui/src/app/model/testrun-status.ts @@ -72,6 +72,7 @@ export enum StatusOfTestrun { WaitingForDevice = 'Waiting for Device', Cancelled = 'Cancelled', Cancelling = 'Cancelling', + Stopping = 'Stopping', Failed = 'Failed', CompliantLimited = 'Compliant (Limited)', CompliantHigh = 'Compliant (High)', diff --git a/modules/ui/src/app/store/effects.ts b/modules/ui/src/app/store/effects.ts index b306cf979..9c682172a 100644 --- a/modules/ui/src/app/store/effects.ts +++ b/modules/ui/src/app/store/effects.ts @@ -194,7 +194,7 @@ export class AppEffects { ); if ( this.testrunService.testrunInProgress(systemStatus.status) || - systemStatus.status === StatusOfTestrun.Cancelling + systemStatus.status === StatusOfTestrun.Stopping ) { this.pullingSystemStatusData(); this.fetchInternetConnection(); From 3d9f7469e959b6c4aec938c9d71052591eb682cb Mon Sep 17 00:00:00 2001 From: Volha Mardvilka Date: Tue, 13 May 2025 11:07:49 +0000 Subject: [PATCH 4/4] 413636459: (fix) changes for stopping status to display as cancelling in ui --- .../testrun-status-card.component.html | 4 ++++ .../testrun-status-card.component.spec.ts | 1 + .../testrun-status-card/testrun-status-card.component.ts | 8 +++++++- modules/ui/src/app/pages/testrun/testrun.component.html | 4 +++- modules/ui/src/app/store/effects.ts | 3 ++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html index a459e1744..2ba1a0664 100644 --- a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html +++ b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html @@ -66,6 +66,10 @@ *ngSwitchCase="StatusOfTestrun.Cancelling" [ngTemplateOutlet]="Cancelling"> + + { StatusOfTestrun.WaitingForDevice, StatusOfTestrun.Monitoring, StatusOfTestrun.Cancelling, + StatusOfTestrun.Stopping, ]; const statusesForCompletedSuccessClass = [ diff --git a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts index 6c8055c86..a3458244e 100644 --- a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts @@ -70,7 +70,9 @@ export class TestrunStatusCardComponent { } { return { progress: - this.isProgressStatus(status) || status === StatusOfTestrun.Cancelling, + this.isProgressStatus(status) || + status === StatusOfTestrun.Cancelling || + status === StatusOfTestrun.Stopping, 'completed-success': (result === ResultOfTestrun.Compliant && status === StatusOfTestrun.Complete) || @@ -92,6 +94,7 @@ export class TestrunStatusCardComponent { data.status === StatusOfTestrun.InProgress || data.status === StatusOfTestrun.Cancelled || data.status === StatusOfTestrun.Cancelling || + data.status === StatusOfTestrun.Stopping || data.finished ) { if ( @@ -126,6 +129,9 @@ export class TestrunStatusCardComponent { ) { return data.result!; } + if (data.status === StatusOfTestrun.Stopping) { + return StatusOfTestrun.Cancelling; + } return data.status; } diff --git a/modules/ui/src/app/pages/testrun/testrun.component.html b/modules/ui/src/app/pages/testrun/testrun.component.html index f55fee725..f9b95f948 100644 --- a/modules/ui/src/app/pages/testrun/testrun.component.html +++ b/modules/ui/src/app/pages/testrun/testrun.component.html @@ -20,6 +20,7 @@ isTestrunInProgress(data.status) || data.status === StatusOfTestrun.Cancelled || data.status === StatusOfTestrun.Cancelling || + data.status === StatusOfTestrun.Stopping || data.finished "> @@ -115,7 +116,8 @@ hasDevices === false || isAllDevicesOutdated === true || isTestrunInProgress(systemStatus?.status) || - systemStatus?.status === StatusOfTestrun.Cancelling + systemStatus?.status === StatusOfTestrun.Cancelling || + systemStatus?.status === StatusOfTestrun.Stopping " (click)="openTestRunModal(vm.testModules)" mat-flat-button> diff --git a/modules/ui/src/app/store/effects.ts b/modules/ui/src/app/store/effects.ts index 9c682172a..278cc1bb0 100644 --- a/modules/ui/src/app/store/effects.ts +++ b/modules/ui/src/app/store/effects.ts @@ -136,7 +136,8 @@ export class AppEffects { map(({ systemStatus }) => { const isInProgressDevice = this.testrunService.testrunInProgress(systemStatus?.status) || - systemStatus.status === StatusOfTestrun.Cancelling; + systemStatus.status === StatusOfTestrun.Cancelling || + systemStatus.status === StatusOfTestrun.Stopping; return AppActions.setDeviceInProgress({ device: isInProgressDevice ? systemStatus.device : null, });