hundreds-father-404
01/12/2021, 4:41 PM#[cfg(test)]
to a test support function on WorkunitStore
would not actually compile when running ./cargo test
?
When I have the attribute, I get
no function or associated item namedBut when I removefound for structsetup_for_tests
in the current scope.WorkunitStore
#[cfg(test)]
, it works.
I'm wondering if I'm missing some gotcha, I'm not finding much.
https://github.com/pantsbuild/pants/pull/11436/files#diff-230c46e3890a73dee860295c27128ef3aadc239d2db0f6bcd1ac67db038385efR757enough-analyst-54434
01/12/2021, 5:03 PMenough-analyst-54434
01/12/2021, 5:05 PMhundreds-father-404
01/12/2021, 5:09 PMYou get that error message in what code?When running any of the tests that call our new helper function. Those tests are colocated in the same directory so I don't think integration tests? Either way, this probably isn't worth the trouble
enough-analyst-54434
01/12/2021, 5:14 PMhundreds-father-404
01/12/2021, 5:15 PMworkunit_store/src
..yeah, that makes sense. Good point. Thanks for figuring that out, will revertaverage-vr-56795
01/12/2021, 5:56 PM#[cfg(test)]
only takes affect within a single crateenough-analyst-54434
01/12/2021, 6:07 PMenough-analyst-54434
01/12/2021, 6:10 PMaverage-vr-56795
01/12/2021, 6:15 PMaverage-vr-56795
01/12/2021, 6:16 PMenough-analyst-54434
01/12/2021, 6:21 PM