From eb9a51be552d8598d660c4bb998d1dc0bb5e5ec9 Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Mon, 9 Dec 2024 11:29:26 +0800 Subject: [PATCH] chore: daily development --- .../core/consumer-coverage.service.ts | 2 +- .../services/coverage-map-client.service.ts | 36 ++++++------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/packages/canyon-collect/src/apps/collect/services/core/consumer-coverage.service.ts b/packages/canyon-collect/src/apps/collect/services/core/consumer-coverage.service.ts index e5b35d8d..44ae3804 100644 --- a/packages/canyon-collect/src/apps/collect/services/core/consumer-coverage.service.ts +++ b/packages/canyon-collect/src/apps/collect/services/core/consumer-coverage.service.ts @@ -217,7 +217,7 @@ export class ConsumerCoverageService { }); } } - async pullChangeCode(coverage) {} + // async pullChangeCode(coverage) {} async acquireLock(lockName: string, lockTimeout: number): Promise { const now = new Date(); diff --git a/packages/canyon-collect/src/apps/collect/services/coverage-map-client.service.ts b/packages/canyon-collect/src/apps/collect/services/coverage-map-client.service.ts index 9c68d9d5..3faa4e7a 100755 --- a/packages/canyon-collect/src/apps/collect/services/coverage-map-client.service.ts +++ b/packages/canyon-collect/src/apps/collect/services/coverage-map-client.service.ts @@ -50,36 +50,20 @@ export class CoverageMapClientService { const formatCoverageMap = IstanbulMapMapSchema.parse(formatedCoverage); - const chongzu = resetCoverageDataMap(formatCoverageMap); + const resetCovMap = resetCoverageDataMap(formatCoverageMap); // #region == Step x: 覆盖率回溯,在覆盖率存储之前转换(这里一定要用数据库里的instrumentCwd,因为和map是对应的!!!) - const inithitMapCWanzhen = await remapCoverageWithInstrumentCwd( - chongzu, + const hitObject = await remapCoverageWithInstrumentCwd( + resetCovMap, instrumentCwd, ); const compressedFormatCoverageStr = await compressedData(formatCoverageMap); - const inithitStr = await compressedData( - IstanbulHitMapSchema.parse(inithitMapCWanzhen), - ); + const hit = await compressedData(IstanbulHitMapSchema.parse(hitObject)); - const summary = genSummaryMapByCoverageMap( - // await this.testExcludeService.invoke( - // queueDataToBeConsumed.projectID, - // newCoverage, - // ), - inithitMapCWanzhen, - [], - ); - const sum: any = getSummaryByPath("", summary); - const summaryZstd = await compressedData(summary); - // ****************************************************** - // ****************************************************** - // ****************************************************** - // 准备map数据 - // ****************************************************** - // ****************************************************** - // ****************************************************** + const summaryObject = genSummaryMapByCoverageMap(hitObject, []); + const overallSummary: any = getSummaryByPath("", summaryObject); + const summary = await compressedData(summaryObject); return this.prisma.coverage .create({ @@ -96,10 +80,10 @@ export class CoverageMapClientService { reportID: sha, covType: "all", //map都是all statementsCovered: 0, - statementsTotal: sum.statements.total, + statementsTotal: overallSummary.statements.total, //空bytes - summary: summaryZstd, - hit: inithitStr, + summary: summary, + hit: hit, map: compressedFormatCoverageStr, instrumentCwd: instrumentCwd, id: `${projectID}|${sha}|all`,