redismodule-rs
redismodule-rs copied to clipboard
Using RedisString::create(....) and running cargo test throws panicked at 'called `Option::unwrap()` on a `None` value
Hi,
I've upgraded my module to redismodule-rs 0.26.0
.
When upgrading I had to make changes and use RedisString::create(...)
function.
When I ran cargo build
the build passed.
When I ran cargo test --features test --all --all-targets --verbose
the following error appeared on each test that used RedisString:create(...)
:
---- get_sets_single stdout ----
thread 'get_sets_single' panicked at 'called `Option::unwrap()` on a `None` value', /home/danitseitlin/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-module-0.26.0/src/redismodule.rs:107:60
Here is an example for the test:
#[test]
fn get_sets_single() {
let ctx = Context::dummy().ctx;
let args = vec![RedisString::create(ctx, "member1"), RedisString::create(ctx, "10"), RedisString::create(ctx, "20")];
let sets = get_sets(args.into_iter());
let sets = sets.expect("one member");
assert_eq!(
sets.0,
vec![Set {
member: "member1".to_string(),
min_score: 10,
max_score: 20,
}]
);
}
I hope you can help, thanks ✌🏽
@danitseitlin do you have such branch that you migrated to 0.26?
@danitseitlin Maybe init of redis module APIs is not done since redis-server is not launched? See this example
@oshadmi The following tests are unit tests, would your suggestion still be relevant?
@oshadmi @gkorland Hi, is there an progress with the issue?