Skip to content

Commit

Permalink
CDR-1659 adjust system id AQL FOLDER (#37)
Browse files Browse the repository at this point in the history
* fix: CDR-1659 use system_id_with_tenant as variable to provide tnt name in system_id - AQL FOLDER

* fix: use compare json-json instead of json with tmp_file

* fix: use compare json-json instead of json with tmp_file AQL_TESTS\EXTERNAL
  • Loading branch information
vladislavploaia authored Nov 15, 2024
1 parent 82b2221 commit bf5176c
Show file tree
Hide file tree
Showing 86 changed files with 607 additions and 788 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,21 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_action_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT a/${path} FROM EHR e[ehr_id/value='${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] CONTAINS SECTION s[openEHR-EHR-SECTION.test_all_types.v1] CONTAINS ACTION a[openEHR-EHR-ACTION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}

Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_composition_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT c/${path} FROM EHR e[ehr_id/value='${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_context_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT c/${path} FROM EHR e[ehr_id/value='${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_evaluation_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT eval/${path} FROM EHR e[ehr_id/value = '${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] CONTAINS EVALUATION eval[openEHR-EHR-EVALUATION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_action_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT i/${path} FROM EHR e[ehr_id/value = '${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] CONTAINS SECTION s[openEHR-EHR-SECTION.test_all_types.v1] CONTAINS INSTRUCTION i[openEHR-EHR-INSTRUCTION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_obs_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT o/${path} FROM EHR e[ehr_id/value='${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_action_auto_where_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT s/${path} FROM EHR e[ehr_id/value = '${ehr_id}'] CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.test_all_types.v1] CONTAINS SECTION s[openEHR-EHR-SECTION.test_all_types.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
Set Test Variable ${where} ${where}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_arbitrary_minimal_instruction_1_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT i/${path} FROM EHR e CONTAINS COMPOSITION c CONTAINS INSTRUCTION i[openEHR-EHR-INSTRUCTION.minimal.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,19 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_arbitrary_minimal_instruction_2_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT i/${path} FROM EHR e CONTAINS COMPOSITION c CONTAINS INSTRUCTION i[openEHR-EHR-INSTRUCTION.minimal.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ Precondition

Execute Query
[Arguments] ${query_nr} ${path} ${where} ${expected_file} ${nr_of_results}
${actual_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${tmp_file} Set Variable ${EXPECTED_JSON_RESULTS}/expected_test_arbitrary_minimal_instruction_3_tmp.json
${expected_result_file} Set Variable ${EXPECTED_JSON_RESULTS}/${expected_file}
${query_dict} Create Dictionary
... tmp_query=SELECT i/${path} FROM EHR e CONTAINS COMPOSITION c CONTAINS INSTRUCTION i[openEHR-EHR-INSTRUCTION.minimal.v1] WHERE ${where}
${query} Set Variable ${query_dict["tmp_query"]}
Set AQL And Execute Ad Hoc Query ${query}
${expected_res_tmp} Set Variable ${actual_file}
${file_without_replaced_vars} Get File ${expected_res_tmp}
${data_replaced_vars} Replace Variables ${file_without_replaced_vars}
Create File ${tmp_file} ${data_replaced_vars}
Length Should Be ${resp_body['rows']} ${nr_of_results}
${exclude_paths} Create List root['meta'] root['q']
${diff} compare json-string with json-file
... ${resp_body_actual} ${tmp_file}
Set Test Variable ${query_nr} ${query_nr}
Set Test Variable ${path} ${path}
${expected_json} Get File And Replace Dynamic Vars In File And Store As String
... test_data_file=${expected_result_file}
${diff} compare json-strings
... ${resp_body_actual} ${expected_json}
... exclude_paths=${exclude_paths}
... ignore_order=${TRUE} ignore_string_case=${TRUE}
Should Be Empty ${diff} msg=DIFF DETECTED!
[Teardown] Remove File ${tmp_file}
Should Be Empty ${diff} msg=DIFF DETECTED!
Loading

0 comments on commit bf5176c

Please sign in to comment.