diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f2f5700f938c6e498e23ce173a31e3216f7eec1..fe592d8140f0e311f784b2c825a634b19e2129d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ ci_frontend: artifacts: paths: - ci_frontend.log + when: always ci_backend: stage: ci script: @@ -20,6 +21,7 @@ ci_backend: artifacts: paths: - ci_backend.log + when: always coverage: stage: coverage script: @@ -28,4 +30,5 @@ coverage: artifacts: paths: - coverage.log + when: always coverage: '/Statements.*?(\d+(?:\.\d+)?)%/' diff --git a/mc_frontend/src/app/corpus.service.spec.ts b/mc_frontend/src/app/corpus.service.spec.ts index 02829f9a05b4b301b3c52be7032e593fd57dd379..84258b8a9a519d14afc97f521068e50258821a76 100644 --- a/mc_frontend/src/app/corpus.service.spec.ts +++ b/mc_frontend/src/app/corpus.service.spec.ts @@ -23,6 +23,7 @@ import {TextRange} from './models/textRange'; import Spy = jasmine.Spy; import {AnnisResponse, NodeMC} from '../../openapi'; import {Phenomenon} from '../../openapi'; +import {Subscription} from 'rxjs'; describe('CorpusService', () => { let httpClient: HttpClient; @@ -251,12 +252,17 @@ describe('CorpusService', () => { it('should initialize the current corpus', fakeAsync(() => { helperService.applicationState.next(new ApplicationState()); let corpus: CorpusMC = {source_urn: ''}; + const subscriptions: Subscription[] = []; function initCorpus(): void { + subscriptions.forEach((sub: Subscription, idx: number, subList: Subscription[]) => { + sub.unsubscribe(); + delete subList[idx]; + }); corpusService.initCurrentCorpus().then(() => { - corpusService.currentCorpus.subscribe((cc: CorpusMC) => { + subscriptions.push(corpusService.currentCorpus.subscribe((cc: CorpusMC) => { corpus = cc; - }); + })); }); flushMicrotasks(); } diff --git a/mc_frontend/src/app/models/mockMC.ts b/mc_frontend/src/app/models/mockMC.ts index ab460d2a81c2a4b2af3027fd147f6f775bd6a9f8..5cd839bca6119e78217022b49cc6b1b9a32f8171 100644 --- a/mc_frontend/src/app/models/mockMC.ts +++ b/mc_frontend/src/app/models/mockMC.ts @@ -29,7 +29,7 @@ export default class MockMC { }; static applicationState: ApplicationState = new ApplicationState({ currentSetup: new TextData({ - currentCorpus: {citations: {}, source_urn: ''}, + currentCorpus: {citations: {}, source_urn: 'exampleUrn'}, currentTextRange: new TextRange({start: ['1', '2'], end: ['1', '2']}) }), mostRecentSetup: new TextData({