massa icon indicating copy to clipboard operation
massa copied to clipboard

Problem with testing feature in POS exports

Open gterzian opened this issue 2 years ago • 3 comments

When building the crate with the testing feature enabled, I get the below error, even though the method is actually implemented with that feature flag...

error[E0046]: not all trait items implemented, missing: `get_entire_selection`
  --> massa-pos-worker/src/controller.rs:31:1
   |
31 | impl SelectorController for SelectorControllerImpl {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `get_entire_selection` in implementation
   |
   = help: implement the missing item: `fn get_entire_selection(&self) -> VecDeque<(u64, HashMap<Slot, Selection>)> { todo!() }`

gterzian avatar Sep 15 '22 09:09 gterzian

Temporary fix: https://github.com/massalabs/massa/pull/3014/commits/1360cee15a08d08fc7c83d3b448efa3e2cadc3b6

gterzian avatar Sep 15 '22 09:09 gterzian

I think there is a just a crate that do not pass the feature flag to PoS exports. From which folder you are trying to run the tests ? The best is always to run them from root with cargo flag to run only one test in a specific library such as :

cargo test --package massa_protocol_worker --lib -- tests::in_block_operations_scenarios::test_protocol_sends_blocks_with_operations_to_consensus --exact --nocapture 

AurelienFT avatar Sep 16 '22 10:09 AurelienFT

I get the error also when running cargo test --package massa_consensus_worker --lib -- test_inter_cycle_batch_finalization --exact --nocapture

but not if running just cargo test.

gterzian avatar Sep 20 '22 08:09 gterzian

Tests built from root with features testing now works well. Closing

AurelienFT avatar Oct 26 '22 14:10 AurelienFT