You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Test The Extraction Function with the following flow (The Attachment Test Flow):
2
-
- Step 1: Invoke The Extraction Function using the resource [{{ data_extraction_resource_name }}](test_data/{{ data_extraction_resource_name }}).
3
-
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
4
-
- Step 2: Invoke The Extraction Function using the resource [{{ attachment_extraction_resource_name }}](test_data/{{ attachment_extraction_resource_name }}).
5
-
- Expect The Callback Server to receive from DevRev a **single** event (`:= event_from_callback_server`) with "event_type" that equals "EXTRACTION_ATTACHMENTS_DONE".
6
-
- Expect `event_from_callback_server["event_data"]["artifacts"]` to be an array. Expect this array to not be empty. Expect this array to have length 1.
7
-
- Let `artifact_object = event_from_callback_server["event_data"]["artifacts"][0]`.
- Make a GET request to "http://localhost:8003/is_uploaded/{artifact_object['id']}". Expect response code to be equal to 200.
10
-
- Note: The Attachment Test Flow should be executed within a single test.
1
+
Test The Extraction Function with the following flow (The Attachment Test Flow):
2
+
- Step 1: Invoke The Extraction Function using the resource [{{ data_extraction_resource_name }}](test_data/{{ data_extraction_resource_name }}).
3
+
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
4
+
- Step 2: Invoke The Extraction Function using the resource [{{ attachment_extraction_resource_name }}](test_data/{{ attachment_extraction_resource_name }}).
5
+
- Expect The Callback Server to receive from DevRev a **single** event (`:= event_from_callback_server`) with "event_type" that equals "EXTRACTION_ATTACHMENTS_DONE".
6
+
- Expect `event_from_callback_server["event_data"]["artifacts"]` to be an array. Expect this array to not be empty. Expect this array to have length 1.
7
+
- Let `artifact_object = event_from_callback_server["event_data"]["artifacts"][0]`.
- Then, validate The Normalization Function with the chef-cli tool (The Chef CLI) using the command "chef-cli validate-data -m <The External Domain Metadata JSON object file> -r {{ record_type }}":
2
-
- To invoke the function that returns The External Domain Metadata JSON object, send the event [external_domain_metadata_event_payload.json](test_data/external_domain_metadata_event_payload.json) to The Snap-In server.
3
-
- The External Domain Metadata JSON object should then be stored in temporary file and provided as path to the validation of The Normalization Function.
4
-
- The Chef CLI reads the extracted file (The Extracted File) from stdin.
5
-
- The Extracted File is inside folder provided in the environment variable "EXTRACTED_FILES_FOLDER_PATH". To retrieve the relevant file name, command `ls EXTRACTED_FILES_FOLDER_PATH | grep extractor_{{ record_type }} | sort -r | head -n 1` should be executed. The test should always fail if The Extracted File is not present.
6
-
- Please note that the expected behaviour is that only after the invocation of The Extraction Function, the folder provided in the environment variable "EXTRACTED_FILES_FOLDER_PATH" should exist. The test should always fail if before the execution of The Chef CLI, the folder "EXTRACTED_FILES_FOLDER_PATH" does not exist or if The Extracted File is not found.
7
-
- The path to The Chef CLI executable is provided in the environment variable `CHEF_CLI_PATH`.
8
-
- For the validation of The Normalization Function to be successful The Chef CLI must return an empty output. The implementation of The Extraction Function directly infuences the output of The Chef CLI.
9
-
- The stdout and stderr of The Chef CLI *must* be printed to the console.
10
-
- The test should always fail if The Chef CLI is not available.
1
+
validate The Normalization Function with the chef-cli tool (The Chef CLI) using the command "chef-cli validate-data -m <The External Domain Metadata JSON object file> -r {{ record_type }}":
2
+
- To invoke the function that returns The External Domain Metadata JSON object, send the event [external_domain_metadata_event_payload.json](test_data/external_domain_metadata_event_payload.json) to The Snap-In server.
3
+
- The External Domain Metadata JSON object should then be stored in temporary file and provided as path to the validation of The Normalization Function.
4
+
- The Chef CLI reads the extracted file (The Extracted File) from stdin.
5
+
- The Extracted File is inside folder provided in the environment variable "EXTRACTED_FILES_FOLDER_PATH". To retrieve the relevant file name, command `ls EXTRACTED_FILES_FOLDER_PATH | grep extractor_{{ record_type }} | sort -r | head -n 1` should be executed. The test should always fail if The Extracted File is not present.
6
+
- Please note that the expected behaviour is that only after the invocation of The Extraction Function, the folder provided in the environment variable "EXTRACTED_FILES_FOLDER_PATH" should exist. The test should always fail if before the execution of The Chef CLI, the folder "EXTRACTED_FILES_FOLDER_PATH" does not exist or if The Extracted File is not found.
7
+
- The path to The Chef CLI executable is provided in the environment variable `CHEF_CLI_PATH`.
8
+
- For the validation of The Normalization Function to be successful The Chef CLI must return an empty output. The implementation of The Extraction Function directly infuences the output of The Chef CLI.
9
+
- The stdout and stderr of The Chef CLI *must* be printed to the console.
10
+
- The test should always fail if The Chef CLI is not available.
- Test The Extraction Function using the resource [{{ resource_name }}](test_data/{{ resource_name }}).
2
-
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
3
-
- Let `artifact_array = <event_from_callback_server>["event_data"]["artifacts"]` (array of objects).
4
-
- Expect `len(artifact_array) > 0`.
5
-
- Out of `artifact_array`, expect one of the elements to have "item_type" equal to "{{ artifact_name }}" (`:= {{ artifact_name }}_artifact`) and `{{ artifact_name }}_artifact["item_count"]={{ expected_item_count }}`.
6
-
- Note: If `{{ artifact_name }}_artifact["item_count"] < {{ expected_item_count }}`, this indicates that not all the {{ artifact_name }} data was extracted.
1
+
Test The Extraction Function using the resource [{{ resource_name }}](test_data/{{ resource_name }}).
2
+
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
3
+
- Let `artifact_array = <event_from_callback_server>["event_data"]["artifacts"]` (array of objects).
4
+
- Expect `len(artifact_array) > 0`.
5
+
- Out of `artifact_array`, expect one of the elements to have "item_type" equal to "{{ artifact_name }}" (`:= {{ artifact_name }}_artifact`) and `{{ artifact_name }}_artifact["item_count"]={{ expected_item_count }}`.
6
+
- Note: If `{{ artifact_name }}_artifact["item_count"] < {{ expected_item_count }}`, this indicates that not all the {{ artifact_name }} data was extracted.
- Test the rate limiting of The Function "{{ function_name }}" with the following flow:
2
-
- Make a POST request to "http://localhost:8004/start_rate_limiting" with body `{ "test_name": <identifyer of the test>}`.
3
-
- Invoke The Function "{{ function_name }}" with valid credentials and all required parameters.
4
-
- Expect: `status_code = 429`.
5
-
- Expect: `api_delay > 0` and `api_delay <= 3`. If api_delay is bigger than 3, assume the problem is that we did not calculate the api_delay correctly in The Implementation Code.
6
-
- Make a POST request to "http://localhost:8004/end_rate_limiting".
1
+
Test the rate limiting of The Function "{{ function_name }}" with the following flow:
2
+
- Make a POST request to "http://localhost:8004/start_rate_limiting" with body `{ "test_name": <identifyer of the test>}`.
3
+
- Invoke The Function "{{ function_name }}" with valid credentials and all required parameters.
4
+
- Expect: `status_code = 429`.
5
+
- Expect: `api_delay > 0` and `api_delay <= 3`. If api_delay is bigger than 3, assume the problem is that we did not calculate the api_delay correctly in The Implementation Code.
6
+
- Make a POST request to "http://localhost:8004/end_rate_limiting".
0 commit comments