Skip to content
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

Run test cases for nargo test in parallel #2196

Closed
TomAFrench opened this issue Aug 7, 2023 · 6 comments
Closed

Run test cases for nargo test in parallel #2196

TomAFrench opened this issue Aug 7, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TomAFrench
Copy link
Member

Problem

We're getting some complaints in the discord that nargo test is running slow.

Happy Case

We can get some easy speed-up by running multiple tests in parallel to take advantage of additional cores.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@TomAFrench TomAFrench added enhancement New feature or request good first issue Good for newcomers P-MEDIUM labels Aug 7, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 7, 2023
@skaunov
Copy link

skaunov commented Aug 7, 2023

I would take on this! Could you outline at least something to start with? (Indicate primary moving parts, and do you have on your mind something more than rayon, std::thread, and maybe crossbeam?)

@jfecher
Copy link
Contributor

jfecher commented Aug 7, 2023

@skaunov I'd look into the integration tests in crates/nargo_cli/tests/test_data. There are wrappers generated to run these automatically, see crates/nargo_cli/tests/execute.rs. As for a threading lib, I'd suggest using either std::thread or rayon as a test dependency.

@skaunov
Copy link

skaunov commented Aug 9, 2023

I spent some time getting to know Nix, Cargo build, and tests template system (which seems quite exotic, though it could be lack of my experience as well). X)

Will be looking for nargo test usage in dirs which used to be <test_data> to follow the cases and add parallelization to nargo test itself.

Btw, I currently restricted to remote dev environment (with vscode-server usually) and it doesn't look like something seamless to run with Nix. So I went with Gitpod, which solves this [quite ok]; so now I either finish the thing in 50 computing hours, either will need some alternatives (any hints to this technicality are welcome!).

[quite ok]: starting the environment takes double-digit number of minutes, but at least it's reliable

@skaunov
Copy link

skaunov commented Aug 9, 2023

After reading through <build.rs> with all aforementioned in mind I got confused pretty quickly. @TomAFrench stated the issue that nargo test invocation needs to be parallelized, but starting from this end I don't see any nargo test invocations at all --- only testing nargo compilation and execution features. =(

Maybe I'll try just to unwind <nargo_cli> to find some relevant places to begin with. Though it would be really helpful if somebody could point out to me what am I missing or any alternative entry point for the issue.

Also a side question. Is it possible to locate this resulting file with the tests that <build.rs> produce? Locating binaries of these tests was easy, but what's the lifecycle of that code it stitches from the templates?

@jfecher

@TomAFrench
Copy link
Member Author

Hey, I don't think that looking into the integration test suite is useful for this task.

This issue is to modify the nargo test command so that test cases are run in parallel. We don't need to interact with the integration test suite for nargo itself for this.

Also a side question. Is it possible to locate this resulting file with the tests that <build.rs> produce? Locating binaries of these tests was easy, but what's the lifecycle of that code it stitches from the templates?

This file isn't relevant for this issue but will be placed into target/debug/build/nargo_cli-*/out

@TomAFrench
Copy link
Member Author

Closed by #4484

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Archived in project
Development

No branches or pull requests

4 participants