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

move GLS tests to jest, add codecov #871

Merged
merged 2 commits into from
Sep 8, 2019
Merged

Conversation

acao
Copy link
Member

@acao acao commented Jun 20, 2019

  • - jest for GLS repositories
  • - introduce codecov
  • - per subpackage tests/test coverage

@acao acao force-pushed the jest-codecov branch 3 times, most recently from 1ca021d to 5bb316e Compare June 20, 2019 13:45
@codecov-io
Copy link

codecov-io commented Jun 20, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@f6bdd55). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #871   +/-   ##
=========================================
  Coverage          ?   33.78%           
=========================================
  Files             ?       79           
  Lines             ?     3481           
  Branches          ?      753           
=========================================
  Hits              ?     1176           
  Misses            ?     1814           
  Partials          ?      491

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6bdd55...d2dee69. Read the comment docs.

@acao acao changed the title refactor tests for jest, add codecov refactor tests for jest, add codecov [WIP] Jun 20, 2019
@acao acao force-pushed the jest-codecov branch 5 times, most recently from c779066 to e244de9 Compare June 21, 2019 02:32
Copy link
Contributor

@Neitsch Neitsch left a comment

Choose a reason for hiding this comment

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

Please pull the codecov part out into a separate PR. To make this PR easier, you could consider running mocha and jest alongside each other (i.e. jest runs .test.js tests, while mocha runs -spec.js tests). That will avoid a big PR like this & you can merge some of your progress without having to figure out every detail :)

packages/graphiql/package.json Show resolved Hide resolved
packages/graphql-language-service/README.md Outdated Show resolved Hide resolved
resources/runTests.js Outdated Show resolved Hide resolved
@acao
Copy link
Member Author

acao commented Jul 27, 2019

we actually already have jest and mocha running side by side!

@acao
Copy link
Member Author

acao commented Jul 27, 2019

as per codecov, we are in progress working with the codecov folks to be able to have labels for subpackages, so that the LSP libs and the codemirror mode don't look bad just because graphiql is lacking in coverage.

good idea to remove codecov from the scope.

and yeah, i felt like i was so close with codemirror-graphql, but it seems that codemirror + jsdom + jest is not an easy mix, according to my research.

@acao
Copy link
Member Author

acao commented Jul 29, 2019

@ganemone see here, we will not be able to replace mocha entirely yet

@acao
Copy link
Member Author

acao commented Jul 29, 2019

I can clean this PR up tonight after work

@acao acao force-pushed the jest-codecov branch 2 times, most recently from 161f4fc to cafb5ae Compare August 3, 2019 18:50
@acao acao changed the title refactor tests for jest, add codecov [WIP] move GLS tests to jest, add codecov [WIP] Aug 3, 2019
@acao
Copy link
Member Author

acao commented Aug 3, 2019

@Neitsch should be good to go. Left code-mirror tests as is, but changed the configuration to make codemirror-graphql the only mocha harnessed subpackage. Left codecov in place for now. Converted graphiql to jest.expect. Did not worry about converting enzyme yet, that can come in a different PR.

@Neitsch
Copy link
Contributor

Neitsch commented Aug 3, 2019

@acao, looks like Travis is not passing. Would you mind checking on that first? :)

Copy link
Contributor

@Neitsch Neitsch left a comment

Choose a reason for hiding this comment

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

Looks like you forgot to convert a couple assertions :)

@acao acao force-pushed the jest-codecov branch 4 times, most recently from 23504aa to e82a942 Compare August 4, 2019 15:26
@acao acao changed the title move GLS tests to jest, add codecov [WIP] move GLS tests to jest, add codecov Aug 4, 2019
@acao
Copy link
Member Author

acao commented Sep 7, 2019

@Neitsch this happens every time i rebase! I think its because new tests keep getting added upstream using mocha

@acao
Copy link
Member Author

acao commented Sep 7, 2019

Screen Shot 2019-09-07 at 6 32 38 PM

interesting, seems like legit tests failures converting new tests from to.Equal to toEqual for proper deep comparison?

- added fix and comment for new failing tests
- added assertions for new tests for Jest
- switched back to global jest run, 12.8s for all but codemirror! woo!
- make sure mocks arent being built by babel as well (fixes warning)
@acao acao merged commit 7762c3d into graphql:master Sep 8, 2019
@Neitsch
Copy link
Contributor

Neitsch commented Sep 8, 2019

Nice!

acao added a commit that referenced this pull request Sep 14, 2019
- added fix and comment for new failing tests
- added assertions for new tests for Jest
- switched back to global jest run, 12.8s for all but codemirror! woo!
- make sure mocks arent being built by babel as well (fixes warning)
acao added a commit that referenced this pull request Sep 15, 2019
- added fix and comment for new failing tests
- added assertions for new tests for Jest
- switched back to global jest run, 12.8s for all but codemirror! woo!
- make sure mocks arent being built by babel as well (fixes warning)
acao added a commit that referenced this pull request Sep 15, 2019
- added fix and comment for new failing tests
- added assertions for new tests for Jest
- switched back to global jest run, 12.8s for all but codemirror! woo!
- make sure mocks arent being built by babel as well (fixes warning)
acao added a commit that referenced this pull request Sep 17, 2019
- added fix and comment for new failing tests
- added assertions for new tests for Jest
- switched back to global jest run, 12.8s for all but codemirror! woo!
- make sure mocks arent being built by babel as well (fixes warning)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants