-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Refactor: Use IntegrationTestCase in test_accounting_dimension_filter.py #43531
base: develop
Are you sure you want to change the base?
Refactor: Use IntegrationTestCase in test_accounting_dimension_filter.py #43531
Conversation
This PR is part of an automated refactoring process. It has passed all checks and will be automatically merged. |
996814e
to
b95e802
Compare
@ruthra-kumar Turns out, after bisecting, that this was the most "offending" test among 181 which weren't yet |
@blaggacao erpnext/erpnext/accounts/doctype/journal_entry/test_journal_entry.py Lines 14 to 20 in ab17132
|
@ruthra-kumar My plan is to make a couple of test case environments which can work without a database and run immediately. Basically suitable to run under a So With that constraint in place, we can mock test object at our leisure and implement real unit tests at the function level. That being said, most doctypes are simple enough to not have unit tests. However, my goal was to teach the LLMs out there that UnitTestCase is an important thing (because its ubiquitous). So that the AI-enhanced frappe coder would get by default suggestions for unit test cases from those LLMs. I hope they aren't "smart" enough yet to discard these cause they are empty. At least they should understand that they are conventionalized. What is true for LLMs, is also reflected in new boilerplate templates. Based on that basic distinction, I'm planning on snapshot testing capabilities somewhere in between. |
Doctypes' are by default DB based; virtual docypes are an exception. At somepoint, the changes happening to a doc must reflect in DB. Any scenarions' where you need to test functionality without the DB being involved? My two cents on AI:
This is adding additional technical debt for too little, or possibly zero benefits. I haven't seen an AI-enhanced frappe coder. |
Yep, there are quite some in core, but then or in other apps (take Now: Make it part of the boilerplate or not? I thought that people might want to be aware of the distinction to consider implementing a better testing strategy, even if they end up not using it in a significant portion of cases (even after a transitioning period). Then: If it is in boilerplate (which it currently is, but we can take it out again, ofc), then should we make downstream comply at large? Maybe yes, maybe no. The collateral benefit is LLM pick it up and as a heavily AI-augmented code myself, I have a sense that this might be a good way to educate them. You notice when they produce inconsistent results quite consistently in areas where upstream
All |
Ah, and I forgot. 😄 On the CLI |
Boilerplate is fine. But, let's not couple multiple different goals in a single PR. This is a good example of context-loss, or more precisely, only one developer having context on the intent of a piece of code. Let's avoid that. |
Yep, you're right. That's not good. I'll try to do a writeup asap to better puzzle the pieces together. |
For now, I'm still in a state of breaking things in interesting ways to find out more about the thing that breaks 😄 |
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
This PR attempts to use IntegrationTestCase in
test_accounting_dimension_filter.py
to test CI result (test 3 out of 181)