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

Sanity test script enhancement and doc update #920

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion integ-test/script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Apart from the basic feature, it also has some advanced functionality includes:
### Usage
To use this script, you need to have Python **3.6** or higher installed. It also requires the following Python libraries:
```shell
pip install requests pandas
pip install requests pandas openpyxl
```

After getting the requisite libraries, you can run the script with the following command line parameters in your shell:
Expand Down
5 changes: 3 additions & 2 deletions integ-test/script/SanityTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def submit_query(self, query, session_id="Empty"):
response.raise_for_status()
return response_json
except Exception as e:
return {"error": str(e), "response": response_json}
return {"error": f"{str(e)}, got response {response_json}"}

# Call get API to check the query status
def get_query_result(self, query_id):
Expand All @@ -113,7 +113,7 @@ def get_query_result(self, query_id):
response.raise_for_status()
return response_json
except Exception as e:
return {"status": "FAILED", "error": str(e), "response": response_json}
return {"status": "FAILED", "error": f"{str(e)}, got response {response_json}"}

# Call delete API to cancel the query
def cancel_query(self, query_id):
Expand Down Expand Up @@ -204,6 +204,7 @@ def run_tests_from_csv(self, csv_file):
futures = [self.executor.submit(self.run_test, query, seq_id, expected_status) for query, seq_id, expected_status in queries]
for future in as_completed(futures):
result = future.result()
self.logger.info(f"Completed test: {result["query_name"]}, {result["query"]}, got result status: {result["status"]}")
self.test_results.append(result)

def generate_report(self):
Expand Down
Loading