Skip to content

test: Add JS binding tests#600

Open
mschfh wants to merge 4 commits intomasterfrom
mschfh/js-test
Open

test: Add JS binding tests#600
mschfh wants to merge 4 commits intomasterfrom
mschfh/js-test

Conversation

@mschfh
Copy link
Collaborator

@mschfh mschfh commented Feb 27, 2026

No description provided.

@mschfh mschfh self-assigned this Feb 27, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Details
Benchmark suite Current: b4ff1f7 Previous: cd60a2f Ratio
rule-match-browserlike/brave-list 2016024231 ns/iter (± 14572407) 2025601114 ns/iter (± 18133232) 1.00
rule-match-first-request/brave-list 1115824 ns/iter (± 12882) 1111325 ns/iter (± 19511) 1.00
blocker_new/brave-list 142217434 ns/iter (± 1798644) 146440968 ns/iter (± 2967288) 0.97
blocker_new/brave-list-deserialize 24593802 ns/iter (± 240537) 24268245 ns/iter (± 287284) 1.01
memory-usage/brave-list-initial 10630445 ns/iter (± 3) 10630445 ns/iter (± 3) 1
memory-usage/brave-list-initial/max 61948094 ns/iter (± 3) 61948094 ns/iter (± 3) 1
memory-usage/brave-list-initial/alloc-count 1030640 ns/iter (± 3) 1030640 ns/iter (± 3) 1
memory-usage/brave-list-1000-requests 2316792 ns/iter (± 3) 2316792 ns/iter (± 3) 1
memory-usage/brave-list-1000-requests/alloc-count 70181 ns/iter (± 3) 70181 ns/iter (± 3) 1
url_cosmetic_resources/brave-list 190273 ns/iter (± 2001) 190467 ns/iter (± 629) 1.00
cosmetic-class-id-match/brave-list 3485800 ns/iter (± 959934) 3480495 ns/iter (± 947856) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: c559e29 Previous: cd60a2f Ratio
blocker_new/brave-list-deserialize 36181962 ns/iter (± 1219644) 24268245 ns/iter (± 287284) 1.49

This comment was automatically generated by workflow using github-action-benchmark.

@mschfh mschfh marked this pull request as ready for review February 27, 2026 00:28
@mschfh mschfh requested a review from a team as a code owner February 27, 2026 00:28
Copy link
Collaborator

@antonok-edm antonok-edm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with changes

'https://ads.example.com/tracker.js', 'https://publisher.com', 'script', true,
);
assert.equal(result.matched, false);
assert.equal(typeof result.exception, 'string');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to confirm the rule string matches the original rule added to the list (same for other tests where applicable via filter field)

@mschfh mschfh requested a review from antonok-edm March 3, 2026 04:37
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these tests.
I would say that the primary tests should be in Rust and here we likely don't want to duplicate tests.

I wonder can we reduce some logic check check in favor of verifing that API works = proxy to the matching rust method).

I.e. $third-party and $1p modifiers looks excessive.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that the primary tests should be in Rust and here we likely don't want to duplicate tests.

I agree that primary tests should be in Rust, but I don't think there's a compelling reason to remove/reduce JS tests - they can help catch regressions or API changes and have very little cost if delegated to agentic coding assistants.

I wonder can we reduce some logic check check in favor of verifing that API works = proxy to the matching rust method).

Definitely agree with this one, but I don't see any easy way of doing it at the moment 🥲

@mschfh mschfh requested a review from atuchin-m March 5, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants