mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[CI] [Buildkite] Only report test failures for hourly/daily pipelines (#112729)
This commit is contained in:
parent
7d8d89f50d
commit
e67a25c8b8
2 changed files with 12 additions and 9 deletions
|
@ -1,3 +1,5 @@
|
|||
env:
|
||||
REPORT_FAILED_TESTS_TO_GITHUB: 'true'
|
||||
steps:
|
||||
- command: .buildkite/scripts/lifecycle/pre_build.sh
|
||||
label: Pre-Build
|
||||
|
|
|
@ -37,17 +37,24 @@ export function runFailedTestsReporterCli() {
|
|||
}
|
||||
|
||||
if (updateGithub) {
|
||||
let branch: string | undefined = '';
|
||||
let branch: string = '';
|
||||
let isPr = false;
|
||||
|
||||
if (process.env.BUILDKITE === 'true') {
|
||||
branch = process.env.BUILDKITE_BRANCH;
|
||||
branch = process.env.BUILDKITE_BRANCH || '';
|
||||
isPr = process.env.BUILDKITE_PULL_REQUEST === 'true';
|
||||
updateGithub = process.env.REPORT_FAILED_TESTS_TO_GITHUB === 'true';
|
||||
} else {
|
||||
// JOB_NAME is formatted as `elastic+kibana+7.x` in some places and `elastic+kibana+7.x/JOB=kibana-intake,node=immutable` in others
|
||||
const jobNameSplit = (process.env.JOB_NAME || '').split(/\+|\//);
|
||||
branch = jobNameSplit.length >= 3 ? jobNameSplit[2] : process.env.GIT_BRANCH;
|
||||
branch = jobNameSplit.length >= 3 ? jobNameSplit[2] : process.env.GIT_BRANCH || '';
|
||||
isPr = !!process.env.ghprbPullId;
|
||||
|
||||
const isMasterOrVersion = branch === 'master' || branch.match(/^\d+\.(x|\d+)$/);
|
||||
if (!isMasterOrVersion || isPr) {
|
||||
log.info('Failure issues only created on master/version branch jobs');
|
||||
updateGithub = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!branch) {
|
||||
|
@ -55,12 +62,6 @@ export function runFailedTestsReporterCli() {
|
|||
'Unable to determine originating branch from job name or other environment variables'
|
||||
);
|
||||
}
|
||||
|
||||
const isMasterOrVersion = branch === 'master' || branch.match(/^\d+\.(x|\d+)$/);
|
||||
if (!isMasterOrVersion || isPr) {
|
||||
log.info('Failure issues only created on master/version branch jobs');
|
||||
updateGithub = false;
|
||||
}
|
||||
}
|
||||
|
||||
const githubApi = new GithubApi({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue