This repository was archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
chore(ts-tests): refactor ts-tests/*
to follow pnpm and turbo workspace design
#86
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for metachain ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
This comment was marked as resolved.
This comment was marked as resolved.
Docker image for defich/metachain is ready! Built with commit 93ee74a
|
Codecov Report
@@ Coverage Diff @@
## main #86 +/- ##
========================================
+ Coverage 3.79% 6.60% +2.80%
========================================
Files 10 13 +3
Lines 1711 1771 +60
Branches 0 11 +11
========================================
+ Hits 65 117 +52
- Misses 1646 1653 +7
- Partials 0 1 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
weiyuan95
approved these changes
Sep 13, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just FYI that Hardhat also has cache-aware contract recompiling, but it plays nice with Turbo though, so no worries.
canonbrother
approved these changes
Sep 13, 2022
canonbrother
pushed a commit
that referenced
this pull request
Sep 28, 2022
…pace design (#86) #### What this PR does / why we need it: Move `ts-tests/*` to utilize pnpm and turbo mono-repo workspace design. With this, we managed to keep configs (eslint, prettier, babel jest) DRY. The PR "workspace-ize" `ts-tests` but ultimately many more PR is required to break this package into multiple smaller mono repo packages. Follow-up PRs required to address these: - [ ] ESLINT will be added back once we move to "testsuite", also part of #79 - [ ] #78 --- **What's new?** As suggested in #66 (comment) I've added hardhat compile turbo workflow. `@birthdayresearch/sticky-turbo-jest` is a turbo-aware `jest-preset`; it automatically run `dependsOn` script before running jest. By taking advantage of content-aware hashing from turborepo. `dependsOn` only runs if the pipeline `inputs` has changed. When you run your test with `@birthdayresearch/sticky-turbo-jest` preset, it uses `displayName` from your jest config to figure out which `pipeline` to use. It will automatically pinpoint the corresponding `dependsOn` and run all the scripts specified within. > TLDR, when you run a dependent test, it automatically recompiles your contract with hardhat when it detects changes in your `contracts/*.sol` file. If it has the cached version, it will simply "output" the result instead of rebuilding it. https://sticky.birthday.dev/packages/sticky-turbo-jest `package.json`: ```json "scripts": { "compile": "hardhat compile", "test": "jest" }, "jest": { "displayName": "test", "preset": "@birthdayresearch/sticky-turbo-jest" }, ``` `turbo.json`: ```json "compile": { "inputs": ["contracts/**"], "outputs": ["artifacts", "cache"] }, "test": { "inputs": ["src/**", "**/*.unit.ts", "tests-e2e/**"], "dependsOn": ["^build", "compile"] }, ``` #### Which issue(s) does this PR fixes?: <!-- (Optional) Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Fixes part of #79
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Move
ts-tests/*
to utilize pnpm and turbo mono-repo workspace design. With this, we managed to keep configs (eslint, prettier, babel jest) DRY. The PR "workspace-ize"ts-tests
but ultimately many more PR is required to break this package into multiple smaller mono repo packages.Follow-up PRs required to address these:
./ts-tests
into./packages/testsuite-*
#79./ts-tests/containers
into./packages/testcontainers
#78What's new?
As suggested in #66 (comment) I've added hardhat compile turbo workflow.
@birthdayresearch/sticky-turbo-jest
is a turbo-awarejest-preset
; it automatically rundependsOn
script before running jest. By taking advantage of content-aware hashing from turborepo.dependsOn
only runs if the pipelineinputs
has changed.When you run your test with
@birthdayresearch/sticky-turbo-jest
preset, it usesdisplayName
from your jest config to figure out whichpipeline
to use. It will automatically pinpoint the correspondingdependsOn
and run all the scripts specified within.https://sticky.birthday.dev/packages/sticky-turbo-jest
package.json
:turbo.json
:Which issue(s) does this PR fixes?:
Fixes part of #79