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

Create tests #10

Closed
MarkEdmondson1234 opened this issue Mar 9, 2024 · 12 comments
Closed

Create tests #10

MarkEdmondson1234 opened this issue Mar 9, 2024 · 12 comments

Comments

@MarkEdmondson1234
Copy link
Contributor

@ellipsis-dev can you help create some tests?

@MarkEdmondson1234 MarkEdmondson1234 added the ellipsis:create Assigns Ellipsis to create a Pull Request for this issue. label Mar 9, 2024
Copy link
Contributor

ellipsis-dev bot commented Mar 9, 2024

To help me create an implementation plan for the tests, could you please provide more details? Specifically, I need to know:

  • What kind of tests you want (unit tests, integration tests, end-to-end tests, etc.)
  • Which part of the codebase you want the tests for (frontend, backend, specific modules, etc.)
  • What the tests should cover (specific functionalities, edge cases, etc.)

[No tentative implementation steps.]


For more information about Ellipsis, check the documentation.

@MarkEdmondson1234
Copy link
Contributor Author

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

@MarkEdmondson1234
Copy link
Contributor Author

Are you working on this @ellipsis-dev ?

Copy link
Contributor

ellipsis-dev bot commented Mar 9, 2024

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.

@MarkEdmondson1234
Copy link
Contributor Author

@ellipsis-dev is this still under way?

ellipsis-dev bot added a commit that referenced this issue Mar 9, 2024
@ellipsis-dev ellipsis-dev bot removed the ellipsis:create Assigns Ellipsis to create a Pull Request for this issue. label Mar 9, 2024
@MarkEdmondson1234
Copy link
Contributor Author

@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 bot added a commit that referenced this issue Mar 9, 2024
@MarkEdmondson1234
Copy link
Contributor Author

@ellipsis-dev please make pytests for the python scripts within the sunholo/utils/ folder

Copy link
Contributor

ellipsis-dev bot commented Mar 9, 2024

Sorry, Ellipsis encountered a problem while generating a pull request. Our team has been alerted and is investigating. (wflow_IHS3Yv4Npensv1o7) 🤖

@nsbradford
Copy link

^ sorry about this! patched this issue and rerunning...

Copy link
Contributor

ellipsis-dev bot commented Mar 9, 2024

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.

Implementation Steps (work in progress)

  1. Create unit tests for the 'config.py' script

      1. Create a new file named 'test_config.py' in the 'test/' folder.
  2. 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.

  3. 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.

  4. 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.

  5. Consider any dependencies or setup required for the tests. This may include creating mock configuration data and setting environment variables.

  6. After writing the tests, run them using the pytest framework to ensure they pass and accurately test the functionalities of the 'config.py' script.

  7. Create unit tests for the 'gcp.py' script

      1. Create a new file named 'test_gcp.py' in the 'test/' folder.
  8. 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.

  9. 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.

  10. 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.

  11. Consider any dependencies or setup required for the tests. This may include setting environment variables.

  12. After writing the tests, run them using the pytest framework to ensure they pass and accurately test the functionalities of the 'gcp.py' script.

  13. Create unit tests for the 'parsers.py' script

      1. Create a new file named 'test_parsers.py' in the 'test/' folder.
  14. 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.

  15. 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.

  16. 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.

  17. Consider any dependencies or setup required for the tests. This may include creating mock strings and files.

  18. 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.

@nsbradford
Copy link

@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

@MarkEdmondson1234
Copy link
Contributor Author

Makes sense, I'll try it one file at a time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants