Skip to content

Commit

Permalink
Add integration test for limiting number of entities. (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwinter committed Dec 3, 2024
1 parent dc4f1af commit a10b3d8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metafix/integrationTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function rm_temp() {
}

function run_metafix() {
$gradle_command --console=plain -p "$root_directory" :metafix-runner:run --args="$1" -P${noprofile}profile="${1%.*}"
local file=$1; shift
$gradle_command --console=plain -p "$root_directory" :metafix-runner:run --args="$file" -P${noprofile}profile="${file%.*}" $@
}

function run_catmandu() {
Expand Down Expand Up @@ -224,10 +225,11 @@ function run_tests() {

metafix_command_output="$test_directory/metafix.out"
metafix_command_error="$test_directory/metafix.err"
metafix_command_args="$test_directory/metafix.args"

metafix_start_time=$(current_time)

run_metafix "$test_directory/$metafix_file" >"$metafix_command_output" 2>"$metafix_command_error"
run_metafix "$test_directory/$metafix_file" $(cat "$metafix_command_args" 2>/dev/null || true) >"$metafix_command_output" 2>"$metafix_command_error"
metafix_exit_status=$?

metafix_elapsed_time=$(elapsed_time "$metafix_start_time")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"key1":"value1","key2":"value2","key3":"value3","key4":"value4"}
{"key1":"value1","key2":["v1","v2"]}
{"key1":"value1","key2":["v1","v2"],"key3":"value3","key4":"value4"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"key1":"value1","key2":"value2","key3":"value3","key4":"value4"}
{"key1":"value1","key2":["v1","v2"],"key3":["v3"],"key4":"value4"}
{"key1":"value1","key2":["v1","v2"],"key3":"value3","key4":"value4"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dorg.metafacture.metafix.maxEntityCount=1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nothing()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-lines
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json
|write(FLUX_DIR + "output-metafix.json")
;

0 comments on commit a10b3d8

Please sign in to comment.