-
Notifications
You must be signed in to change notification settings - Fork 104
encode_unsigned_1 #676
base: develop
Are you sure you want to change the base?
encode_unsigned_1 #676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch the unit tests to integration tests
@@ -0,0 +1,58 @@ | |||
#[cfg(all(not(target_arch = "wasm32"), test))] | |||
mod test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're moving away from unit tests and preferring writing integration tests in Erlang now under native_implemented/otp/tests/internal/lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, does that also mean that we're moving away from proptest as well?
How do I run these integration tests in local dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, for now. I think I figured out how to wire up and run the erlang integration tests.
I've migrated the tests to the integration testing pattern. Should the unit tests be removed entirely? That'd result in a loss of some coverage from the proptests, at least. Also, when doing these as integration tests, all of the ones that use big integer inputs are failing with |
FYI I'll ask about this PR in today's standup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three tests are failing for me:
---- lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_significant_trailing_zeros stdout ----
thread 'lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_significant_trailing_zeros' panicked at 'assertion failed: `(left == right)`
left: `""`,
right: `"<<64,0,0,0,0,0>>\n"`:
Commands:
cd /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp
"/Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/tests/_build/internal/lib/binary/encode_unsigned_1/when_big_int_encoded_bytes_have_significant_trailing_zeros/bin/when_big_int_encoded_bytes_have_significant_trailing_zeros"
stdout:
stderr: Backtrace (most recent call last):
File /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/src/binary/encode_unsigned_1.rs:13, in binary:encode_unsigned/1
Process (#PID<0.2.0>) exited abnormally.
badarg
Status code: 0
Signal: ', native_implemented/otp/tests/internal/lib/binary/encode_unsigned_1.rs:11:1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_zeros_in_the_middle stdout ----
thread 'lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_zeros_in_the_middle' panicked at 'assertion failed: `(left == right)`
left: `""`,
right: `"<<64,0,0,0,0,1>>\n"`:
Commands:
cd /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp
"/Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/tests/_build/internal/lib/binary/encode_unsigned_1/when_big_int_encoded_bytes_have_zeros_in_the_middle/bin/when_big_int_encoded_bytes_have_zeros_in_the_middle"
stdout:
stderr: Backtrace (most recent call last):
File /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/src/binary/encode_unsigned_1.rs:13, in binary:encode_unsigned/1
Process (#PID<0.2.0>) exited abnormally.
badarg
Status code: 0
Signal: ', native_implemented/otp/tests/internal/lib/binary/encode_unsigned_1.rs:23:1
---- lib::binary::encode_unsigned_1::with_smallest_big_int stdout ----
thread 'lib::binary::encode_unsigned_1::with_smallest_big_int' panicked at 'assertion failed: `(left == right)`
left: `""`,
right: `"<<64,0,0,0,0,0>>\n"`:
Commands:
cd /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp
"/Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/tests/_build/internal/lib/binary/encode_unsigned_1/with_smallest_big_int/bin/with_smallest_big_int"
stdout:
stderr: Backtrace (most recent call last):
File /Users/luke.imhoff/github/lumen/lumen/native_implemented/otp/src/binary/encode_unsigned_1.rs:13, in binary:encode_unsigned/1
Process (#PID<0.2.0>) exited abnormally.
badarg
Status code: 0
Signal: ', native_implemented/otp/tests/internal/lib/binary/encode_unsigned_1.rs:2:1
failures:
lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_significant_trailing_zeros
lib::binary::encode_unsigned_1::when_big_int_encoded_bytes_have_zeros_in_the_middle
lib::binary::encode_unsigned_1::with_smallest_big_int
test result: FAILED. 5 passed; 3 failed; 0 ignored; 0 measured; 473 filtered out; finished in 14.28s
Running target/debug/deps/test-08005e5a54fe292e
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass '-p liblumen_otp --test internal'
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.
Since those involve large big int literals it could be something with the literal encoding in the compile. If that's the case, there's nothing for you to do @mlwilkerson and we'll have to fix that bug. Might be able to work around it with shifts.
d92d24a
to
7da47da
Compare
8d0dd93
to
213b3f3
Compare
a6a14cb
to
6d51d5c
Compare
closes #671