mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
fail the check-run without results
This commit is contained in:
parent
1deff739ec
commit
e4fa9e8b86
2 changed files with 19 additions and 2 deletions
7
dist/index.js
generated
vendored
7
dist/index.js
generated
vendored
|
|
@ -296,7 +296,6 @@ class TestReporter {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (files.length === 0) {
|
if (files.length === 0) {
|
||||||
core.warning(`No file matches path ${this.path}`);
|
core.warning(`No file matches path ${this.path}`);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
core.info(`Processing test results for check run ${name}`);
|
core.info(`Processing test results for check run ${name}`);
|
||||||
const results = [];
|
const results = [];
|
||||||
|
|
@ -327,6 +326,12 @@ class TestReporter {
|
||||||
summary: ''
|
summary: ''
|
||||||
} }, github.context.repo));
|
} }, github.context.repo));
|
||||||
}
|
}
|
||||||
|
if (files.length === 0) {
|
||||||
|
yield this.octokit.rest.checks.update(Object.assign({ check_run_id: check.data.id, status: 'completed', output: {
|
||||||
|
title: name,
|
||||||
|
summary: 'No test result files found'
|
||||||
|
}, conclusion: 'failure' }, github.context.repo));
|
||||||
|
}
|
||||||
core.info('Creating report summary');
|
core.info('Creating report summary');
|
||||||
const { listSuites, listTests, onlySummary } = this;
|
const { listSuites, listTests, onlySummary } = this;
|
||||||
const baseUrl = check.data.html_url || '';
|
const baseUrl = check.data.html_url || '';
|
||||||
|
|
|
||||||
14
src/main.ts
14
src/main.ts
|
|
@ -197,7 +197,6 @@ class TestReporter {
|
||||||
async createReport(parser: TestParser, name: string, files: FileContent[]): Promise<TestRunResultWithUrl | null> {
|
async createReport(parser: TestParser, name: string, files: FileContent[]): Promise<TestRunResultWithUrl | null> {
|
||||||
if (files.length === 0) {
|
if (files.length === 0) {
|
||||||
core.warning(`No file matches path ${this.path}`)
|
core.warning(`No file matches path ${this.path}`)
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Processing test results for check run ${name}`)
|
core.info(`Processing test results for check run ${name}`)
|
||||||
|
|
@ -254,6 +253,19 @@ class TestReporter {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (files.length === 0) {
|
||||||
|
await this.octokit.rest.checks.update({
|
||||||
|
check_run_id: check.data.id,
|
||||||
|
status: 'completed',
|
||||||
|
output: {
|
||||||
|
title: name,
|
||||||
|
summary: 'No test result files found'
|
||||||
|
},
|
||||||
|
conclusion: 'failure',
|
||||||
|
...github.context.repo
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
core.info('Creating report summary')
|
core.info('Creating report summary')
|
||||||
const {listSuites, listTests, onlySummary} = this
|
const {listSuites, listTests, onlySummary} = this
|
||||||
const baseUrl = check.data.html_url || ''
|
const baseUrl = check.data.html_url || ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue