redismodule-rs
redismodule-rs copied to clipboard
Simplify the integration test code
@MeirShpilraien, would you please review once again?
@iddm @MeirShpilraien
Why not move the change into utils.rs
and expose it as part of the crate?
It would allow users to use the code to test their modules.
@iddm @MeirShpilraien Why not move the change into
utils.rs
and expose it as part of the crate? It would allow users to use the code to test their modules.
We need it just in one single file, there is no need to create a file of 20 lines of code to just fully import it later from within another file. Doesn't really contribute to the cleanliness of the code here. If at least we had two files for that, - sure.
We need it just in one single file, there is no need to create a file of 20 lines of code to just fully import it later from within another file. Doesn't really contribute to the cleanliness of the code here. If at least we had two files for that, - sure.
I agree but also I think that its a nice idea that users will be able to test their module with rust and run it with cargo test
. I believe that if we want to do it, we should make a crate that will expose all the needed functionality (setting up Redis server with the module and with/without replication or on cluster mode, aof enabled/disabled, and probably there are much more things that we want to do). That said, all this functionalities are already exists on RLTest so maybe its not worth it?
We need it just in one single file, there is no need to create a file of 20 lines of code to just fully import it later from within another file. Doesn't really contribute to the cleanliness of the code here. If at least we had two files for that, - sure.
I agree but also I think that its a nice idea that users will be able to test their module with rust and run it with
cargo test
. I believe that if we want to do it, we should make a crate that will expose all the needed functionality (setting up Redis server with the module and with/without replication or on cluster mode, aof enabled/disabled, and probably there are much more things that we want to do). That said, all this functionalities are already exists on RLTest so maybe its not worth it?
This isn't something specific to Redis, redismodule (this crate) or redis modules, or Rust in general. Anyone can write their own tests. But, I had already forgotten we had the utils.rs
file there. Now that I know it is there, it makes sense to move it there. Perhaps, I had already done it this way a long time ago before even this PR, but we closed it for another reason, cuz now I remember moving the things into it. So, yes, I'll move it to the utils.rs
.