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

Make the tool produce valid JSON when it detects no vulnerabilities #77

Merged
merged 2 commits into from
Jul 3, 2019
Merged

Make the tool produce valid JSON when it detects no vulnerabilities #77

merged 2 commits into from
Jul 3, 2019

Conversation

jakubadamw
Copy link
Contributor

@jakubadamw jakubadamw commented Jul 1, 2019

Fixes #73.

@jakubadamw
Copy link
Contributor Author

Whilst getting this change ready I was facing test failures when using more than one test thread (--test-threads argument in cargo test). Turns out, cargo audit as such will misbehave (with rustcsec::Repository::fetch() errors) if there occur two concurrent first-time runs (i.e. in an environment without an advisory database repository in place). Something to keep in mind. To reduce test flakiness, I made the tests "serial", i.e. enforced that they don't get run in multiple threads.

@tarcieri
Copy link
Member

tarcieri commented Jul 2, 2019

@jakubadamw FYI, I plan on moving much of the existing boilerplate over to this fairly soon:

https://docs.rs/abscissa/0.1.0/abscissa/

It includes a testing subsystem, which probably doesn't yet tackle this particular case, but could:

https://docs.rs/abscissa/0.1.0/abscissa/testing/index.html

cargo has a registry lock, but I think the testing subsystem could provide a flock(2)-style lock around executing subcommands, which would provide a sort of global mutex around CLI acceptance tests which rely on a particular directory state.

It also addresses all the warnings around Box<dyn .*> in the terminal code by ripping that out and switching to @BurntSushi's awesome termcolor crate.

@tarcieri tarcieri merged commit 0c919cb into rustsec:master Jul 3, 2019
@tarcieri tarcieri mentioned this pull request Jul 15, 2019
tarcieri added a commit that referenced this pull request May 7, 2021
tarcieri added a commit that referenced this pull request May 7, 2021
tarcieri added a commit that referenced this pull request May 7, 2021
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.

--json output is invalid when there aren't vulnerabilites
2 participants