massa icon indicating copy to clipboard operation
massa copied to clipboard

CI not detecting errors in doc-tests triggered by the testing feature

Open Ben-PH opened this issue 2 years ago • 0 comments

Describe the bug

As mentioned here, it would seem that running cargo test or cargo test --doc misses checks that are called behind #[cfg(any(test, feature = "testing"))] (Same behavior if doctest is included in the any

To Reproduce Steps to reproduce the behavior:

  1. checkout this commit: 50557d4
  2. cd into massa-consensus-exports
  3. cargo test --doc - no error
  4. cargo test -F testing --doc - error raised
  5. view the CI history to see that CI for commit 50557d4 passed all checks here

Expected behavior

ideally, cargo test --doc runs code that matches the test cfg

practically, change CI to include the -F testing arg when appropriate

Ben-PH avatar Jan 12 '23 12:01 Ben-PH