-
Notifications
You must be signed in to change notification settings - Fork 109
Redis data generation. #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis data generation. #1487
Changes from all commits
bbd0b8d
283c947
0ffc9ee
bbf4c03
22ad83d
8611b5a
7d65fb7
55f8eb6
85f5bdf
a76d6ce
b8a6962
278a188
889d451
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package org.evomaster.client.java.controller.api.dto.database.execution; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Each time a Redis command is executed, we keep track of those that return no data. | ||
| * This class summarizes every failed command in a given execution. | ||
| */ | ||
| public class RedisExecutionsDto { | ||
|
|
||
| public RedisExecutionsDto() {} | ||
|
|
||
| public List<RedisFailedCommand> failedCommands = new ArrayList<>(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package org.evomaster.client.java.controller.api.dto.database.execution; | ||
|
|
||
| /** | ||
| * Each time a Redis command is executed and returns no data, we keep track of which keys were involved, | ||
| * as well as relevant information such as the command type. | ||
| */ | ||
| public class RedisFailedCommand { | ||
|
aszyrej marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * Command keyword. Corresponds to a RedisCommandType label. | ||
| */ | ||
| public String command; | ||
|
|
||
| /** | ||
| * Command type. Corresponds to a RedisCommandType dataType. | ||
| */ | ||
| public String type; | ||
|
|
||
| /** | ||
| * Key involved. Could be null if the command does not have a key in the arguments. For example: KEYS (pattern). | ||
| */ | ||
| public String key; | ||
|
jgaleotti marked this conversation as resolved.
|
||
|
|
||
| public RedisFailedCommand() {} | ||
|
|
||
| public RedisFailedCommand(String command, String key, String type) { | ||
| this.command = command; | ||
| this.key = key; | ||
| this.type = type; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package org.evomaster.client.java.controller.api.dto.database.operations; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Class used to execute Redis commands. | ||
| * Each item in the insertions list corresponds to a command to be executed. | ||
| */ | ||
| public class RedisDatabaseCommandsDto { | ||
| public List<RedisInsertionDto> insertions = new ArrayList<>(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package org.evomaster.client.java.controller.api.dto.database.operations; | ||
|
|
||
| /** | ||
| * Contains data to be inserted into Redis. | ||
| */ | ||
| public class RedisInsertionDto { | ||
|
jgaleotti marked this conversation as resolved.
|
||
|
|
||
| /** The Redis key.*/ | ||
| public String key; | ||
|
|
||
| /** The serialized value to set for that key. */ | ||
| public String value; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package org.evomaster.client.java.controller.api.dto.database.operations; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * The execution result of {@link RedisDatabaseCommandsDto} that performs insertions. | ||
| */ | ||
| public class RedisInsertionResultsDto { | ||
|
aszyrej marked this conversation as resolved.
|
||
|
|
||
| public RedisInsertionResultsDto() {} | ||
|
|
||
| /** | ||
| * Whether the insertion at the index of a sequence of Redis insertions (i.e., {@link RedisDatabaseCommandsDto#insertions}) | ||
| * executed successfully. | ||
| */ | ||
| public List<Boolean> executionResults; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -522,6 +522,14 @@ public final void setExecutingInitMongo(boolean executingInitMongo) { | |
| ExecutionTracer.setExecutingInitMongo(executingInitMongo); | ||
| } | ||
|
|
||
| @Override | ||
| public final void setExecutingInitRedis(boolean executingInitRedis) { | ||
| checkInstrumentation(); | ||
| serverController.setExecutingInitRedis(executingInitRedis); | ||
| // sync executingInitRedis on the local ExecutionTracer | ||
| ExecutionTracer.setExecutingInitRedis(executingInitRedis); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are those functions calling
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I missed these copy-paste errors in my review. And yes, there should be a test failing due to this.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I apologize for this copy paste error, already changed the code. Since we do not generate heuristics on insertion commands, this didn't affect the logic for Redis data generation. |
||
|
|
||
| @Override | ||
| public final void setExecutingAction(boolean executingAction){ | ||
| checkInstrumentation(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.