Closed MarkEdmondson1234 closed 6 months ago
To help me create an implementation plan for the tests, could you please provide more details? Specifically, I need to know:
[No tentative implementation steps.]
For more information about Ellipsis, check the documentation.
Hi @ellipsis-dev I would like unit tests using pytest for just basic configuration within the python folder sunholo/ - I intend to use it with a check upon build to make sure I've not broken any existing functionality
Are you working on this @ellipsis-dev ?
I'm sorry for the delay. I was in the process of viewing the contents of the Python files in the 'sunholo/' folder to understand the basic configuration that needs to be tested. Once I have this information, I will be able to create an implementation plan for creating the tests. If you have any questions or need further assistance, please let me know.
[No tentative implementation steps.]
For more information about Ellipsis, check the documentation.
@ellipsis-dev is this still under way?
@ellipsis-dev ok thanks. Thats one file done, several to go ;). We can work through them slowly though. Can you put all the tests into a test/ folder? And do another test for the next file, not just chat_history. how about agents/dispatch_to_qa.py ?
@ellipsis-dev please make pytests for the python scripts within the sunholo/utils/ folder
Sorry, Ellipsis encountered a problem while generating a pull request. Our team has been alerted and is investigating. (wflow_IHS3Yv4Npensv1o7) :robot:
^ sorry about this! patched this issue and rerunning...
I'm sorry for the delay. I was in the process of viewing the contents of the Python files in the 'sunholo/' folder to understand the basic configuration that needs to be tested. Once I have this information, I will be able to create an implementation plan for creating the tests. If you have any questions or need further assistance, please let me know.
Create unit tests for the 'config.py' script
At the top of the file, import the necessary libraries and modules. This includes the pytest framework and the functions from the 'config.py' script.
Define a test function for each main functionality of the 'config.py' script. These functionalities include fetching configuration data from a Google Cloud Storage bucket, getting the file path of a module, loading configuration data from a file, and loading a specific key from the configuration data.
In each test function, call the function being tested with mock input and use an assert statement to check the output. The assert statement should compare the actual output of the function to the expected output. Provide a failure message for each assert statement.
Consider any dependencies or setup required for the tests. This may include creating mock configuration data and setting environment variables.
After writing the tests, run them using the pytest framework to ensure they pass and accurately test the functionalities of the 'config.py' script.
Create unit tests for the 'gcp.py' script
At the top of the file, import the necessary libraries and modules. This includes the pytest framework and the functions from the 'gcp.py' script.
Define a test function for each main functionality of the 'gcp.py' script. These functionalities include checking if the application is running on Cloud Run or GCP, getting the project ID or service account email from environment variables or GCP metadata, and getting the GCP region.
In each test function, call the function being tested with mock input and use an assert statement to check the output. The assert statement should compare the actual output of the function to the expected output. Provide a failure message for each assert statement.
Consider any dependencies or setup required for the tests. This may include setting environment variables.
After writing the tests, run them using the pytest framework to ensure they pass and accurately test the functionalities of the 'gcp.py' script.
Create unit tests for the 'parsers.py' script
At the top of the file, import the necessary libraries and modules. This includes the pytest framework and the functions from the 'parsers.py' script.
Define a test function for each main functionality of the 'parsers.py' script. These functionalities include checking if a string contains a URL, extracting URLs from a string, computing the SHA-1 hash of a file or a string, and removing whitespace from a string.
In each test function, call the function being tested with mock input and use an assert statement to check the output. The assert statement should compare the actual output of the function to the expected output. Provide a failure message for each assert statement.
Consider any dependencies or setup required for the tests. This may include creating mock strings and files.
After writing the tests, run them using the pytest framework to ensure they pass and accurately test the functionalities of the 'parsers.py' script.
For more information about Ellipsis, check the documentation.
@MarkEdmondson1234 right now Ellipsis is best used for a single change at a time - above, it's timing out while building its plan. We're rolling out a new feature over next few days for batch changes like the one you're requesting above, but until then, results will be much better for single tasks
Makes sense, I'll try it one file at a time
@ellipsis-dev can you help create some tests?