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

[Bug] "No such file or directory (os error 2)" when running leo test on a fresh --lib project #376

Closed
aphelionz opened this issue Sep 25, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@aphelionz
Copy link

🐛 Bug Report

I'm getting a "No such file or directory (os error 2)" after running leo new lib --testing and then running leo test.

Steps to Reproduce

AleoHQ/  $ leo new --lib testing
Initializing Successfully initialized package "testing"


 AleoHQ/  $ cd testing/

 testing/  $ leo test
      Test reading: No such file or directory (os error 2)

Error: InputsDirectoryError(Reading(Os { code: 2, kind: NotFound, message: "No such file or directory" }))

Expected Behavior

I would expect to see the default output:

      Test Running 0 tests
      Done Tests passed in 3 milliseconds. 0 passed; 0 failed;

Your Environment

  • 1.0.3
  • 1.46.0 stable
  • Ubuntu 20.04
@aphelionz aphelionz added the bug Something isn't working label Sep 25, 2020
@collinc97 collinc97 self-assigned this Nov 18, 2020
@collinc97 collinc97 added this to the Leo Developer Preview II milestone Nov 18, 2020
@myoussefmir myoussefmir added the P2 label Nov 24, 2020
@damirka damirka self-assigned this Jan 21, 2021
@damirka
Copy link
Contributor

damirka commented Jan 27, 2021

Starting a conversation on this one. Are we keeping --lib option in a CLI and how do we deal with tests with inputs?

My proposed solution is:

  1. Make inputs optional in testing libraries (i.e. projects that do not contain main.leo file). In the end circuits can be unit-tested and it is okay (?) to not provide inputs for libraries. Adding a warning message of kind No inputs found may also be helpful in this scenario.

  2. I would also improve @collinc97 proposal in [Feature] Add flags to leo test #277 and allow people write tests in any file. So leo test could be called for specific file(s) or even all files in the project (if there're tests of course): leo test --all and leo test -f lib.leo -f tests.leo. Inputs for these tests are still optionally provided.

@collinc97 @damons @howardwu what do you think? Maybe there's something I don't know yet?

damirka added a commit that referenced this issue Feb 8, 2021
Features:

- introduces new Command and Route traits for Leo commands and Aleo PM API
- most of the CLI code replace with higher-level abstraction - StructOpt
- anyhow used for error handling, no more custom error classes
- improves API - now every status code has its business logic
- adds global flags (e.g. --quiet to suppress output)
- error messages improved for convenience and better user experience

Closes:

- #604
- #599
- #584
- #277
- #376
@collinc97
Copy link
Collaborator

Closed by #632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants