-
Notifications
You must be signed in to change notification settings - Fork 3
Athena
: Added mock tests for the basic approach of the module_text_llm
#88
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
base: main
Are you sure you want to change the base?
Conversation
Athena
: Added some mock tests for the basic approach of the text module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice addition, thank you @alekspetrov9e!
I have a small suggestion - I think you can modularize this code a bit, by adding maybe tests/utils
and moving the mock models/environments/configs etc. there.
it would make it also easier to then write tests for other approaches 😊
…e files in test/utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty nice 👍 Just added two nitpicks - other than that lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, you're patching directly inside the test file, which is functional but clutters the test code and won’t scale well as the suite grows. I’d recommend moving these patches into fixtures in a conftest.py
file. Since we’re likely to reuse much of this mocked functionality across different modules and tests, we should aim for a more reusable and modular setup.
There are two approaches I’d suggest considering:
-
Centralized
tests/
folder: We could move all tests under a single root-leveltests/
directory. Inside that, we can organize shared fixtures, mocks, and test utilities in their own folders (e.g.,tests/utils/
,tests/fixtures/
) and then have per-module test folders (liketests/module_text_llm/
, etc.). -
Shared
test_helpers/
module: Alternatively, we could create a sharedtest_helpers/
package to store common fixtures, mocks, and utilities. Each module would keep its owntests/
folder with local tests, but import shared components fromtest_helpers/
.
In both setups, modules would import shared fixtures into their local conftest.py
(or directly from the shared folder where appropriate) and can still keep their own specialised fixtures or mocks right next to their tests.
I personally lean toward option 1, but I think option 2 is equally valid depending on how modular we want to keep things.
What do you think @maximiliansoelch?
athena/modules/text/module_text_llm/tests/test_basic_approach_mock.py
Outdated
Show resolved
Hide resolved
Generally, this is a valid point, and I am fine with both options. My only requirement is that the test files are clearly structured and identifiable to which module they belong, allowing for an easy modification/deletion of, for example, a deprecated module. |
Thank you all for the reviews! I used the first approach that @LeonWehrhahn proposed and created a central tests folder and tests can be grouped by modules. I also resolved the two nitpicks from @ahmetsenturk :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make use of the utils you have implemented - looks like you are defining the mock models you have already separated from the test suites
Athena
: Added some mock tests for the basic approach of the text moduleAthena
: Added mock tests for the basic approach of the module_text_llm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing in the test dependency declaration. See inline comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also adapt the Github Action for testing to make use of your newly added test.
Additionally, please mark PR review suggestions that were resolved as such.
Add tests for text LLM module basic approach
This PR adds e tests for the text LLM module's basic approach functionality. The tests verify the feedback generation process for student submissions using extensive mocking to isolate the functionality being tested.
Key features of the test suite:
The tests ensure that the basic approach functionality works correctly across different scenarios while maintaining proper isolation from external dependencies.