-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Split integration test into multiple files #91
Conversation
Can't you properly fix the warnings using cfg(test)? This way, the helper
stuff will only be compiled in test mode.
…On Sun, Apr 28, 2019, 20:13 Khải ***@***.***> wrote:
Fix #85 <#85>
*An additional issue arises:* Warnings of unused items in helper module:
This happens because the items are only used by test functions in test-only
context. I don't know how to fix this other than #[allow(dead_code)].
------------------------------
You can view, comment on, or merge this pull request online at:
#91
Commit Summary
- Split integration test into multiple files
File Changes
- *A* tests/auth.rs
<https://github.com/svenstaro/miniserve/pull/91/files#diff-0> (50)
- *M* tests/cli.rs
<https://github.com/svenstaro/miniserve/pull/91/files#diff-1> (176)
- *A* tests/helpers.rs
<https://github.com/svenstaro/miniserve/pull/91/files#diff-2> (37)
- *A* tests/serve_request.rs
<https://github.com/svenstaro/miniserve/pull/91/files#diff-3> (44)
- *A* tests/upload_files.rs
<https://github.com/svenstaro/miniserve/pull/91/files#diff-4> (51)
Patch Links:
- https://github.com/svenstaro/miniserve/pull/91.patch
- https://github.com/svenstaro/miniserve/pull/91.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#91>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAANAF4XAHTBN3BDH32N3TPSXSNZANCNFSM4HI7B5IA>
.
|
How exactly am I going to do this? I mean, if they are all in a single file, I can wrap them in a |
You could move the files into a subfolder of |
@boastful-squirrel Your suggestion also hides dead code warnings, are you sure it is not For reference: Here's what I did |
According to the official guide, you're supposed to make it |
Also please call it |
@svenstaro Is this what you suggested? Warnings didn't go anywhere: |
Looks exactly like rust-lang/rust#46379 Putting it under |
The workaround mentioned in the issue works btw but it does hide real dead code. Overall I'm not happy with this and I'm not sure what the best solution would be. |
I believe not marking a function |
The best solution at the moment in my opinion is to |
True, but sadly it doesn't make cargo stop compiling the file. For that, you'll need to do the I agree, for now, using |
Would writing a |
Well, it's not my claim, it's what's written in the docs. You can try, though. Let's get this merged. |
Not yet. |
I have moved @svenstaro Please review |
Actually putting stuff into
Since you're saying that you cannot reproduce this, what cargo version are you using? It might be worth reporting this upstream if this is a regression. |
Fix #85
An additional issue arises:
cargo test
warns me of unused items in helper module. This happens because the items are only used by test functions in test-only context. I don't know how to fix this other than#[allow(dead_code)]
.