-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backwards-compatability tests #506
Comments
While thinking about it again I thought that it is already valuable to know how backwards-comaptible our output is. So keeping the tests around gives us this certainty if someone ever comes around and wants to know this. @jonas-schievink what are your thoughts? |
The purpose of those tests was to make sure that the earliest semver-compatible defmt release can still decode what the current git version produces. The result here does not necessarily have to match 1-to-1 (so the changes to the output were fine), but I can see that that does fail the tests at the moment. Not totally sure how to do this better, maybe we just have to check that the decoder didn't fail? |
So I think it would work if we just always install |
I think we'll need to revise those backcompat tests after #287 is implemented because after that the behavior is going to be: breaking changes in the encoding / decoding are allowed in patch versions (but breaking API changes are not); using defmt 0.3.x anywhere in the dep graph = you use the latest patch version of defmt = no breakage in code because of the 'no breaking API changes'; probe-run will error (or maybe it will work but not print any logs?) and tell you to upgrade it if it sees a defmt patch version newer than what it supports. so using the v0.3.x encoder with the 0.3.0 decoder (which the backcompat tests tested) is not something that's going to be part of the workflow anymore |
543: `CI`: Temporarily drop backward-compatibility check r=jonas-schievink a=Urhengulas Temporarily drop backward-compatibility check (they aren't currently fulfilling their job anyways). They will get added back in a different form. See #506. Co-authored-by: Johann Hemmann <[email protected]>
After #287 we should additionally to the output-format also check backwards-incompatible changes to (quoted from the PR): "the symbol naming scheme, the symbol and section layout, the data encoding / wire format". |
I think what we need to do here to test for changes that break backwards compatibility (after #540) is, at a high level:
By "old version" of how to install an "old version" of how to use an "old version" of $ CARGO_TARGET_THUMBV7M_NONE_EABIHF_RUNNER=path/to/binary cargo run --bin hello Note that you need to specify the target triple in UPPERCASE letters. What do we when this
|
592: xtask: add backward compability test r=Urhengulas a=japaric **UPDATE**: I have left the defmt-version as it is since we have not made a defmt 0.3.0 release. I have also tweaked the defmt-test to not exit with non-zero exit code and remove some test-specific logic from xtask. See individual commits messages for details. --- implements #506 (comment) closes #506 I tested this against c7b20d5 (I called that `defmt-version-3` locally) and found that a bitflags change broke the wire format. Not a big deal but I guess we should bump the version to 4? cc `@jonas-schievink` ``` console bitflags (dev) Error: malformed bitflags value string 'Flags::0::FLAG_0' ``` the other thing that I found out is that some of the snapshot test exit with non-zero code: ``` console defmt-test (dev) INFO (1/7) running `change_init_struct`... INFO (2/7) running `test_for_changed_init_struct`... INFO (3/7) running `assert_true`... INFO (4/7) running `assert_imported_max`... INFO (5/7) running `result`... INFO (6/7) running `should_error`... INFO (7/7) running `fail`... ERROR panicked at '`#[should_error]` test failed with outcome: Ok(this should have returned `Err`)' Timer with period zero, disabling ``` `cargo xtask test-snapshot` is not checking the exit code; it only looks at stdout so that non-zero exit code is not a problem for those tests. in the backcompat test we want to look for decoding errors, not at stdout, so I was using the exit code of `cargo run` but this `defmt-test` is problematic with that check. Co-authored-by: Jorge Aparicio <[email protected]>
Status update (2021-09-10) needs implementation. see notes in #506 (comment)
#503 broke the backwards-compatability tests and since we don't guarantee backwards-compatability we kinda disabled them by just running with the current decoder.
My question is now if we should just remove these tests all together since we don't guarantee it anyways, or if we should pin it to the current version of the decoder?
I am fine with both with a slight preference for removing.
The text was updated successfully, but these errors were encountered: