This PR simplifies the probe-run snapshot tests by using the rstest macro. Additionally we update the dependencies used in the tests.
How to test the tests
These tests are ignored by default, since they require the hardware (nrf52840dk) to be present. You can run them locally by connecting your computer to the nrf52 and executing cargo test -- --ignored.
Reviewer notes
Please don't get intimidated by the number of files and lines changed. Most of the files are just renamed to work with rstest and the new name of the test file. The many deleted lines are because the stack overflow test got simplified in the past, but the output wasn't adapted yet. You should mainly focus on tests/snapshot.rs.
Remarks
Note that the panic_verbose test will fail in most cases. It's because this test output contains timing related numbers, which will slightly change from run to run. This also happened before this PR, therefore isn't a regression, but should be fixed in the future.
Note that updating serial_test pulls in many futures-* libraries, which seems unnecessary since we are not using any async functions. I've asked if that can be avoided: https://github.com/palfrey/serial_test/issues/73
Edit(1): Drop dependency update from this PR, in order to unblock it.
Edit(2): Add reviewer notes.
Edit(3): Add section on how to tests the tests and structure the PR description.
This PR simplifies the probe-run snapshot tests by using the
rstest
macro.Additionally we update the dependencies used in the tests.How to test the tests
These tests are ignored by default, since they require the hardware (
nrf52840dk
) to be present. You can run them locally by connecting your computer to the nrf52 and executingcargo test -- --ignored
.Reviewer notes
Please don't get intimidated by the number of files and lines changed. Most of the files are just renamed to work with
rstest
and the new name of the test file. The many deleted lines are because the stack overflow test got simplified in the past, but the output wasn't adapted yet. You should mainly focus ontests/snapshot.rs
.Remarks
Note that the
panic_verbose
test will fail in most cases. It's because this test output contains timing related numbers, which will slightly change from run to run. This also happened before this PR, therefore isn't a regression, but should be fixed in the future.Note that updatingserial_test
pulls in manyfutures-*
libraries, which seems unnecessary since we are not using any async functions. I've asked if that can be avoided: https://github.com/palfrey/serial_test/issues/73Edit(1): Drop dependency update from this PR, in order to unblock it. Edit(2): Add reviewer notes. Edit(3): Add section on how to tests the tests and structure the PR description.