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

Add test for backend functions #644

Merged
merged 22 commits into from
Apr 15, 2024

Conversation

tanya-borisova
Copy link
Contributor

@tanya-borisova tanya-borisova commented Apr 9, 2024

Purpose

  • Adding unit tests for the backend functions.

Does this introduce a breaking change?

[ ] Yes
[ x ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ x ] Other... Please describe: **Adding tests**

@tanya-borisova tanya-borisova linked an issue Apr 9, 2024 that may be closed by this pull request
…olution-accelerator into 584-add-unit-tests-for-the-batch-function-app
Copy link

github-actions bot commented Apr 9, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code/backend/batch
   AddURLEmbeddings.py29293%37–38
   BatchPushResults.py270100% 
   BatchStartProcessing.py190100% 
   GetConversationResponse.py32390%63–65
TOTAL168983350% 

Tests Skipped Failures Errors Time
67 0 💤 0 ❌ 0 🔥 10.225s ⏱️

@tanya-borisova tanya-borisova marked this pull request as ready for review April 10, 2024 15:48
…b.com:Azure-Samples/chat-with-your-data-solution-accelerator into 584-add-unit-tests-for-the-batch-function-app
code/tests/test_BatchGetConversationResponse.py Outdated Show resolved Hide resolved
code/tests/test_AddURLEmbeddings.py Outdated Show resolved Hide resolved
code/backend/batch/AddURLEmbeddings.py Outdated Show resolved Hide resolved
code/backend/batch/GetConversationResponse.py Outdated Show resolved Hide resolved
Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>
@cecheta
Copy link
Collaborator

cecheta commented Apr 11, 2024

The tests are quite slow, I think we need to mock ConfigHelper in more of the tests

@tanya-borisova tanya-borisova changed the title Add test for batch processing function Add test for backend functions Apr 12, 2024
@tanya-borisova tanya-borisova requested a review from cecheta April 12, 2024 16:58
Copy link
Collaborator

@adamdougal adamdougal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Copy link
Collaborator

@cecheta cecheta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

@tanya-borisova tanya-borisova added this pull request to the merge queue Apr 15, 2024
Merged via the queue into main with commit 0a7f180 Apr 15, 2024
5 checks passed
@tanya-borisova tanya-borisova deleted the 584-add-unit-tests-for-the-batch-function-app branch April 15, 2024 09:06
eduardogch pushed a commit to devopsdale/chat-with-your-data-solution-accelerator that referenced this pull request Apr 30, 2024
* Add test for batch processing function

* Remove comment

* Try to remove sys path modifications

* Fix imports

* Fix sys path append statements by making paths absolute

* Remove extra sys.path.append that isnt necessary

* Apply suggestions from code review

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>

* Rename test file, add a test for no url in request

* Make sure ConfigHelper etc are mocked out

* Mock out config helper

* Improve sys.path.append

* Mock EnvHelper as well to speed up test execution time

* Utilise get_user_function() method to enable tests

* re-add env sample

* Init log level from os environ

---------

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Add unit tests for the batch function app
3 participants