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

tests typescript migration #31234

Merged
merged 7 commits into from
Feb 22, 2019
Merged

tests typescript migration #31234

merged 7 commits into from
Feb 22, 2019

Conversation

vitalics
Copy link
Contributor

@vitalics vitalics commented Feb 15, 2019

Summary

Add typescript support for functional tests.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@vitalics vitalics added WIP Work in progress Team:QA Team label for QA Team Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Feb 15, 2019
@vitalics vitalics self-assigned this Feb 15, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-qa

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💔 Build Failed

@vitalics
Copy link
Contributor Author

vitalics commented Feb 15, 2019

@elastic/kibana-platform could you please add missing dependencies to yarn.lock file, it's a reason for failed ci
image

@mattkime
Copy link
Contributor

@vitalics I was working on something similar but it looks like you're a bit further along. I'm going to see how I can move this forward.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@mattkime mattkime self-assigned this Feb 21, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

This is awesome! didn't check anything locally, @mattkime talked about verifying that intended failure will show up as a failure which sounds like a great plan prior to merge, but otherwise it looks good to me!

@@ -75,6 +75,7 @@ const functionalTestRunner = createFunctionalTestRunner({
bail: cmd.bail,
grep: cmd.grep,
invert: cmd.invert,
require: `ts-node/register --project tests/tsconfig.json -r tsconfig-paths/register -T "test/**/*.{ts,js}"`
Copy link
Contributor

Choose a reason for hiding this comment

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

So I guess this is the key part that was missing in my PR? Any idea why this works? Do we need this ts-node step for other packages? Just curious.

Copy link
Contributor

Choose a reason for hiding this comment

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

Its initializing typescript parsing before loading ts files. https://github.com/TypeStrong/ts-node#mocha

Do we need this ts-node step for other packages? Just curious.

I suspect not since its being added at the test runner level but I'm not 100%.

@mattkime mattkime merged commit 75e49e6 into master Feb 22, 2019
mattkime pushed a commit to mattkime/kibana that referenced this pull request Feb 22, 2019
* add typescript support for functional tests
mattkime added a commit that referenced this pull request Feb 22, 2019
* add typescript support for functional tests
@vitalics vitalics mentioned this pull request Feb 25, 2019
7 tasks
spalger pushed a commit that referenced this pull request Feb 28, 2019
…onfig files (#31948)

In #31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from #30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
spalger pushed a commit to spalger/kibana that referenced this pull request Feb 28, 2019
…onfig files (elastic#31948)

In elastic#31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from elastic#30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
spalger pushed a commit that referenced this pull request Feb 28, 2019
…onfig files (#31948) (#32250)

In #31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from #30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
spalger pushed a commit to spalger/kibana that referenced this pull request Mar 9, 2019
* add typescript support for functional tests
spalger pushed a commit to spalger/kibana that referenced this pull request Mar 9, 2019
…onfig files (elastic#31948)

In elastic#31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from elastic#30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
# Conflicts:
#	src/functional_test_runner/lib/config/schema.js
#	test/common/services/es.ts
#	test/functional/page_objects/index.ts
#	test/functional/services/apps_menu.js
#	yarn.lock
@spalger spalger added the v7.0.0 label Mar 9, 2019
@spalger
Copy link
Contributor

spalger commented Mar 9, 2019

Backporting to 7.0 in #32827

spalger pushed a commit to spalger/kibana that referenced this pull request Mar 9, 2019
…onfig files (elastic#31948)

In elastic#31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from elastic#30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
# Conflicts:
#	src/functional_test_runner/lib/config/schema.js
#	test/common/services/es.ts
#	test/functional/page_objects/index.ts
#	test/functional/services/apps_menu.js
#	yarn.lock
spalger pushed a commit that referenced this pull request Mar 9, 2019
…32827)

* [ts] add script to verify that all ts is in a project (#32727)

Based on #32705 

We currently have TypeScript code that was backported to 7.0, which was backported without issue because it falls outside of any TypeScript projects in 7.0. This means that the pre-commit hooks break on changes to these files, and that they are not getting type checked by the type_check script. To fix this we need to verify that every typescript file in the repository is covered by a tsconfig.json file as part of CI.

* tests typescript migration (#31234)

* add typescript support for functional tests

* [ts][ftr] improve types for ftr and expect.js, cleanup changes to tsconfig files (#31948)

In #31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from #30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
# Conflicts:
#	src/functional_test_runner/lib/config/schema.js
#	test/common/services/es.ts
#	test/functional/page_objects/index.ts
#	test/functional/services/apps_menu.js
#	yarn.lock
@spalger spalger deleted the tests-typescript-migration branch November 8, 2019 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:QA Team label for QA Team Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0 v7.2.0 v8.0.0 WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants