Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter integration tests from npm command #7768

Merged
merged 5 commits into from
Jul 19, 2016
Merged

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Jul 19, 2016

This lets you npm run test:ui -- --grep=foo instead of running the intern bin directly. I didn't add functionalSuites because it needs the main index file for babel transpilation now.

edit: added functionalSuites for api tests, and an 'apps' filter too.

Using grep alone will not prevent the before block of every test from running, so it can be useful to filter by suite. Currently, filtering tests by suite doesn't work because tests are all loaded together, ran through babel, and then passed in as one suite. This allows us to filter test runs by application.

Usage:

npm run test:ui -- --appSuites=management,status

and with grep:

npm run test:ui -- --appSuites=management --grep=initial\ state
...snip
>> 0/23 tests failed (18 skipped)

An alternative is to split tests back out into individual suites and run each suite through babel, but that adds some boilerplate to each test.

@MaineC MaineC added the WIP Work in progress label Jul 19, 2016
@LeeDr
Copy link

LeeDr commented Jul 19, 2016

The problem with using grep to run specific tests is that it still runs the before, beforeEach, after, and afterEach methods of every test. While this cuts some time off running without the grep, it's not really a good solution.
That's not to say we shouldn't do this PR. Only saying that we still don't have a decent solution for running individual test suites.

Naming wise, I'm referring to the 'visualize app tests' vs. the 'area chart test suite' which contains several tests as an example. We should be able to run one suite, but not individual tests within a suite because they are not all atomic (it would be too slow to get through the tests if they were).

@jbudz jbudz changed the title [tests] Pass grep option to grunt intern Filter integration tests from npm command Jul 19, 2016
@jbudz jbudz removed the WIP Work in progress label Jul 19, 2016
@LeeDr
Copy link

LeeDr commented Jul 19, 2016

LGTM

@LeeDr LeeDr merged commit d5dde76 into elastic:master Jul 19, 2016
@Bargs
Copy link
Contributor

Bargs commented Jul 20, 2016

Awesome 💯

@scampi
Copy link
Contributor

scampi commented Jul 20, 2016

thanks @jbudz this will help greatly!

@epixa epixa added v5.0.0 and removed v5.0.0 labels Aug 1, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Filter integration tests from npm command

Former-commit-id: d5dde76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants