mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [ci] Use trap to generate report for non-PR build (#26829) Since this is no longer part of a reporting task in Jenkins, we no longer need to re-run kbn bootstrap when generating a report. We use the PR_SOURCE_BRANCH environment variable to prevent genererating Github issues when we are on a PR. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> * Fix report test failures done callback (#28348)
This commit is contained in:
parent
078b54b7cf
commit
94c4eb2b33
8 changed files with 68 additions and 17 deletions
22
src/dev/failed_tests/cli.js
Normal file
22
src/dev/failed_tests/cli.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
require('../../setup_node_env');
|
||||
require('./report').reportFailedTests();
|
|
@ -133,7 +133,7 @@ const updateGithubIssues = (githubClient, issues) => {
|
|||
/**
|
||||
* Scans all junit XML files in ./target/junit/ and reports any found test failures to Github Issues.
|
||||
*/
|
||||
export async function reportFailedTests(done) {
|
||||
export async function reportFailedTests() {
|
||||
const githubClient = getGithubClient();
|
||||
const issues = await paginate(githubClient, githubClient.issues.getForRepo({
|
||||
owner: GITHUB_OWNER,
|
||||
|
@ -148,5 +148,5 @@ export async function reportFailedTests(done) {
|
|||
.pipe(mapXml)
|
||||
.pipe(filterFailures)
|
||||
.pipe(updateGithubIssues(githubClient, issues))
|
||||
.on('done', done);
|
||||
.on('done', () => console.log(`Finished reporting test failures.`));
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { reportFailedTests } from '../src/dev/failed_tests/report';
|
||||
|
||||
module.exports = function (grunt) {
|
||||
grunt.registerTask('jenkins:docs', [
|
||||
'docker:docs'
|
||||
|
@ -41,12 +39,4 @@ module.exports = function (grunt) {
|
|||
'test:browser-ci',
|
||||
'run:apiIntegrationTests',
|
||||
]);
|
||||
|
||||
grunt.registerTask(
|
||||
'jenkins:report',
|
||||
'Reports failed tests found in junit xml files to Github issues',
|
||||
function () {
|
||||
reportFailedTests(this.async());
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
|
||||
set -e
|
||||
|
||||
function report {
|
||||
if [[ -z "$PR_SOURCE_BRANCH" ]]; then
|
||||
node src/dev/failed_tests/cli
|
||||
else
|
||||
echo "Failure issues not created on pull requests"
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
trap report EXIT
|
||||
|
||||
source src/dev/ci_setup/checkout_sibling_es.sh
|
||||
|
||||
"$(FORCE_COLOR=0 yarn bin)/grunt" functionalTests:ensureAllTestsInCiGroup;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
xvfb-run "$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:report;
|
|
@ -2,8 +2,19 @@
|
|||
|
||||
set -e
|
||||
|
||||
function report {
|
||||
if [[ -z "$PR_SOURCE_BRANCH" ]]; then
|
||||
node src/dev/failed_tests/cli
|
||||
else
|
||||
echo "Failure issues not created on pull requests"
|
||||
fi
|
||||
}
|
||||
|
||||
trap report EXIT
|
||||
|
||||
source src/dev/ci_setup/checkout_sibling_es.sh
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
||||
|
||||
"$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:unit --from=source --dev;
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
|
||||
set -e
|
||||
|
||||
function report {
|
||||
if [[ -z "$PR_SOURCE_BRANCH" ]]; then
|
||||
cd "$KIBANA_DIR"
|
||||
node src/dev/failed_tests/cli
|
||||
else
|
||||
echo "Failure issues not created on pull requests"
|
||||
fi
|
||||
}
|
||||
|
||||
trap report EXIT
|
||||
|
||||
source src/dev/ci_setup/checkout_sibling_es.sh
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
|
||||
set -e
|
||||
|
||||
function report {
|
||||
if [[ -z "$PR_SOURCE_BRANCH" ]]; then
|
||||
cd "$KIBANA_DIR"
|
||||
node src/dev/failed_tests/cli
|
||||
else
|
||||
echo "Failure issues not created on pull requests"
|
||||
fi
|
||||
}
|
||||
|
||||
trap report EXIT
|
||||
|
||||
source src/dev/ci_setup/checkout_sibling_es.sh
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue