ref(clippy): Enable tests-outside-test-module lint#2736
ref(clippy): Enable tests-outside-test-module lint#2736szokeasaurusrex merged 1 commit intomasterfrom
tests-outside-test-module lint#2736Conversation
|
I recommend reviewing this PR with the "hide whitespace differences" option enabled, as most of the diff is just whitespace change |
Enable the [`tests-outside-test-module`](https://rust-lang.github.io/rust-clippy/master/index.html#tests_outside_test_module) Clippy lint, and fix violations. This lint will enforce the convention that `#[test]` items must be placed within a `#[cfg(test)]` module.
ae468aa to
409edad
Compare
There was a problem hiding this comment.
This is related to snapshot testing used in this crate (it is called insta in case you are interested).
Since we moved the functions into a different module, the file names need to be updated. For most of the files, it was a simple rename, but for this one, the expression on line 3 appears to have had some changes, so git recognized it as a deletion of this file, and an adding of the file with the new path
There was a problem hiding this comment.
I see, I was wondering why the tests would fail with this.
Yeah I saw insta and I think we should use it in the SDK too, I have an issue here getsentry/sentry-rust#875
There was a problem hiding this comment.
I honestly had no clue what insta was before doing this PR and seeing these failures in CI. We don't use it very widely in Sentry CLI. Maybe we should; although, I admittedly am unsure what it is useful for. I only did the minimal amount of research on it to fix the tests and move on 🤷
|
Oh nice, thanks for doing this! |

Enable the
tests-outside-test-moduleClippy lint, and fix violations.This lint will enforce the convention that
#[test]items must be placed within a#[cfg(test)]module.