@stryker-mutator/dashboard-data-access 0.17.1-pr-1190.0 → 0.17.1-pr-1190.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/mappers/factories.d.ts +2 -2
- package/dist/src/mappers/factories.js +2 -2
- package/dist/src/models/MutationTestingMetrics.d.ts +4 -4
- package/dist/src/models/MutationTestingMetrics.js +2 -2
- package/dist/src/services/MutationTestingMetricsService.d.ts +8 -0
- package/dist/src/services/MutationTestingMetricsService.js +15 -0
- package/dist/src/services/MutationTestingReportService.js +2 -2
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MutationTestingReport, Project } from '../models/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { MutationTestingMetric } from '../models/MutationTestingMetrics.js';
|
|
3
3
|
import type { Mapper } from './Mapper.js';
|
|
4
4
|
export type MutationTestingReportMapper = Mapper<MutationTestingReport, 'projectName' | 'version', 'moduleName'>;
|
|
5
|
-
export type MutationTestingMetricsMapper = Mapper<
|
|
5
|
+
export type MutationTestingMetricsMapper = Mapper<MutationTestingMetric, 'project', 'version'>;
|
|
6
6
|
export type ProjectMapper = Mapper<Project, 'owner', 'name'>;
|
|
7
7
|
export declare function createMutationTestingReportMapper(): MutationTestingReportMapper;
|
|
8
8
|
export declare function createMutationTestingMetricsMapper(): MutationTestingMetricsMapper;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MutationTestingReport, Project } from '../models/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { MutationTestingMetric } from '../models/MutationTestingMetrics.js';
|
|
3
3
|
import TableStorageMapper from './TableStorageMapper.js';
|
|
4
4
|
export function createMutationTestingReportMapper() {
|
|
5
5
|
return new TableStorageMapper(MutationTestingReport);
|
|
6
6
|
}
|
|
7
7
|
export function createMutationTestingMetricsMapper() {
|
|
8
|
-
return new TableStorageMapper(
|
|
8
|
+
return new TableStorageMapper(MutationTestingMetric);
|
|
9
9
|
}
|
|
10
10
|
export function createProjectMapper() {
|
|
11
11
|
return new TableStorageMapper(Project);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Metrics } from "mutation-testing-metrics";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class MutationTestingMetric implements Metrics {
|
|
3
3
|
project: string;
|
|
4
4
|
version: string | undefined;
|
|
5
5
|
pending: number;
|
|
@@ -21,8 +21,8 @@ export declare class MutationTestingMetrics implements Metrics {
|
|
|
21
21
|
constructor(metrics?: Metrics | undefined);
|
|
22
22
|
static readonly persistedFields: readonly ["pending", "killed", "timeout", "survived", "noCoverage", "runtimeErrors", "compileErrors", "ignored", "totalDetected", "totalUndetected", "totalInvalid", "totalValid", "totalMutants", "totalCovered", "mutationScore", "mutationScoreBasedOnCoveredCode"];
|
|
23
23
|
static readonly tableName: string;
|
|
24
|
-
static createRowKey(identifier: Pick<
|
|
25
|
-
static createPartitionKey(identifier: Pick<
|
|
26
|
-
static identify(entity: Partial<
|
|
24
|
+
static createRowKey(identifier: Pick<MutationTestingMetric, 'version'>): string | undefined;
|
|
25
|
+
static createPartitionKey(identifier: Pick<MutationTestingMetric, 'project'>): string;
|
|
26
|
+
static identify(entity: Partial<MutationTestingMetric>, partitionKey: string, rowKey: string): void;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=MutationTestingMetrics.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class MutationTestingMetric {
|
|
2
2
|
project; // github.com/stryker-mutator/stryker-dashboard
|
|
3
3
|
version; // feat/implement-metrics
|
|
4
4
|
pending;
|
|
@@ -56,7 +56,7 @@ export class MutationTestingMetrics {
|
|
|
56
56
|
'mutationScore',
|
|
57
57
|
'mutationScoreBasedOnCoveredCode',
|
|
58
58
|
];
|
|
59
|
-
static tableName =
|
|
59
|
+
static tableName = MutationTestingMetric.name;
|
|
60
60
|
static createRowKey(identifier) {
|
|
61
61
|
const nowUtc = new Date().toISOString();
|
|
62
62
|
return identifier.version + nowUtc;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationTestingMetricsMapper } from "../mappers/factories.js";
|
|
2
|
+
import { MutationTestingMetric } from "../models/MutationTestingMetrics.js";
|
|
3
|
+
export declare class MutationTestingMetricsService {
|
|
4
|
+
private readonly mutationMetricsMapper;
|
|
5
|
+
constructor(mutationMetricsMapper?: MutationTestingMetricsMapper);
|
|
6
|
+
getMetrics(project: string): Promise<MutationTestingMetric[]>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=MutationTestingMetricsService.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardQuery } from "../mappers/DashboardQuery.js";
|
|
2
|
+
import { createMutationTestingMetricsMapper } from "../mappers/factories.js";
|
|
3
|
+
import { MutationTestingMetric } from "../models/MutationTestingMetrics.js";
|
|
4
|
+
export class MutationTestingMetricsService {
|
|
5
|
+
mutationMetricsMapper;
|
|
6
|
+
constructor(mutationMetricsMapper = createMutationTestingMetricsMapper()) {
|
|
7
|
+
this.mutationMetricsMapper = mutationMetricsMapper;
|
|
8
|
+
}
|
|
9
|
+
async getMetrics(project) {
|
|
10
|
+
const metricResults = await this.mutationMetricsMapper.findAll(DashboardQuery.create(MutationTestingMetric)
|
|
11
|
+
.wherePartitionKeyEquals({ project }));
|
|
12
|
+
return metricResults.map((metricResult) => metricResult.model);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=MutationTestingMetricsService.js.map
|
|
@@ -4,7 +4,7 @@ import { OptimisticConcurrencyError } from '../errors/index.js';
|
|
|
4
4
|
import { createMutationTestingMetricsMapper, createMutationTestingReportMapper, DashboardQuery } from '../mappers/index.js';
|
|
5
5
|
import { MutationTestingResultMapper } from '../mappers/MutationTestingResultMapper.js';
|
|
6
6
|
import { MutationTestingReport } from '../models/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { MutationTestingMetric } from '../models/MutationTestingMetrics.js';
|
|
8
8
|
function moduleHasResult(tuple) {
|
|
9
9
|
return !!tuple[1];
|
|
10
10
|
}
|
|
@@ -35,7 +35,7 @@ export class MutationTestingReportService {
|
|
|
35
35
|
await this.aggregateProjectReport(id.projectName, id.version, logger);
|
|
36
36
|
}
|
|
37
37
|
if (metrics) {
|
|
38
|
-
const dataMetricslol = new
|
|
38
|
+
const dataMetricslol = new MutationTestingMetric(metrics);
|
|
39
39
|
dataMetricslol.project = id.projectName;
|
|
40
40
|
dataMetricslol.version = id.version;
|
|
41
41
|
console.log(dataMetricslol);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryker-mutator/dashboard-data-access",
|
|
3
|
-
"version": "0.17.1-pr-1190.
|
|
3
|
+
"version": "0.17.1-pr-1190.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "This package contains the data access layer of the stryker dashboard application.",
|
|
6
6
|
"scripts": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@azure/data-tables": "13.3.0",
|
|
26
26
|
"@azure/storage-blob": "12.26.0",
|
|
27
|
-
"@stryker-mutator/dashboard-common": "0.17.1-pr-1190.
|
|
27
|
+
"@stryker-mutator/dashboard-common": "0.17.1-pr-1190.1",
|
|
28
28
|
"mutation-testing-metrics": "3.3.0",
|
|
29
29
|
"mutation-testing-report-schema": "3.3.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "825ac439343377462fbfa0169427fda81ecc5562"
|
|
32
32
|
}
|