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

Jest Conversion Continued #5282

Merged
merged 30 commits into from Oct 1, 2018
Merged

Jest Conversion Continued #5282

merged 30 commits into from Oct 1, 2018

Conversation

@blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 9, 2018

Follow up to #5251. Running coverage on coreutils drops to 6sec from 17sec with this change.

  • Converts test-coreutils to jest, to be used as a template.
  • Adds a script to automatically perform most of the conversion. The only additional work for coreutils beyond what this script does was handing a PathExt difference because we are now running in node.
  • Uses a common jest config file that allows for CSS and file imports
  • I tried to moved tests under packages/<foo>/tests since we do not need a common set of test source files (because of testutils), but that results in a circular dependency because testutils depends on some of the packages.
  • Moves services to tests/test-services
  • Moves tsconfig to root of each package so we don't have to use /src in the build or reference targets
  • We need to make sure to import from /src for the package being tested so we get coverage.
$ yarn test --coverage
yarn run v1.9.4
$ python tests/run_test.py --coverage
[C 08:03:14.744 JestApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8838/?token=ea2853b595f03348097d207b623673e95fd484d8647638c7
 PASS  tests/src/activitymonitor.spec.ts
 PASS  tests/src/settingregistry.spec.ts
 PASS  tests/src/url.spec.ts
 PASS  tests/src/statedb.spec.ts
 PASS  tests/src/time.spec.ts
 PASS  tests/src/markdowncodeblocks.spec.ts
 PASS  tests/src/pageconfig.spec.ts
 PASS  tests/src/path.spec.ts
 PASS  tests/src/nbformat.spec.ts
-----------------------|----------|----------|----------|----------|-------------------|
File                   |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
-----------------------|----------|----------|----------|----------|-------------------|
All files              |    80.37 |    62.34 |    79.31 |    80.76 |                   |
 activitymonitor.ts    |      100 |      100 |      100 |      100 |                   |
 dataconnector.ts      |    33.33 |      100 |        0 |    33.33 |             42,59 |
 index.ts              |      100 |      100 |      100 |      100 |                   |
 markdowncodeblocks.ts |    97.37 |    88.89 |      100 |    97.37 |                54 |
 nbformat.ts           |    73.68 |    85.71 |    33.33 |    73.68 |... 67,474,481,488 |
 pageconfig.ts         |    73.91 |    53.85 |       70 |    73.91 |... 70,172,192,198 |
 path.ts               |      100 |      100 |      100 |      100 |                   |
 settingregistry.ts    |    77.46 |    62.16 |       78 |    78.74 |... 1061,1063,1067 |
 statedb.ts            |    90.43 |    72.22 |    93.33 |    90.11 |... 25,446,447,462 |
 text.ts               |    15.38 |     7.69 |    33.33 |    15.38 |... 64,65,66,67,71 |
 time.ts               |      100 |      100 |      100 |      100 |                   |
 url.ts                |    85.37 |    57.14 |    84.62 |    85.37 |... 25,130,132,134 |
-----------------------|----------|----------|----------|----------|-------------------|

Test Suites: 9 passed, 9 total
Tests:       103 passed, 103 total
Snapshots:   0 total
Time:        4.058s
✨  Done in 5.82s.
@blink1073 blink1073 added this to the 1.0 milestone Sep 9, 2018
@blink1073 blink1073 changed the title Jest Conversion Continued [WIP] Jest Conversion Continued Sep 9, 2018
@blink1073 blink1073 changed the title [WIP] Jest Conversion Continued Jest Conversion Continued Sep 11, 2018
@blink1073 blink1073 self-assigned this Sep 12, 2018
@blink1073 blink1073 changed the title Jest Conversion Continued [WIP] Jest Conversion Continued Sep 13, 2018
@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Sep 13, 2018

There's too much fiddling with typings going on here, I'm going to wait for #5030 and then finish this.

blink1073 added 3 commits Sep 29, 2018
clean up services and JestApp

wip jest conversion

wip convert-to-jest

wip convert-to-jest

wip convert coreutils

formatting

wip update coreutils test

formatting

finish coreutils conversion

Cleanup config and centralize

Fix test suite names

Move jest config to testutils

normalize file name

Better handling of tsconfig for tests

Cleanup

fix file name

move coreutils test to tests

cleanup

Move services to tests/

integrity

Don't use relative imports

Add mocha for now

Clean up travis infra

Update test tsconfig

formatting

Use local typings

fix typings

fix typings

fix typings

fix cycle

Clean up pytest config
@blink1073 blink1073 mentioned this pull request Sep 30, 2018
7 tasks
@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Sep 30, 2018

Ugh. I used git mv for the tsconfig files but they must differ too much from the originals...

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Sep 30, 2018

Omg you're switching to jest. ❤️ ❤️ ❤️

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Sep 30, 2018

It has been painful to switch, but Jest is pretty amazing. I'm already using it at work against Jlab packages, I just had to add a shim for a missing browser API that CodeMirror uses (which will come in a follow up PR here).

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Sep 30, 2018

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Sep 30, 2018

Nice, thanks!

@blink1073 blink1073 changed the title [WIP] Jest Conversion Continued Jest Conversion Continued Oct 1, 2018
@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Oct 1, 2018

This is now gtg.

afshin
afshin approved these changes Oct 1, 2018
Copy link
Member

@afshin afshin left a comment

Awesome, thanks!

@afshin afshin merged commit 0b77fcd into jupyterlab:master Oct 1, 2018
2 checks passed
@jasongrout jasongrout removed this from the 1.0 milestone Oct 1, 2018
@jasongrout jasongrout added this to the 0.35 milestone Oct 1, 2018
@blink1073 blink1073 deleted the just-cont branch Oct 2, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants