-
Notifications
You must be signed in to change notification settings - Fork 120
Consume Cassandra Heuristics and Generate CQL Data #1795
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
Merged
arcuri82
merged 10 commits into
master
from
feature/cassandra-heuristics-consumption-data-generation
Oct 5, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
48d0379
Consume cassandra heuristics during search
gonzalotguerrero bd98a3c
Generate cassandra data from failed queries
gonzalotguerrero 13c820b
Add missing config options and update options.md
gonzalotguerrero bd845fd
Add javadoc
gonzalotguerrero b74cb47
Merge of master
gonzalotguerrero a690152
Regenerate options.md
gonzalotguerrero cd7b19c
Update branch
gonzalotguerrero af93715
Address PR comments
gonzalotguerrero 1363dfe
Merge of master
gonzalotguerrero d8d8930
Restore val name
gonzalotguerrero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -839,6 +839,16 @@ class EMConfig { | |
| "'extractDynamoDbExecutionInfo'") | ||
| } | ||
|
|
||
| if (shouldGenerateCassandraData() && !heuristicsForCassandra) { | ||
| throw ConfigProblemException("Cannot generate Cassandra data if you did not enable " + | ||
| "collecting heuristics with 'heuristicsForCassandra'") | ||
| } | ||
|
|
||
| if (shouldGenerateCassandraData() && !extractCassandraExecutionInfo) { | ||
| throw ConfigProblemException("Cannot generate Cassandra data if you did not enable " + | ||
| "extracting Cassandra execution info with 'extractCassandraExecutionInfo'") | ||
| } | ||
|
|
||
| if (enableTrackEvaluatedIndividual && enableTrackIndividual) { | ||
| throw ConfigProblemException("When tracking EvaluatedIndividual, it is not necessary to track individual") | ||
| } | ||
|
|
@@ -1088,6 +1098,8 @@ class EMConfig { | |
|
|
||
| fun shouldGenerateNeo4jData() = isUsingAdvancedTechniques() && generateNeo4jData | ||
|
|
||
| fun shouldGenerateCassandraData() = isUsingAdvancedTechniques() && generateCassandraData | ||
|
|
||
| fun dtoSupportedForPayload() = dtoForRequestPayload && couldSupportDtoForPayload() | ||
|
|
||
| fun couldSupportDtoForPayload() = problemType == ProblemType.REST && outputFormat.isJavaOrKotlin() | ||
|
|
@@ -2096,6 +2108,12 @@ class EMConfig { | |
| @DependsOnFalseFor("blackBox") | ||
| var heuristicsForNeo4j = false | ||
|
|
||
| @Experimental | ||
| @Cfg("Tracking of Cassandra commands to improve test generation") | ||
| @DependsOnFalseFor("blackBox") | ||
| @DependsOnTrueFor("extractCassandraExecutionInfo") | ||
| var heuristicsForCassandra = false | ||
|
|
||
| @Cfg("Enable extracting SQL execution info") | ||
| @DependsOnFalseFor("blackBox") | ||
| var extractSqlExecutionInfo = true | ||
|
|
@@ -2119,6 +2137,11 @@ class EMConfig { | |
| @DependsOnFalseFor("blackBox") | ||
| var extractNeo4jExecutionInfo = false | ||
|
|
||
| @Experimental | ||
| @Cfg("Enable extracting Cassandra execution info") | ||
| @DependsOnFalseFor("blackBox") | ||
| var extractCassandraExecutionInfo = false | ||
|
|
||
| @Experimental | ||
| @Cfg("Enable EvoMaster to generate SQL data with direct accesses to the database. Use the Z3 SMT solver") | ||
| @DependsOnFalseFor("blackBox") | ||
|
|
@@ -2190,6 +2213,12 @@ class EMConfig { | |
| @DependsOnTrueFor("extractNeo4jExecutionInfo") | ||
| var generateNeo4jData = false | ||
|
|
||
| @Experimental | ||
| @Cfg("Enable EvoMaster to generate Cassandra data with direct accesses to the database") | ||
| @DependsOnFalseFor("blackBox") | ||
| @DependsOnTrueFor("extractCassandraExecutionInfo") | ||
| var generateCassandraData = false | ||
|
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. shouldn't have a |
||
|
|
||
| @Cfg("When generating SQL data, how many new rows (max) to generate for each specific SQL Select") | ||
| @Min(1.0) | ||
| @DependsOnFalseFor("blackBox") | ||
|
|
||
23 changes: 23 additions & 0 deletions
23
core/src/main/kotlin/org/evomaster/core/database/cassandra/CassandraExecution.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package org.evomaster.core.database.cassandra | ||
|
|
||
| import org.evomaster.client.java.controller.api.dto.database.execution.CassandraExecutionsDto | ||
| import org.evomaster.client.java.controller.api.dto.database.execution.CassandraFailedQuery | ||
|
|
||
| /** | ||
| * Encapsulates every CQL query that matched no row during an execution, as a data-generation hint. | ||
| */ | ||
| class CassandraExecution( | ||
| /** | ||
| * One entry per CQL query that matched no row, | ||
| * each with the table it targeted and the shape of its rows. | ||
| */ | ||
| val failedQueries: MutableList<CassandraFailedQuery>? | ||
| ) { | ||
|
|
||
| companion object { | ||
|
|
||
| fun fromDto(dto: CassandraExecutionsDto?): CassandraExecution { | ||
| return CassandraExecution(dto?.failedQueries?.toMutableList()) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't have a
@DependsOnTrueForforextractSqlExecutionInfo?