Skip to content
Snippets Groups Projects
Unverified Commit 7e16fb90 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

ci: start to run reporters on every single pr and add run number (#29976)

parent 8602d32e
No related branches found
No related tags found
No related merge requests found
......@@ -203,7 +203,8 @@ jobs:
IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }}
REPORTER_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_ROCKETCHAT_API_KEY }}
REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }}
REPORTER_ROCKETCHAT_REPORT: ${{ github.ref == 'refs/heads/develop' && 'true' || '' }}
REPORTER_ROCKETCHAT_REPORT: ${{ github.event.pull_request.draft != 'true' && 'true' || '' }}
REPORTER_ROCKETCHAT_RUN: ${{ github.run_number }}
REPORTER_ROCKETCHAT_BRANCH: ${{ github.ref }}
REPORTER_ROCKETCHAT_DRAFT: ${{ github.event.pull_request.draft }}
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
......
......@@ -27,6 +27,7 @@ export default {
url: process.env.REPORTER_ROCKETCHAT_URL,
apiKey: process.env.REPORTER_ROCKETCHAT_API_KEY,
branch: process.env.REPORTER_ROCKETCHAT_BRANCH,
run: Number(process.env.REPORTER_ROCKETCHAT_RUN),
draft: process.env.REPORTER_ROCKETCHAT_DRAFT === 'true',
},
],
......
......@@ -10,11 +10,14 @@ class RocketChatReporter implements Reporter {
private draft: boolean;
constructor(options: { url: string; apiKey: string; branch: string; draft: boolean }) {
private run: number;
constructor(options: { url: string; apiKey: string; branch: string; draft: boolean; run: number }) {
this.url = options.url;
this.apiKey = options.apiKey;
this.branch = options.branch;
this.draft = options.draft;
this.run = options.run;
}
onTestEnd(test: TestCase, result: TestResult) {
......@@ -31,6 +34,7 @@ class RocketChatReporter implements Reporter {
duration: result.duration,
branch: this.branch,
draft: this.draft,
run: this.run,
};
console.log(`Sending test result to Rocket.Chat: ${JSON.stringify(payload)}`);
return fetch(this.url, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment