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: Merge _should_test_azure and _get_azure_url inside Azure test helper #3055

Merged
merged 2 commits into from
Jan 5, 2020

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Jan 4, 2020

I tried doing this in a single PR, but, it became fairly large. So, I'm just making a PR with a single change.

After merging all the functions inside tests/remotes.py, we could use the {Azure, S3, GCP, etc.} classes as mixins on the TestCases.

Related to #2878.

  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • 📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@skshetry skshetry force-pushed the refactor-remote-azure branch from ed5fe85 to f828a3f Compare January 4, 2020 16:08
@skshetry skshetry force-pushed the refactor-remote-azure branch from f828a3f to c4783f4 Compare January 4, 2020 16:09
@efiop efiop requested review from Suor, a user and pared January 4, 2020 19:15
should_test = staticmethod(_should_test_azure)
get_url = staticmethod(get_azure_url)
@staticmethod
def should_test():
Copy link

Choose a reason for hiding this comment

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

The logic is different from other should_test, for example:

class GDrive:
    @staticmethod
    def should_test():
        return os.getenv("GDRIVE_USER_CREDENTIALS_DATA") is not None

At least as credentials are set, it will run the tests.

But as I'm reading this, if DVC_TEST_AZURE is defined, it is assumed that AZURE_STORAGE_{CONTAINER_NAME,CONNECTION_STRING} are set.

Why not going for testing only the credentials?

Copy link
Contributor

Choose a reason for hiding this comment

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

@MrOutis Gdrive is the only one that doesn't respect the previous convention 🙂 This change does. DVC_TEST* are useful when you want to ensure that your tests will run even if the env vars are not defined, for example when you have some other way of providing credentials already. For example, should_test for s3 tests for AWS_ env vars, but I don't define them locally, since I have the default ones that work as is.

Copy link

Choose a reason for hiding this comment

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

@efiop , got it 👍

should_test = staticmethod(_should_test_azure)
get_url = staticmethod(get_azure_url)
@staticmethod
def should_test():
Copy link

Choose a reason for hiding this comment

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

@efiop , got it 👍

@efiop efiop merged commit 54faf1b into iterative:master Jan 5, 2020
@skshetry skshetry deleted the refactor-remote-azure branch January 5, 2020 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants