Open nfurfaro opened 6 months ago
It's hard to diagnose this without having a concrete example of the structure you're describing. Having a Nargo package inside of another Nargo project isn't supported, instead temp
should be another package under a https://noir-lang.org/docs/noir/modules_packages_crates/workspaces.
@nfurfaro thanks for submitting the Issue. Is this still relevant in newer versions of Noir?
@Savio-Sou I will test this weekend and get back to you. I think so, but need to confirm.
Aim
High level context
I want to create temporary noir files with tests and run the tests. This is related to a WIP tool for mutation testing. Currently, the temp files are created in a sibling directory to /src called /temp, but the location is not a hard requirement. I've tried making the /temp dir its own package by adding a Nargo.toml, and setting the package type to lib. Here is an simplified example of the project structure (Verifier.toml & Prover.toml omitted):
Here is my Nargo.toml in the /temp lib:![image](https://github.com/noir-lang/noir/assets/17053076/76d0dfce-9db2-4648-84a0-0f9e21fdd1ef)
And here is the lib.nr:![image](https://github.com/noir-lang/noir/assets/17053076/059c5146-82d6-4d3f-bbcc-74e871ead91f)
Expected Behavior
I expected Nargo to run the tests in the temp files in the /temp dir.
Bug
When I run![image](https://github.com/noir-lang/noir/assets/17053076/bad559dd-1ad0-4d10-af49-0494bcecbaa5)
nargo test --package temp
from the project root, I get the following:If I cd into the temp dir and try the same command, I get the same result:![image](https://github.com/noir-lang/noir/assets/17053076/c19e0f6c-f5a5-4efa-b9b5-e6dda1dfb94a)
Note
I tried adding a log for debugging purposes to this line in the nargo_cli source code: https://github.com/noir-lang/noir/blob/5be049eee6c342649462282ee04f6411e6ea392c/tooling/nargo_cli/src/cli/test_cmd.rs#L60 to see the value of the
selection
var at this point.selection
is set correctly here:To Reproduce
nargo new
I've scaffolded this in a gist to simplify reproducing: https://gist.github.com/nfurfaro/4a2f49cf0564393b7cec7b776423220d
Note
I installed via Noirup, but this option is not available in the dropdown menu.
Installation Method
Binary
Nargo Version
nargo version = 0.19.4 (git version hash: 4d133c50a50f21ca23861a9d1987207bd8783d36, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response