django-cms / djangocms-transfer

django CMS Transfer allows you to export and import plugins.
https://www.django-cms.org
Other
19 stars 19 forks source link

fix: improved testing environment and fixed existing errors #35

Closed wfehr closed 4 months ago

wfehr commented 4 months ago

Setup a better testing-environment for running tests locally. This is done via docker(-compose).

Other changes:

This changes are a good base for future test-implementation. Also some of the occuring errors are getting fixed.

wfehr commented 4 months ago

Taking a look into implementing a test for "basic functionality" now. Made this PR since the already done changes work independently and already improve the code-base. -> e.g.: test-hooks/github-checks are running successfully now with this PR.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 48.52941% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 62.12%. Comparing base (eebaa38) to head (a8d7759).

Files Patch % Lines
djangocms_transfer/cms_plugins.py 0.00% 15 Missing :warning:
djangocms_transfer/forms.py 53.33% 14 Missing :warning:
djangocms_transfer/cms_toolbars.py 0.00% 4 Missing :warning:
djangocms_transfer/importer.py 0.00% 0 Missing and 1 partial :warning:
djangocms_transfer/utils.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #35 +/- ## =========================================== + Coverage 31.18% 62.12% +30.94% =========================================== Files 11 11 Lines 404 404 Branches 61 61 =========================================== + Hits 126 251 +125 + Misses 278 137 -141 - Partials 0 16 +16 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

wfehr commented 4 months ago

Just pushed the commits including tests to cover some basic functionality of this project.

I also included skipped tests with 8daa9b6. Those would cover more functionality of the imports but since I get errors for the import_file, I'll just leave those as skipped for now.

I think the currently "able to run" tests are a good base for future implementations / changes.

wfehr commented 4 months ago

@fsbraun I'd put this changes up for review now.

fsbraun commented 4 months ago

@wfehr Excellent work! Thank you! Quick question: What is the docker file needed for?

wfehr commented 4 months ago

@wfehr Excellent work! Thank you! Quick question: What is the docker file needed for?

Hope I didn't interfere anything with my foce-push now ;) I rebased the branch onto the current master.

The Dockerfile is used for running the tests locally via devtools/run-tests (integrated with 34b3bcc). I can also move the file into devtools/ if the root directory isn't the best place for it.

With this setup you can run tests a little easier with different python-versions for example. -> for example in the future one could change the base-image python:3.10.. for something like python:3.12 if older versions aren't needed for testing anymore. I find testing via docker a little more convinient than meeting requirements in the local dev-system.

fsbraun commented 4 months ago

@wfehr I understand why you're using Docker for testing, but I would like to keep the test setup similar for all django-cms packages. Can you update the tox.ini to run without Docker? We can run the specific python versioned tests in the github actions.

wfehr commented 4 months ago

@wfehr I understand why you're using Docker for testing, but I would like to keep the test setup similar for all django-cms packages. Can you update the tox.ini to run without Docker? We can run the specific python versioned tests in the github actions.

I updated the branch and removed docker from the first commit (34b3bcc => 541b434).