Skip to content

Redis actions extension. Hash commands.#1550

Open
aszyrej wants to merge 12 commits into
masterfrom
redis-e2e-extension
Open

Redis actions extension. Hash commands.#1550
aszyrej wants to merge 12 commits into
masterfrom
redis-e2e-extension

Conversation

@aszyrej
Copy link
Copy Markdown
Collaborator

@aszyrej aszyrej commented May 19, 2026

Redis hash commands HGET and HGETALL are now included in the data generation process, generating RedisHsetActions.

Since RedisDbAction has now multiple concrete subclasses, the impact collection system was failing to match actions by class name across mutations. Added getImpactGroupKey() to Action — overridden in RedisDbAction to return a shared key for all its subtypes — and updated ImpactUtils and EvaluatedIndividual to use it instead of the raw class name.

@aszyrej aszyrej requested a review from jgaleotti May 19, 2026 18:54
Comment thread core/src/main/kotlin/org/evomaster/core/output/RedisWriter.kt
Comment thread core/src/main/kotlin/org/evomaster/core/redis/RedisHsetAction.kt Outdated
Comment thread core/src/main/kotlin/org/evomaster/core/redis/RedisSetAction.kt
Comment thread core/src/main/kotlin/org/evomaster/core/redis/RedisSetAction.kt
Comment thread core/src/main/kotlin/org/evomaster/core/redis/RedisHsetAction.kt Outdated
@aszyrej aszyrej requested a review from jgaleotti May 22, 2026 14:48
Comment thread core/src/main/kotlin/org/evomaster/core/output/RedisWriter.kt Outdated
@aszyrej aszyrej requested a review from jgaleotti May 28, 2026 16:20
@jgaleotti jgaleotti requested a review from arcuri82 May 28, 2026 16:59
.mapNotNull { cmd ->
when (cmd.command) {
"GET" -> {
val keyGene = StringGene("key", cmd.key)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hi! bit confused here. is keyGene supposed to be a constant? or something that be modified during the search? In former case, shouldn't use a gene for it, but directly a val stirng in the action. In latter case, the value cmd.key will be lost as soon as the action is initialized

"GET" -> {
val keyGene = StringGene("key", cmd.key)
val valueGene = StringGene("value").also {
it.randomize(randomness, false)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

those calls to it.randomize might be redundant, as might be called again when intializing the action

}
"KEYS" -> {
val keyGene = StringGene("key").also {
it.addSpecializations("key",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is a bit confusing. specialzations is for Taint Analysis handling. if here you already know it is going to be a regex, why not using a RegexGene directly? Or is just a matter of typing in the action? note that specialization can be deactivated during the search

it.addSpecializations("key",
listOf(StringSpecializationInfo(StringSpecialization.REGEX_WHOLE, cmd.pattern)),
randomness,
updateGlobalInfo = false, // should this be false?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes. otherwise it crash, as you are adding a specialization to a gene that is not mount yet inside an Individual

valueGene = valueGene
)
}
else -> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

add a LoggingUtils.uniqueWarn here, as well as a assert(false), to make it crash if it happens in any test case

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.

3 participants