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

APM-specific Jest configuration #67858

Merged
merged 2 commits into from
Jun 2, 2020
Merged

APM-specific Jest configuration #67858

merged 2 commits into from
Jun 2, 2020

Conversation

smith
Copy link
Contributor

@smith smith commented Jun 1, 2020

Update the x-pack createJestConfig function to take the rootDir as an argument, which allows for easier overriding of the Jest configuration for a specific directory.

Previously we would run Jest in development from the x-pack directory by running something like:

node scripts/jest.js --testPathPattern=plugins/apm --watch

Currently (for me anyway) this is failing with:

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)

and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the VSCode Jest extension.

Add a jest.config.js for APM. This makes running with --watch better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.

Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.

Previously we would run Jest in development from the x-pack directory by running something like:

```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```

Currently (for me anyway) this is failing with:

```
Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```

and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).

Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.
@smith smith added release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels Jun 1, 2020
@smith smith requested a review from a team as a code owner June 1, 2020 13:48
@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label Jun 1, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@smith smith merged commit 78d5026 into elastic:master Jun 2, 2020
@smith smith deleted the nls/apm-jest branch June 2, 2020 01:38
smith added a commit to smith/kibana that referenced this pull request Jun 3, 2020
Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.

Previously we would run Jest in development from the x-pack directory by running something like:

```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```

Currently (for me anyway) this is failing with:

```
Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```

and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).

Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.
# Conflicts:
#	x-pack/dev-tools/jest/create_jest_config.js
smith added a commit that referenced this pull request Jun 3, 2020
Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.

Previously we would run Jest in development from the x-pack directory by running something like:

```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```

Currently (for me anyway) this is failing with:

```
Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```

and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).

Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.
# Conflicts:
#	x-pack/dev-tools/jest/create_jest_config.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants