Skip to content

Commit 464f907

Browse files
authored
Code coverage: skip failing tests for coverage run (#59121)
* filter out failing tests * more skipped tests * fix tests * move json files to save space
1 parent 02f89f0 commit 464f907

File tree

9 files changed

+66
-8
lines changed

9 files changed

+66
-8
lines changed

test/functional/apps/management/_scripted_fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function({ getService, getPageObjects }) {
5353
]);
5454

5555
describe('scripted fields', function() {
56-
this.tags(['skipFirefox']);
56+
this.tags(['skipFirefox', 'skipCoverage']);
5757

5858
before(async function() {
5959
await browser.setWindowSize(1200, 800);

test/functional/apps/visualize/_tile_map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default function({ getService, getPageObjects }) {
5858
});
5959

6060
describe('complete config', function describeIndexTests() {
61+
this.tags(['skipCoverage']);
6162
before(async function() {
6263
await browser.setWindowSize(1280, 1000);
6364

test/functional/config.coverage.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export default async function({ readConfigFile }) {
21+
const defaultConfig = await readConfigFile(require.resolve('./config'));
22+
23+
return {
24+
...defaultConfig.getAll(),
25+
26+
suiteTags: {
27+
exclude: ['skipCoverage'],
28+
},
29+
30+
junit: {
31+
reportName: 'Code Coverage for Functional Tests',
32+
},
33+
};
34+
}

test/scripts/jenkins_ci_group.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ else
2121
cd "kibana${CI_GROUP}"
2222

2323
echo " -> running tests from the clone folder"
24-
yarn run grunt "run:functionalTests_ciGroup${CI_GROUP}";
24+
#yarn run grunt "run:functionalTests_ciGroup${CI_GROUP}";
25+
node scripts/functional_tests --debug --include-tag "ciGroup$CI_GROUP" --config test/functional/config.coverage.js;
2526

2627
if [[ -d target/kibana-coverage/functional ]]; then
2728
echo " -> replacing kibana${CI_GROUP} with kibana in json files"
2829
sed -i "s|kibana${CI_GROUP}|kibana|g" target/kibana-coverage/functional/*.json
2930
echo " -> copying coverage to the original folder"
3031
mkdir -p ../kibana/target/kibana-coverage/functional
31-
cp -R target/kibana-coverage/functional/. ../kibana/target/kibana-coverage/functional/
32+
mv target/kibana-coverage/functional/* ../kibana/target/kibana-coverage/functional/
3233
fi
3334
fi

test/scripts/jenkins_xpack_ci_group.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ else
2323
cd "kibana${CI_GROUP}/x-pack"
2424

2525
echo " -> running tests from the clone folder"
26-
node scripts/functional_tests --debug --include-tag "ciGroup$CI_GROUP"
26+
node scripts/functional_tests --debug --include-tag "ciGroup$CI_GROUP" --config test/functional/config.coverage.js;
2727

2828
if [[ -d ../target/kibana-coverage/functional ]]; then
2929
echo " -> replacing kibana${CI_GROUP} with kibana in json files"
3030
sed -i "s|kibana${CI_GROUP}|kibana|g" ../target/kibana-coverage/functional/*.json
3131
echo " -> copying coverage to the original folder"
3232
mkdir -p ../../kibana/target/kibana-coverage/functional
33-
cp -R ../target/kibana-coverage/functional/. ../../kibana/target/kibana-coverage/functional/
33+
mv ../target/kibana-coverage/functional/* ../../kibana/target/kibana-coverage/functional/
3434
fi
3535
fi

x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
5757
});
5858
});
5959

60-
describe('space with Advanced Settings disabled', () => {
60+
describe('space with Advanced Settings disabled', function() {
61+
this.tags('skipCoverage');
6162
before(async () => {
6263
// we need to load the following in every situation as deleting
6364
// a space deletes all of the associated saved objects

x-pack/test/functional/apps/dev_tools/feature_controls/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
77

88
export default function({ loadTestFile }: FtrProviderContext) {
99
describe('feature controls', function() {
10-
this.tags('skipFirefox');
10+
this.tags(['skipFirefox', 'skipCoverage']);
1111
loadTestFile(require.resolve('./dev_tools_security'));
1212
loadTestFile(require.resolve('./dev_tools_spaces'));
1313
});

x-pack/test/functional/apps/visualize/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
88

99
export default function visualize({ loadTestFile }: FtrProviderContext) {
1010
describe('Visualize', function visualizeTestSuite() {
11-
this.tags(['ciGroup4', 'skipFirefox']);
11+
this.tags(['ciGroup4', 'skipFirefox', 'skipCoverage']);
1212

1313
loadTestFile(require.resolve('./feature_controls/visualize_security'));
1414
loadTestFile(require.resolve('./feature_controls/visualize_spaces'));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export default async function({ readConfigFile }) {
8+
const chromeConfig = await readConfigFile(require.resolve('./config'));
9+
10+
return {
11+
...chromeConfig.getAll(),
12+
13+
suiteTags: {
14+
exclude: ['skipCoverage'],
15+
},
16+
17+
junit: {
18+
reportName: 'Code Coverage for Functional Tests',
19+
},
20+
};
21+
}

0 commit comments

Comments
 (0)