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 tests - storage + worker #926

Merged
merged 5 commits into from
Oct 30, 2024
Merged

Add tests - storage + worker #926

merged 5 commits into from
Oct 30, 2024

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Oct 26, 2024

partially fixes #914

Description

This PR adds a few unit tests to try to improve the code coverage. Tests covered:

  • storage
  • storage local
  • starting conda-store-worker

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

Copy link

netlify bot commented Oct 26, 2024

Deploy Preview for conda-store canceled.

Name Link
🔨 Latest commit 796918b
🔍 Latest deploy log https://app.netlify.com/sites/conda-store/deploys/671c441e5001fe000816399f

Copy link

netlify bot commented Oct 26, 2024

Deploy Preview for conda-store ready!

Name Link
🔨 Latest commit e4a7262
🔍 Latest deploy log https://app.netlify.com/sites/conda-store/deploys/6721b47566449f0008b80e55
😎 Deploy Preview https://deploy-preview-926--conda-store.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@soapy1 soapy1 requested a review from peytondmurray October 26, 2024 01:22
@soapy1 soapy1 changed the title Add tests for storage module Add tests - storage + worker Oct 28, 2024
Copy link
Contributor

@peytondmurray peytondmurray left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

from conda_store_server._internal.worker.app import CondaStoreWorker


def test_worker_with_valid_config(conda_store_config, tmp_path):
Copy link
Contributor

Choose a reason for hiding this comment

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

A docstring for each test with a one-liner saying what it's supposed to be testing would be useful.

For example, is this just checking whether a worker can be initialized? If so, I guess if worker.initialize() runs without generating an error then we pass the test? But should we check that the configuration settings in the valid config are actually being met, e.g. that the log level, concurrency, and watch_path is being set correctly, or is that out of scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, is this just checking whether a worker can be initialized? If so, I guess if worker.initialize() runs without generating an error then we pass the test?

Yep, this test is meant to ensure that the worker can init without an error. So, that is exercising all the validation functions, in this case, just _validate_config_file.

But should we check that the configuration settings in the valid config are actually being met, e.g. that the log level, concurrency, and watch_path is being set correctly, or is that out of scope?

Good idea! Added a test for that as well.

@soapy1 soapy1 merged commit 30c35ee into conda-incubator:main Oct 30, 2024
27 checks passed
@soapy1 soapy1 deleted the add-tests branch October 30, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 💪🏾
Development

Successfully merging this pull request may close these issues.

Improve testing - developer experience
2 participants