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

Add unit tests back to pipeline & improve VSCode integration #581

Merged
merged 49 commits into from
May 13, 2024

Conversation

Splines
Copy link
Member

@Splines Splines commented Jan 7, 2024

This fixes #571 and it fixes #507.

Ruby Test Explorer extension works now in VSCode. Also see my comment here.

  • VSCode integration via Ruby Test Explorer
  • Upgrade docs on how to run tests locally, see here
  • CI/CD: Run unit tests in pipeline -> see for example this run.

Note

For the Ruby Test Explorer extension to work, you must have a recent python version installed

Currently, the CI/CD test runs take ~4min 30s (with some things already cached). Without any caches it even takes up to ~7min. This is too long and we should try to reduce the time spent in the initial docker build phase. However, this would probably mean restructuring what is done in the dockerfiles, which should probably be something for another PR.

Future Todos

  • Fix failing unit tests. ⚠ Should probably be done before merging this. -> Edit: done in this PR.
  • Bring Cypress tests back -> try to avoid executing the same Dockerfile again as many tasks can be shared, e.g. copying a .wasm file from the pdfcomprezzor to the project root etc.

Further notes

DEPRECATION WARNING: BOLD is deprecated! Use MODES[:bold] instead. (called from request at /usr/local/bundle/bundler/gems/sunspot-41a311e9eff3/sunspot_rails/lib/sunspot/rails/log_subscriber.rb:36

These are due to sunspot/sunspot#1039 and we have to wait for the fix (sunspot/sunspot#1038) to be merged.

  • To allow for quicker test runs, we precompile the assets when the Docker image (mampf test) is constructed. Therefore, you will probably have to delete the mampf image of the test environment and rebuild it if yours is outdated. The rebuild step is done automatically the next time you try to run the test without the image present. With this approach, you will see the image build in the Output pane -> Ruby Test Explorer Log. An alternative is to just build the image as usual in the terminal yourself, e.g. docker build mampf inside the ./docker/test folder. For more troubleshooting tips, see the wiki.

Additional for reviewers

  • Tests should run through locally
  • Tests should run through in CI/CD pipeline

@Splines Splines added the CI/CD Continuous Integration / Continuous Delivery (aka pipeline stuff) label Jan 7, 2024
@Splines Splines self-assigned this Jan 7, 2024
@Splines Splines changed the title Add tests back to pipeline & improve VSCode integration Add unit tests back to pipeline & improve VSCode integration Jan 7, 2024
@Splines Splines mentioned this pull request Jan 7, 2024
1 task
buildx is used for faster builds
we also set up ghcr to use docker layer caching for hopefully even
faster build times
@Splines Splines force-pushed the pipeline/tests branch 8 times, most recently from 54a1fd9 to 9feac40 Compare January 10, 2024 15:55
@Splines Splines changed the base branch from mampf-next to dev January 10, 2024 16:31
@Splines Splines added the ide Related to integrated developer environments, e.g. VSCode etc. label Jan 10, 2024
@Splines Splines marked this pull request as ready for review January 10, 2024 17:25
@Splines
Copy link
Member Author

Splines commented May 7, 2024

Initial setup of the database cleaner was done here: b901205

Maybe related to fix database cleaner issues:

@Splines Splines added the tests Unit tests, integration tests etc. label May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (dev@bac18f8). Click here to learn what that means.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev     #581   +/-   ##
======================================
  Coverage       ?   66.62%           
======================================
  Files          ?      309           
  Lines          ?     9388           
  Branches       ?        0           
======================================
  Hits           ?     6255           
  Misses         ?     3133           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Splines Splines marked this pull request as ready for review May 7, 2024 16:12
@Splines Splines merged commit 3d1e319 into dev May 13, 2024
6 checks passed
@Splines Splines deleted the pipeline/tests branch May 13, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Continuous Integration / Continuous Delivery (aka pipeline stuff) ide Related to integrated developer environments, e.g. VSCode etc. tests Unit tests, integration tests etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants