Skip to content

Commit a10b3d8

Browse files
committed
Add integration test for limiting number of entities. (#373)
1 parent dc4f1af commit a10b3d8

File tree

6 files changed

+20
-2
lines changed

6 files changed

+20
-2
lines changed

metafix/integrationTest.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function rm_temp() {
7474
}
7575

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

8081
function run_catmandu() {
@@ -224,10 +225,11 @@ function run_tests() {
224225

225226
metafix_command_output="$test_directory/metafix.out"
226227
metafix_command_error="$test_directory/metafix.err"
228+
metafix_command_args="$test_directory/metafix.args"
227229

228230
metafix_start_time=$(current_time)
229231

230-
run_metafix "$test_directory/$metafix_file" >"$metafix_command_output" 2>"$metafix_command_error"
232+
run_metafix "$test_directory/$metafix_file" $(cat "$metafix_command_args" 2>/dev/null || true) >"$metafix_command_output" 2>"$metafix_command_error"
231233
metafix_exit_status=$?
232234

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

0 commit comments

Comments
 (0)