From 208b5d2dbe3758c6642bfdb1cc0c5708608d508a Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:02:53 +0300 Subject: [PATCH 1/6] Update angular.yml --- .github/workflows/angular.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 7c09188c4..3dc92d678 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -5,11 +5,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'npm' + - uses: actions/checkout@v3 - name: Install dependencies and run tests working-directory: ui run: | From 29f0225d0d2ab74badce1ba8cfe119a3f75d9b5f Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:36:56 +0300 Subject: [PATCH 2/6] make angular tests run headless --- ui/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/karma.conf.js b/ui/karma.conf.js index adeb7b3b6..82af5020e 100644 --- a/ui/karma.conf.js +++ b/ui/karma.conf.js @@ -37,7 +37,7 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ['ChromeHeadless'], singleRun: false, restartOnFileChange: true }); From 274ed5c97d167cb4e54e0262e890a5d51adfb568 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:37:56 +0300 Subject: [PATCH 3/6] Update angular.yml --- .github/workflows/angular.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 3dc92d678..bb2a97d5b 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -6,8 +6,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install dependencies and run tests + - name: Install dependencies working-directory: ui - run: | - npm i - npm test \ No newline at end of file + run: npm i + - name: Run tests + working-directory: ui + run: npm test \ No newline at end of file From 6d0fc5f727f6c71bec3345f4e6212941663b0414 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 5 Sep 2023 19:19:23 +0300 Subject: [PATCH 4/6] fix test and text config --- ui/karma.conf.js | 2 +- ui/src/app/app.component.spec.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/karma.conf.js b/ui/karma.conf.js index 82af5020e..e4f96d35d 100644 --- a/ui/karma.conf.js +++ b/ui/karma.conf.js @@ -38,7 +38,7 @@ module.exports = function (config) { logLevel: config.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], - singleRun: false, + singleRun: true, restartOnFileChange: true }); }; diff --git a/ui/src/app/app.component.spec.ts b/ui/src/app/app.component.spec.ts index 9d787d782..2c21743bf 100644 --- a/ui/src/app/app.component.spec.ts +++ b/ui/src/app/app.component.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ - RouterTestingModule + RouterTestingModule, + HttpClientTestingModule ], declarations: [ AppComponent From 788a5b14d07a5865ec037ca74d0f5ca05065aedb Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:50:11 +0300 Subject: [PATCH 5/6] add caching --- .github/workflows/angular.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index bb2a97d5b..16a72c20a 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -1,4 +1,4 @@ -name: Angular CI +name: Angular Unit Tests on: workflow_dispatch: jobs: @@ -6,9 +6,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' - name: Install dependencies working-directory: ui - run: npm i + run: npm ci - name: Run tests working-directory: ui run: npm test \ No newline at end of file From 20304650268044d0ed0cfac73ccd9b39edd370c4 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:56:40 +0300 Subject: [PATCH 6/6] add cache dependency path --- .github/workflows/angular.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 16a72c20a..3e20ba100 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -10,6 +10,7 @@ jobs: with: node-version: 18 cache: 'npm' + cache-dependency-path: 'ui/package-lock.json' - name: Install dependencies working-directory: ui run: npm ci