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

refactor(tests): decouple unittests from integration tests #15473

Conversation

ofekisr
Copy link
Contributor

@ofekisr ofekisr commented Jun 30, 2021

SUMMARY

unittests should not depend on app_context or any database
so I moved all tests to be under integrations_tests package, and update all ci commands and configurations

as a separate phase and PRs, unittests should move to be under unittests package, and its conftests file will not contain
app_context dependency

note - unused import removed

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

Merging #15473 (ee9d44a) into master (e606477) will decrease coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15473      +/-   ##
==========================================
- Coverage   77.20%   77.01%   -0.19%     
==========================================
  Files         975      975              
  Lines       50842    50862      +20     
  Branches     6728     6740      +12     
==========================================
- Hits        39251    39171      -80     
- Misses      11376    11475      +99     
- Partials      215      216       +1     
Flag Coverage Δ
hive ?
javascript 71.85% <ø> (+0.09%) ⬆️
mysql 81.64% <ø> (+<0.01%) ⬆️
postgres 81.66% <ø> (+<0.01%) ⬆️
presto ?
python 81.75% <ø> (-0.45%) ⬇️
sqlite 81.28% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset-frontend/src/dataMask/actions.ts 42.85% <0.00%> (-35.72%) ⬇️
superset/db_engine_specs/hive.py 69.20% <0.00%> (-17.21%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.95%) ⬇️
superset-frontend/src/dataMask/reducer.ts 65.30% <0.00%> (-6.13%) ⬇️
...nfigModal/FiltersConfigForm/getControlItemsMap.tsx 85.96% <0.00%> (-5.93%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.22% <0.00%> (-1.65%) ⬇️
...board/components/nativeFilters/FilterBar/index.tsx 83.17% <0.00%> (-1.09%) ⬇️
superset/db_engine_specs/base.py 87.97% <0.00%> (-0.41%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e606477...ee9d44a. Read the comment docs.

@ofekisr ofekisr force-pushed the refactor/decoule_unittest_from_app_context branch 3 times, most recently from b3a386b to a7c461e Compare July 1, 2021 09:11
@ofekisr ofekisr force-pushed the refactor/decoule_unittest_from_app_context branch from a7c461e to 9cec0c5 Compare July 1, 2021 12:34
Copy link
Member

@amitmiran137 amitmiran137 left a comment

Choose a reason for hiding this comment

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

a simple folder migration from
tests to tests/integration-tests
as preparation for moving only unittests into separated folders that would be ran differently and will eventually reduce tests run time
LGTM!

@amitmiran137 amitmiran137 merged commit b5119b8 into apache:master Jul 1, 2021
@amitmiran137 amitmiran137 deleted the refactor/decoule_unittest_from_app_context branch July 1, 2021 15:05
@betodealmeida
Copy link
Member

Thank you so much for this PR, @ofekisr! I started adding some (proper) unit tests and it's so good to have them run almost instantaneously.

cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
)

* refactor move all tests to be under integration_tests package

* refactor decouple unittests from integration tests - commands

* add unit_tests package

* fix celery_tests.py

* fix wrong FIXTURES_DIR value
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
)

* refactor move all tests to be under integration_tests package

* refactor decouple unittests from integration tests - commands

* add unit_tests package

* fix celery_tests.py

* fix wrong FIXTURES_DIR value
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
)

* refactor move all tests to be under integration_tests package

* refactor decouple unittests from integration tests - commands

* add unit_tests package

* fix celery_tests.py

* fix wrong FIXTURES_DIR value
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants