Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Simplify snapshot tests #334

Merged
merged 6 commits into from
Jul 27, 2022
Merged

Simplify snapshot tests #334

merged 6 commits into from
Jul 27, 2022

Conversation

Urhengulas
Copy link
Member

@Urhengulas Urhengulas commented Jul 25, 2022

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: palfrey/serial_test#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.

@Urhengulas Urhengulas changed the title Simplify hardware in loop tests Simplify hardware in the loop tests Jul 25, 2022
@Urhengulas Urhengulas force-pushed the update-hardware-in-loop-tests branch from 0f49115 to 2b902d5 Compare July 26, 2022 08:29
@Urhengulas Urhengulas marked this pull request as ready for review July 26, 2022 08:31
@Urhengulas
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Jul 26, 2022
@Urhengulas Urhengulas changed the title Simplify hardware in the loop tests Simplify snapshot tests Jul 26, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors bot commented Jul 26, 2022

try

Build succeeded:

Copy link
Contributor

@justahero justahero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Urhengulas
Copy link
Member Author

bors r=justahero

@bors
Copy link
Contributor

bors bot commented Jul 27, 2022

Build succeeded:

@bors bors bot merged commit 96dec03 into main Jul 27, 2022
@bors bors bot deleted the update-hardware-in-loop-tests branch July 27, 2022 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants