-
Notifications
You must be signed in to change notification settings - Fork 203
test(benches): add nft test #3159
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
base: main
Are you sure you want to change the base?
test(benches): add nft test #3159
Conversation
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.
Pull Request Overview
This PR adds new benchmark tests for NFT functionality by updating benchmark test scripts and configurations. Key changes include:
- Modifying the benchmark file search pattern in update.build.ts to exclude files ending with ".test.spec.ts".
- Updating benchmark scripts in package.json to use new Jest configurations.
- Adding new Jest configuration files (jest-test.config.js and jest-bench.config.js) for organizing tests.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/benchmarks/update.build.ts | Updated glob pattern to exclude certain test files. |
package.json | Modified benchmark scripts to reference new Jest configs. |
jest-test.config.js | New Jest configuration targeting *.test.spec.ts files. |
jest-bench.config.js | New Jest configuration for benchmark tests excluding test specs. |
Comments suppressed due to low confidence (1)
package.json:49
- The updated 'bench:ci' script now runs both 'bench' and 'bench:test' sequentially. Please confirm that this combined execution approach is intentional and that the overall execution time is acceptable in CI environments.
"bench:ci": "yarn gen:contracts:benchmarks && yarn bench && yarn bench:test"
…l-benchmarks-projects-nft
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.
Very hard pr to review since I am not really nft expert, good work nevertheless, please check my comments, most of them could be applied to a lot of places at the same time (wrappers const, wrappers build, \n and so on)
transfer-fee.ts is a port from original repo |
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.
Looks pretty good.
Future idea: Consider integrating benchmarks with tests so that performance measurements are taken during test execution.
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.
Pull Request Overview
This PR adds a comprehensive NFT test suite and benchmark support for both FunC and Tact implementations, while updating the smart contract source code to leverage new function calls.
- Added extensive tests for NFT collection/item behavior, transfer fees, batch minting, and deployment status.
- Updated Tact contract code to replace forceBasechain with forceBasechainFunc.
- Integrated benchmark and code size reporting via the run.ts module.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/benchmarks/nft/tests/utils.ts | Added test constants and error code mappings; note potential redundant conversion. |
src/benchmarks/nft/tests/transfer-fee.ts | Added detailed tests for transfer fee scenarios with minor typo in test description. |
src/benchmarks/nft/tests/item.ts | Expanded tests for NFT item behavior and static data retrieval. |
src/benchmarks/nft/tests/collection.ts | Added tests for NFT collection minting, deployment, royalty, and state queries. |
src/benchmarks/nft/test.spec.ts | Integrated NFT tests into the main test suite. |
src/benchmarks/nft/tact/item.tact | Updated Tact contract implementation with a new function call. |
src/benchmarks/nft/run.ts | Added benchmark and code size utilities for NFT contracts. |
spell/cspell-list.txt | Updated cspell exclusions. |
Comments suppressed due to low confidence (1)
src/benchmarks/nft/tact/item.tact:108
- The magic number '333' in the forceBasechainFunc implementation lacks context; adding an inline comment to explain its purpose would improve maintainability.
asm fun forceBasechainFunc(address: Address) { REWRITESTDADDR DROP 333 THROWIF }
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.
If we commit on this test structure, it's good
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!
Closes #3154