Skip to content

Conversation

@aszyrej
Copy link
Collaborator

@aszyrej aszyrej commented Dec 15, 2025

First e2e-test for Redis.
Includes GET and SET commands, applying Redis heuristics.

.filter(command -> command.getType().shouldCalculateHeuristic())
.forEach(redisCommand -> {
RedisDistanceWithMetrics distanceWithMetrics = computeDistance(redisCommand, redisClient);
RedisDistanceWithMetrics distanceWithMetrics = computeDistance(redisCommand, (RedisClient) redisClient);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi. thx @aszyrej i think it is best if @jgaleotti gives first round of comments, and then, after updating, i ll give my pass. but one thing here that caught my eyes is: why turning RedisClient into Object reference if anyway you do a cast to (RedisClient) here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @arcuri82 . The reason why I'm using Object is just to be aligned with the solutions for Mongo and OpenSearch where they used Object for the clients. It's not necessary to keep it this way and since I have a dedicated class for encapsulating the client logic, I could refactor it and keep that class instead of Object.
I'll proceed with this if you agree.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason for using private Object mongoClient is that cannot have dependencies to actual Mongo code, and must do access via reflection. if for Redis you encapsulate all the code for reflection in your own RedisClient that is different from io.lettuce.core.RedisClient, then no point in storing it as an Object reference. Btw, for clarity, your own RedisClient could be renamed into ReflectionBasedRedisClient (or something like that)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @arcuri82, I've renamed that class into ReflectionBasedRedisClient as we discussed, and changed the type in RedisHandler.

@aszyrej aszyrej requested a review from arcuri82 December 23, 2025 23:02
@arcuri82
Copy link
Collaborator

hi @jgaleotti it would be best if you look at this PR first, and then, after you approve it, i review it as well

Copy link
Collaborator

@jgaleotti jgaleotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the use of string literals and the maximum distance value

@aszyrej aszyrej requested a review from jgaleotti January 10, 2026 16:38
Copy link
Collaborator

@jgaleotti jgaleotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes asked in pom.xml

@aszyrej aszyrej requested a review from jgaleotti January 13, 2026 00:23
Copy link
Collaborator

@jgaleotti jgaleotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No further changes from my side. Please request Andrea's revision.

@aszyrej
Copy link
Collaborator Author

aszyrej commented Jan 14, 2026

@arcuri82 would you review this PR and let me know if we're ready to merge? Thanks.

ReflectionBasedRedisClient connection = getRedisConnection();
redisHandler.setRedisClient(connection);

List<AdditionalInfo> list = getAdditionalInfoList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgaleotti i see this was done for Mongo and OpenSearch as well... but why? can you leave some comments to explain it? i m a bit confused of what is this handle on the init of the handler based on additional info of currently executed test case

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for pointing this out.
For Redis/OpenSearch, this is not right since there should be no handling for Redis/OpenSearch commands.
For Mongo, this is done for handling the expected classes to parse the document into. In other words, the call is to handle(MongoCollectionSchema) instead of handle(MongoFindCommand)
Could you remove this code @aszyrej ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also pushed a change to this branch adding a comment in SutController.initMongoHandler()

<parent>
<artifactId>evomaster-e2e-tests-spring</artifactId>
<groupId>org.evomaster</groupId>
<version>5.0.1-SNAPSHOT</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new relese was made yesterday. make sure to update all these values to latest 5.0.3-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants