Skip to content

test(ast/estree): speed up raw transfer tests#9521

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-03-test_ast_estree_speed_up_raw_transfer_tests
Mar 4, 2025
Merged

test(ast/estree): speed up raw transfer tests#9521
graphite-app[bot] merged 1 commit intomainfrom
03-03-test_ast_estree_speed_up_raw_transfer_tests

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 3, 2025

Speed up the tests for raw transfer by serializing output to JSON, and comparing as string to the acorn-test262 JSON snapshots. This is faster than running parseSync twice with "raw" and "standard" settings, and comparing the 2 - time to run the NAPI parser tests is reduced by half.

There are still 5 tests which compare 5 sample JS/TS files (same ones as used in benchmarks) with a full raw-vs-standard comparison. These tests cover the other parts of parseSync's return value - comments, module and errors. They also give some limited test coverage for AST of TS files.

Copy link
Member Author

overlookmotel commented Mar 3, 2025

@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Mar 3, 2025
@overlookmotel overlookmotel changed the base branch from 03-03-feat_ast_estree_option_to_return_js-only_ast to graphite-base/9521 March 3, 2025 22:25
@overlookmotel overlookmotel force-pushed the 03-03-test_ast_estree_speed_up_raw_transfer_tests branch from ad7e389 to 4bd7f8c Compare March 3, 2025 22:27
@overlookmotel overlookmotel changed the base branch from graphite-base/9521 to 03-03-feat_ast_estree_option_to_return_js-only_ast March 3, 2025 22:27
@overlookmotel overlookmotel marked this pull request as ready for review March 3, 2025 22:39
@overlookmotel overlookmotel force-pushed the 03-03-feat_ast_estree_option_to_return_js-only_ast branch from fcbec75 to 8ba8c68 Compare March 3, 2025 23:05
@overlookmotel overlookmotel force-pushed the 03-03-test_ast_estree_speed_up_raw_transfer_tests branch from 4bd7f8c to d8c7852 Compare March 3, 2025 23:05
@overlookmotel overlookmotel force-pushed the 03-03-test_ast_estree_speed_up_raw_transfer_tests branch from d8c7852 to 47fe6f5 Compare March 4, 2025 12:30
@overlookmotel overlookmotel force-pushed the 03-03-feat_ast_estree_option_to_return_js-only_ast branch from 8ba8c68 to e477f85 Compare March 4, 2025 12:30
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 4, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 4, 2025

Merge activity

Speed up the tests for raw transfer by serializing output to JSON, and comparing as string to the `acorn-test262` JSON snapshots. This is faster than running `parseSync` twice with "raw" and "standard" settings, and comparing the 2 - time to run the NAPI parser tests is reduced by half.

There are still 5 tests which compare 5 sample JS/TS files (same ones as used in benchmarks) with a full raw-vs-standard comparison. These tests cover the other parts of `parseSync`'s return value - `comments`, `module` and `errors`. They also give some limited test coverage for AST of TS files.
@graphite-app graphite-app bot force-pushed the 03-03-feat_ast_estree_option_to_return_js-only_ast branch from e477f85 to 4056560 Compare March 4, 2025 14:41
@graphite-app graphite-app bot force-pushed the 03-03-test_ast_estree_speed_up_raw_transfer_tests branch from 47fe6f5 to 4378a66 Compare March 4, 2025 14:41
Base automatically changed from 03-03-feat_ast_estree_option_to_return_js-only_ast to main March 4, 2025 14:49
@graphite-app graphite-app bot merged commit 4378a66 into main Mar 4, 2025
16 checks passed
@graphite-app graphite-app bot deleted the 03-03-test_ast_estree_speed_up_raw_transfer_tests branch March 4, 2025 14:52
@oxc-bot oxc-bot mentioned this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant