Skip to content
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

Replace hardcoded percentages with values from a file #27

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
922b9af
add RandomConfigs class with default values and applied to the Genera…
hmeriann Aug 22, 2024
88949bc
add a class for random numbers configuraion
hmeriann Sep 3, 2024
1632858
change statement generator to work with the RandomsConfig
hmeriann Sep 3, 2024
aaac78c
rename randoms config
hmeriann Sep 4, 2024
c1506c5
mention random_nums_config files in the CMakes
hmeriann Sep 4, 2024
f602008
a json string gets parsed
hmeriann Sep 11, 2024
e08843b
parseJSONMap and initialise RandomNumsConfig with the custom values f…
hmeriann Sep 12, 2024
f629ec1
Merge remote-tracking branch 'upstream/main' into random-values-from-…
hmeriann Sep 12, 2024
fa89b25
fix paths to the reusable workflows, since they were moved to the .wo…
hmeriann Sep 12, 2024
6751d00
Merge branch 'main' into random-values-from-file
hmeriann Sep 13, 2024
11c5910
add randoms_config_handle to fuzzyduck
hmeriann Sep 13, 2024
566aff3
add config file
hmeriann Sep 13, 2024
87d6a03
FileSystem::ReadFile uses reads the file with all the new line symbol…
hmeriann Sep 13, 2024
de5cada
pass config file path as randoms_config_filepath parameter
hmeriann Sep 13, 2024
ce877c4
turn the RandomNumsConfig into an unorderdered_map<percentages_enum, …
hmeriann Sep 24, 2024
38757a5
rename to RandomPercentagesEnum
hmeriann Sep 24, 2024
26ba5ec
fixed missing values
hmeriann Sep 24, 2024
7275d9a
GetDefaultConfig() instead of throwing an exception when the file wit…
hmeriann Sep 24, 2024
ad51bdd
do not declare a variable for config again
hmeriann Sep 25, 2024
1430522
remove file handling, because it's being handled by yyjson_read_file
hmeriann Sep 25, 2024
3d395fd
add randoms_config_filepath to scripts/run_fuzzer.py
hmeriann Sep 25, 2024
4930d43
naive way to parse nested config.json to a map
hmeriann Sep 26, 2024
fb32a9d
config_nested.json file
hmeriann Sep 26, 2024
73b1cf1
parseJson recursively
hmeriann Sep 26, 2024
58d4908
a test file
hmeriann Sep 26, 2024
2b9ae4d
clean up
hmeriann Sep 26, 2024
f8aea67
set values of missing in the config file statement types to 0
hmeriann Sep 26, 2024
5e5e7ad
add missing quote
hmeriann Sep 27, 2024
0ddd49c
update the config file with almost all randoms
hmeriann Sep 27, 2024
7ada4b3
update src/include/random_nums_config.hpp to align with the config
hmeriann Sep 27, 2024
4cfe8c4
update StringToRandomPercentagesEnum in the src/random_nums_config.cpp
hmeriann Sep 27, 2024
ea50779
config_nested.json with all the default values
hmeriann Sep 30, 2024
c3c7725
src/include/random_nums_config.hpp corrected names
hmeriann Sep 30, 2024
ebe03d5
pass config to the statement generator
hmeriann Sep 30, 2024
5b8f652
rename some values
hmeriann Sep 30, 2024
628f2d8
remove duplicating line
hmeriann Sep 30, 2024
1a1ff8a
make RandomNumsConfig class
hmeriann Oct 3, 2024
ef48353
limit count of generated set operations
hmeriann Oct 10, 2024
3cd1bfb
set percentage to setop
hmeriann Oct 11, 2024
db0645b
add more values from the config file
hmeriann Oct 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add config file
hmeriann committed Sep 13, 2024
commit 566aff392fd29eaea8090a4d3e38db0ecfc42c3c
8 changes: 8 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"select_percentage": "70",
"attach_percentage": "20",
"attach_use_percentage": "80",
"detach_percentage": "15",
"set_percentage": "5",
"delete_percentage": "25"
}
2 changes: 1 addition & 1 deletion src/statement_generator.cpp
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ std::shared_ptr<GeneratorContext> StatementGenerator::GetDatabaseState(ClientCon

unique_ptr<SQLStatement> StatementGenerator::GenerateStatement() {

string file_path = "test/config_copy.json";
string file_path = "config.json";
RandomNumsConfig config = RandomNumsConfig(file_path);
if (RandomPercentage(config.select_percentage)) {
return GenerateStatement(StatementType::SELECT_STATEMENT);

Unchanged files with check annotations Beta