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

refactor: reduce startup time of tests by using babel to transpile js #689

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

rflechtner
Copy link
Contributor

@rflechtner rflechtner commented Nov 24, 2022

Unit- and integration tests would sometimes get stuck in the startup phase for minutes, as they transpile polkadot-js dependencies that unfortunately are not always 100% clean cjs code - somehow esm export statements seem to sneak into the dependency tree, leading to all tests failing.

Using babel to transpile js files instead of tsc (which only transpiles ts now) appears to buy us significant performance gains, with startup times being reduced to 15-20 seconds on my system.

This comes at the cost of a slightly larger development install, as we now need more babel dependencies.

How to test:

Build sdk and run tests on your machine, report how that goes.

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@rflechtner rflechtner self-assigned this Nov 24, 2022
Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

FWIW, looks good to me!

@rflechtner rflechtner merged commit ada1026 into develop Nov 28, 2022
@rflechtner rflechtner deleted the rf-faster-tests branch November 28, 2022 11:34
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.

2 participants