Add smoke tests that verify the correct behavior of the sessions endpoint when using Spring Session with MongoDB and Redis.
See gh-28291
Comment From: mbhave
Thanks for the PR, @avillalain. Instead of the embedded servers we might be able to use @TestContainers
. There is an example of this for MongoDB and Redis. Can you make this change?
Regarding the WebSession
comment in #28291, that's a good point. I had not thought of adding equivalent smoke tests for WebSession
. We have an existing one that uses MongoDB by default. We can enhance that to test actuator integration and add a separate one for Redis. We can definitely try and help figure out why something isn't working.
Comment From: avillalain
Sure I can update the PR to account for the test containers, I saw some others were using the embedded approach and ended up following that route to keep consistency. I'll update the PR tomorrow with those changes.
I'll look into what you are point out for the web session too. Thanks
Comment From: vpavic
We can enhance that to test actuator integration and add a separate one for Redis.
There's no Actuator integration for WebSession
as Spring Session does not (yet) offer the reactive equivalent of FindByIndexNameSessionRepository
.
Comment From: avillalain
That explains why it wasn't working in my tests, I didn't know about that but I remember seeing some comments around this in some other issues, thanks, I'll deal with the changes to include Test containers instead of the embedded approach. I don't have that much experience on the reactive side of things
Comment From: avillalain
@vpavic also is there an issue for the web session integration?
Comment From: vpavic
There's #10827 but it's blocked until Spring Session provides the reactive equivalent of FindByIndexNameSessionRepository
together with its first implementation.
Comment From: mbhave
Thanks @vpavic! I'd forgotten about that issue!
Comment From: avillalain
Thanks @mbhave for all the feedback provided, I finished updating the PR. It is now using test containers.
Quick question @vpavic is the issue you mentioned something complicated, would it be a suitable first timer kind of issue? I basically am fishing for another issue considering this is done in case there are no additional feedback.
@mbhave In case the issue is not suitable for a first timer, what could be another issue I could grab?
Thanks for your help and support
Comment From: mbhave
Thanks @avillalain. The Spring Boot issue that Vedran linked is currently blocked on one in Spring Session. If you're looking for more issues to work on this issue could be a good one. We can continue the discussion on that issue if you have any questions about it.
Comment From: avillalain
@mbhave @vpavic Is the Spring Session issue one that a newbie can work on? I might be interested on that one if possible since it's related, and I feel want to close the loop on the web session smoke tests
Comment From: mbhave
@avillalain It would be better to ask on the Spring Session issue tracker and the Spring Session team can guide you from there.
Comment From: mbhave
@avillalain Thanks for making your first contribution to Spring Boot. This has been merged into main
along with a minor polish commit.