Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/report-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ stored in [AWS Timestream], please see [Storage Schema].
},
"name": "<Non-empty string matching pattern '^(?!\\s).+(?<!\\s)$>'",
"status": "<Must be 'passed', 'skipped' or 'failed'>",
"codeowners": "<Array of non-empty strings from CODEOWNERS file, optional>",
"github": {
"codeowners": "<Array of non-empty strings starting with @ from CODEOWNERS file, optional>"
},
"retries": "<Positive integer, can be 0>",
"timeout": "<Positive integer representing milliseconds, can be 0, optional>",
"browser": "<Can be 'chromium', 'chrome', 'firefox', 'webkit', 'safari' or 'edge', optional>",
Expand Down
19 changes: 12 additions & 7 deletions schemas/report/v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,17 @@
"type": "integer",
"minimum": 0
},
"codeowners": {
"type": "array",
"items": {
"$ref": "#/$defs/codeownerString"
},
"minItems": 1
"github": {
"type": "object",
"properties": {
"codeowners": {
"type": "array",
"items": {
"$ref": "#/$defs/githubCodeownerString"
},
"minItems": 1
}
}
}
},
"required": [
Expand Down Expand Up @@ -227,7 +232,7 @@
"pattern": "should be non-empty without leading or trailing whitespace"
}
},
"codeownerString": {
"githubCodeownerString": {
"allOf": [
{
"$ref": "#/$defs/nonEmptyUnpaddedString"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/report-builder.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class ReportDetailBuilder extends ReportBuilderBase {
const owners = this._codeowners.getOwner(filePath);

if (owners.length > 0) {
this._setProperty('codeowners', owners, options);
this._setNestedProperty('github', 'codeowners', owners, options);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/report.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const upgradeReportV1ToV2 = (report) => {
const owners = codeowners.getOwner(location);

if (owners.length > 0) {
upgraded.codeowners = owners;
upgraded.github = { codeowners: owners };
}
}

Expand Down
20 changes: 10 additions & 10 deletions test/integration/data/validation/test-report-mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const testReportV2Partial = {
details: [{
name: 'reporter 1 > passed',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-1.test.js' },
timeout: 2000,
tool: 'Mocha 1 Test Reporting',
Expand All @@ -18,7 +18,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 1 > skipped',
status: 'skipped',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-1.test.js' },
timeout: 2000,
tool: 'Mocha 1 Test Reporting',
Expand All @@ -28,7 +28,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 1 > flaky',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-1.test.js' },
timeout: 2000,
tool: 'Mocha 1 Test Reporting',
Expand All @@ -38,7 +38,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 1 > failed',
status: 'failed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-1.test.js' },
timeout: 2000,
tool: 'Mocha 1 Test Reporting',
Expand All @@ -48,7 +48,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 2 > passed',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-2.test.js' },
timeout: 2000,
tool: 'Test Reporting',
Expand All @@ -58,7 +58,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 2 > skipped',
status: 'skipped',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-2.test.js' },
timeout: 2000,
tool: 'Test Reporting',
Expand All @@ -68,7 +68,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 2 > flaky',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-2.test.js' },
timeout: 2000,
tool: 'Test Reporting',
Expand All @@ -78,7 +78,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 2 > failed',
status: 'failed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-2.test.js' },
timeout: 2000,
tool: 'Test Reporting',
Expand All @@ -88,7 +88,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 1 > special/characters "(\\n\\r\\t\\b\\f)"',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-1.test.js' },
timeout: 2000,
tool: 'Mocha 1 Test Reporting',
Expand All @@ -98,7 +98,7 @@ export const testReportV2Partial = {
}, {
name: 'reporter 2 > special/characters "(\\n\\r\\t\\b\\f)"',
status: 'passed',
codeowners: ['@Brightspace/quality-enablement'],
github: { codeowners: ['@Brightspace/quality-enablement'] },
location: { file: 'test/integration/data/tests/mocha/reporter-2.test.js' },
timeout: 2000,
tool: 'Test Reporting',
Expand Down
Loading