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
Move ./ts-tests
into ./packages/testsuite-*
#79
Labels
area/packages
kind/feature
New feature request
packages/testsuite
priority/important-soon
Will be important soon
triage/accepted
Triage has been accepted
Milestone
Comments
/assign @canonbrother to you first although it's blocked by a lot of pending tasks |
2 tasks
fuxingloh
added a commit
that referenced
this issue
Sep 13, 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
fuxingloh
added a commit
that referenced
this issue
Sep 14, 2022
#### What this PR does / why we need it: Refactor and move `ts-tests` into mono-repo style packages to allow separation of context and downstream usability. This is the continuation of #42 `@defimetachain/testcontainers` Provides easy to use and test lightweight, throwaway instances of MetaChain provisioned automatically in a Docker container. `MetaChainContainer` and `StartedMetaChainContainer` follows the convention defined in [testcontainers/testcontainers-node](https://github.com/testcontainers/testcontainers-node) ```ts let container: StartedMetaChainContainer; let rpc: ethers.providers.JsonRpcProvider; beforeEach(async () => { container = await new MetaChainContainer().start(); }); afterEach(async () => { await container.stop(); }); it('should createBlock', async function () { await container.createBlock(); expect(await rpc.getBlockNumber()).toStrictEqual(1); }); ``` #### 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 #78 #### Additional comments?: The current implementation in `ts-tests` isn't yet migrated to use the new standard and convention defined here. That should be done as part of #79.
canonbrother
pushed a commit
that referenced
this issue
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
canonbrother
pushed a commit
that referenced
this issue
Sep 28, 2022
#### What this PR does / why we need it: Refactor and move `ts-tests` into mono-repo style packages to allow separation of context and downstream usability. This is the continuation of #42 `@defimetachain/testcontainers` Provides easy to use and test lightweight, throwaway instances of MetaChain provisioned automatically in a Docker container. `MetaChainContainer` and `StartedMetaChainContainer` follows the convention defined in [testcontainers/testcontainers-node](https://github.com/testcontainers/testcontainers-node) ```ts let container: StartedMetaChainContainer; let rpc: ethers.providers.JsonRpcProvider; beforeEach(async () => { container = await new MetaChainContainer().start(); }); afterEach(async () => { await container.stop(); }); it('should createBlock', async function () { await container.createBlock(); expect(await rpc.getBlockNumber()).toStrictEqual(1); }); ``` #### 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 #78 #### Additional comments?: The current implementation in `ts-tests` isn't yet migrated to use the new standard and convention defined here. That should be done as part of #79.
/assign @DieHard073055 to work on this, I've removed @canonbrother from this issue since he is busy with other issues. |
./ts-tests
into ./packages/testsuite
./ts-tests
into ./packages/testsuite-*
fuxingloh
added a commit
that referenced
this issue
Nov 29, 2022
…pc (#169) <!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: Details in the issue #79 #### 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 #79 #### Additional comments?: Signed-off-by: Eshan Shafeeq <[email protected]> Co-authored-by: Fuxing Loh <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area/packages
kind/feature
New feature request
packages/testsuite
priority/important-soon
Will be important soon
triage/accepted
Triage has been accepted
What would you like to be added:
As per the title, and following mono-repo design detailed in #42.
Part of #46 requirement.
Why is this needed:
Blocked by:
./ts-tests/containers
into./packages/testcontainers
#78/triage accepted
/area packages
/packages testsuite
The text was updated successfully, but these errors were encountered: