[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>
This commit is contained in:
Tyler Smalley 2019-01-08 15:13:12 -08:00 committed by Josh Dover
parent 74c35fbbed
commit ef1e5b4288
7 changed files with 66 additions and 15 deletions

View 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();

View file

@ -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());
}
);
};

View file

@ -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;

View file

@ -1,5 +0,0 @@
#!/usr/bin/env bash
set -e
xvfb-run "$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:report;

View file

@ -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;

View file

@ -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

View file

@ -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