Unit testing - my first try. Is it me or does one of the sn_node unit tests fail?

sn_node: master

So I’m Unit Testing in Rust for the first time and these were the results:

failures:

---- config_handler::test::smoke stdout ----
thread 'config_handler::test::smoke' panicked at 'Argument short must be unique

	-l is already in use', /home/folaht/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.3/src/app/parser.rs:193:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    config_handler::test::smoke

test result: FAILED. 21 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--lib'

So I’ve got two questions.

Is the unit test is still relevant?
And why are some unit tests ignored?

2 Likes

It is relevent as of right now (as it does indeed test whether or not the parsing works), but I don’t know for how much longer it will be relevent considering most structopt based parse-schemes (like those we have in other crates) don’t have need of it. Here’s a quote from the other thread I just posted in:

I imagine there’s a few reasons we ignore some tests, but I think, in this case, it’s because it’s hard to maintain and/or was only intended to be temporary until we could get a better solution going (Anecdotally, this test does break relatively often tbh). But maybe somebody has a better answer than my somewhat hand-wavy one…