This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
334: Simplify snapshot tests r=justahero a=Urhengulas 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. Co-authored-by: Urhengulas <johann.hemmann@code.berlin> Co-authored-by: Johann Hemmann <johann.hemmann@code.berlin>
- Loading branch information
Showing
12 changed files
with
61 additions
and
4,438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...est__successful_run_has_no_backtrace.snap → ...se_1_successful_run_has_no_backtrace.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
2 changes: 1 addition & 1 deletion
2
tests/snapshots/test__raw_encoding.snap → ...pshots/snapshot__case_2_raw_encoding.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
2 changes: 1 addition & 1 deletion
2
...successful_run_can_enforce_backtrace.snap → ...successful_run_can_enforce_backtrace.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
2 changes: 1 addition & 1 deletion
2
...__stack_overflow_is_reported_as_such.snap → ...4_stack_overflow_is_reported_as_such.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
2 changes: 1 addition & 1 deletion
2
...hots/test__panic_is_reported_as_such.snap → ...ot__case_5_panic_is_reported_as_such.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
24 changes: 12 additions & 12 deletions
24
tests/snapshots/test__panic_verbose.snap → ...shots/snapshot__case_6_panic_verbose.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uccessful_run_can_suppress_backtrace.snap → ...uccessful_run_can_suppress_backtrace.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
18 changes: 18 additions & 0 deletions
18
tests/snapshots/snapshot__case_8_stack_overflow_can_suppress_backtrace.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
(HOST) INFO flashing program (2 pages / 8.00 KiB) | ||
(HOST) INFO success! | ||
──────────────────────────────────────────────────────────────────────────────── | ||
INFO ack(m=10, n=10, SP=20037b88) | ||
INFO ack(m=10, n=9, SP=2002fb60) | ||
INFO ack(m=10, n=8, SP=20027b38) | ||
INFO ack(m=10, n=7, SP=2001fb10) | ||
INFO ack(m=10, n=6, SP=20017ae8) | ||
INFO ack(m=10, n=5, SP=2000fac0) | ||
INFO ack(m=10, n=4, SP=20007a98) | ||
──────────────────────────────────────────────────────────────────────────────── | ||
(HOST) ERROR the program has overflowed its stack | ||
|
2 changes: 1 addition & 1 deletion
2
...__ctrl_c_by_user_is_reported_as_such.snap → ...__ctrl_c_by_user_is_reported_as_such.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
source: tests/test.rs | ||
source: tests/snapshot.rs | ||
expression: run_result.output | ||
|
||
--- | ||
|
Oops, something went wrong.