Skip to content

Commit

Permalink
[7.2] Only report the mocha tests once, as "Mocha tests" (#395… (#39586)
Browse files Browse the repository at this point in the history
# Conflicts:
#	CONTRIBUTING.md
  • Loading branch information
Spencer authored Jun 25, 2019
1 parent c9e3985 commit 81a1b95
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ To execute both server and browser tests, but skip linting, use `yarn test:quick
yarn test:quick
```

Use `yarn test:server` when you want to run only the server tests.
Use `yarn test:mocha` when you want to run the mocha tests.

```bash
yarn test:server
yarn test:mocha
```

When you'd like to execute individual server-side test files, you can use the command below. Note that this command takes care of configuring Mocha with Babel compilation for you, and you'll be better off avoiding a globally installed `mocha` package. This command is great for development and for quickly identifying bugs.
Expand Down Expand Up @@ -386,7 +386,7 @@ This should work super if you're using the [Kibana plugin generator](https://git
To run the tests for just your particular plugin run the following command from your plugin:

```bash
yarn test:server
yarn test:mocha
yarn test:browser --dev # remove the --dev flag to run them once and close
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"test:ui": "node scripts/functional_tests",
"test:ui:server": "node scripts/functional_tests_server",
"test:ui:runner": "node scripts/functional_test_runner",
"test:server": "grunt test:server",
"test:server": "echo 'use yarn test:mocha instead'; exit 1",
"test:coverage": "grunt test:coverage",
"typespec": "typings-tester --config x-pack/plugins/canvas/public/lib/aeroelastic/tsconfig.json x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts",
"checkLicenses": "node scripts/check_licenses --dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Generated plugins receive a handful of scripts that can be used during developme
Run the browser tests in a real web browser.
- `yarn test:server`
- `yarn test:mocha`
Run the server tests using mocha.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ See the [kibana contributing guide](https://github.com/elastic/kibana/blob/maste
Run the browser tests in a real web browser.
- `yarn test:server`
- `yarn test:mocha`
Run the server tests using mocha.
Expand Down
4 changes: 1 addition & 3 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports = function (grunt) {
]
}),

// used by the test:server task
// used by the test:mocha task
// runs all node.js/server mocha tests
mocha: scriptWithGithubChecks({
title: 'Mocha tests',
Expand Down Expand Up @@ -280,8 +280,6 @@ module.exports = function (grunt) {

verifyDependencyVersions:
gruntTaskWithGithubChecks('Verify dependency versions', 'verifyDependencyVersions'),
test_server:
gruntTaskWithGithubChecks('Server tests', 'test:server'),
test_jest: gruntTaskWithGithubChecks('Jest tests', 'test:jest'),
test_jest_integration:
gruntTaskWithGithubChecks('Jest integration tests', 'test:jest_integration'),
Expand Down
2 changes: 1 addition & 1 deletion tasks/jenkins.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function (grunt) {
'run:licenses',
'run:verifyDependencyVersions',
'run:verifyNotice',
'run:test_server',
'run:mocha',
'run:test_jest',
'run:test_jest_integration',
'run:test_projects',
Expand Down
6 changes: 1 addition & 5 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ module.exports = function (grunt) {
);

grunt.registerTask('test:mocha', ['checkPlugins', 'run:mocha']);
grunt.registerTask('test:server', () => {
grunt.log.writeln('`grunt test:server` is deprecated - use `grunt test:mocha`');
grunt.task.run(['test:mocha']);
});

grunt.registerTask('test:browser', ['checkPlugins', 'run:browserSCSS', 'run:browserTestServer', 'karma:unit']);

Expand All @@ -53,7 +49,7 @@ module.exports = function (grunt) {

grunt.registerTask('test:quick', [
'checkPlugins',
'test:server',
'test:mocha',
'run:functionalTests',
'test:jest',
'test:jest_integration',
Expand Down

0 comments on commit 81a1b95

Please sign in to comment.