feat(cli): implement test command and reporter#1390
feat(cli): implement test command and reporter#1390johnyob wants to merge 1 commit intoajob410@jstz-test-executionfrom
test command and reporter#1390Conversation
58ecac8 to
20a5497
Compare
79899d2 to
6fb3fe4
Compare
6fb3fe4 to
b0e0444
Compare
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| mod reporter; | ||
|
|
||
| #[derive(Debug, Clone, Args)] | ||
| pub struct TestArgs { |
There was a problem hiding this comment.
Jstz test as of today can only be used with ESM files right? There should be some documentation about this
| deno_terminal = { workspace = true, optional = true } | ||
| indexmap = { workspace = true, optional = true } | ||
| jstz_runtime = { path = "../jstz_runtime", optional = true } | ||
| jstz_node = { path = "../jstz_node", optional = true } |
There was a problem hiding this comment.
I think this isn't used anywhere? Can be removed
| TEST_RUNNER_MAX_SMART_FUNCTION_CALL_COUNT, | ||
| >::default() | ||
| .try_acquire() | ||
| .expect("Failred to acquire limiter for test runner"), |
There was a problem hiding this comment.
| .expect("Failred to acquire limiter for test runner"), | |
| .expect("Failed to acquire limiter for test runner"), |
|
We need to update documentation as part of the test feature but that can be done in a separate PR |
| const TEST_RUNNER_ADDRESS: &str = "KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton"; | ||
| const TEST_RUNNER_MAX_SMART_FUNCTION_CALL_COUNT: u8 = MAX_SMART_FUNCTION_CALL_COUNT; | ||
|
|
||
| pub(crate) async fn exec(args: TestArgs) -> anyhow::Result<()> { |
There was a problem hiding this comment.
For benefit of future maintainers, its probably a good idea to have either a README.md or doc string of the test framework architecture and an overview of how it works
|
A few things that come to mind that need to be done as part of this feature but can be done as separate PRs
|
| const TEST_RUNNER_MAX_SMART_FUNCTION_CALL_COUNT: u8 = MAX_SMART_FUNCTION_CALL_COUNT; | ||
|
|
||
| pub(crate) async fn exec(args: TestArgs) -> anyhow::Result<()> { | ||
| for file in args.files { |
There was a problem hiding this comment.
If files are empty, we should probably tell the user
Context
This PR implements the
jstz testcommand and a pretty TTY reporter for test resultsDescription
Dependencies: #1389 #1378
When reviewing the PR, ignore
test/reporter.rs, this is a selective copy of:Within
test/mod.rs:report_testsis taken from https://github.com/denoland/deno/blob/82eba477fbea8a11127bf2a678413be24e0857a0/cli/tools/test/mod.rs#L1248execcontains the main logic: initializing the runtime, executing the tests and calling the reporter.Manually testing the PR