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

test: add custom TestCase class and use in stock module #27496

Merged
merged 4 commits into from
Oct 12, 2021

Conversation

ankush
Copy link
Member

@ankush ankush commented Sep 14, 2021

Problem: Tests leave too much state in db which makes next tests flaky and dependent on state.

Solution:

  • Create a custom test case class and stop committing in inheriting classes.
  • Expand the reach of this class slowly till all major tests are covered. Starting with stock related tests for now because it's a pressing requirement to merge 2 other PRs.

@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #27496 (22c658b) into develop (c6a56a8) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #27496      +/-   ##
===========================================
+ Coverage    54.39%   54.44%   +0.04%     
===========================================
  Files         1254     1254              
  Lines        67725    67735      +10     
===========================================
+ Hits         36839    36877      +38     
+ Misses       30886    30858      -28     
Impacted Files Coverage Δ
erpnext/tests/utils.py 98.11% <100.00%> (+0.43%) ⬆️
erpnext/stock/report/stock_ledger/stock_ledger.py 77.50% <0.00%> (-3.34%) ⬇️
...xt/stock/report/stock_analytics/stock_analytics.py 90.09% <0.00%> (-2.98%) ⬇️
erpnext/stock/report/stock_ageing/stock_ageing.py 88.48% <0.00%> (-2.88%) ⬇️
...value/warehouse_wise_item_balance_age_and_value.py 92.59% <0.00%> (-2.47%) ⬇️
erpnext/accounts/deferred_revenue.py 75.22% <0.00%> (-0.89%) ⬇️
erpnext/stock/stock_ledger.py 86.66% <0.00%> (-0.73%) ⬇️
...rpnext/stock/report/stock_balance/stock_balance.py 78.82% <0.00%> (-0.59%) ⬇️
erpnext/selling/doctype/sales_order/sales_order.py 76.39% <0.00%> (-0.38%) ⬇️
...xt/accounts/doctype/sales_invoice/sales_invoice.py 76.75% <0.00%> (+0.08%) ⬆️
... and 14 more

@ankush ankush closed this Sep 15, 2021
@ankush
Copy link
Member Author

ankush commented Sep 15, 2021

will do it the "proper way" and reopen later. 😄

@ankush ankush reopened this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant