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 Volume Fixture #72

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

christophergrant
Copy link
Contributor

Changes

This PR adds a Managed Volume fixture from Unity Catalog, allowing testers to create and use a random volume in the catalog.

Linked issues

Resolves #70 .

Tests

  • manually tested
  • added unit tests
  • added integration tests
  • verified on staging environment (screenshot attached)

tests/unit/fixtures/test_catalog.py Outdated Show resolved Hide resolved
def test_make_volume():
ctx, info = call_stateful(make_volume)

ctx['ws'].volumes.create.assert_called_once()
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you assert on the actual arguments? :) then we're good to merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PTAL after changes

def test_make_volume_with_name():
ctx, info = call_stateful(make_volume, name='test_volume')

ctx['ws'].volumes.create.assert_called_once()
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you assert on the actual arguments? :) then we're good to merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PTAL after changes

@nfx nfx marked this pull request as ready for review October 30, 2024 09:35
Copy link
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

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

lgtm

@nfx nfx merged commit 18948fe into databrickslabs:main Nov 4, 2024
5 of 7 checks passed
nfx added a commit that referenced this pull request Nov 4, 2024
* Added Volume Fixture ([#72](#72)). This commit introduces a Managed Volume fixture, `make_volume`, to the Unity Catalog in the test suite, facilitating the creation and use of a random volume for testing purposes. The fixture, when called without arguments, generates a volume with a random name. Alternatively, specifying the `name` argument creates a volume with the given name, using the `MANAGED` volume type, and associating it with a randomly generated catalog and schema. This promotes test isolation and prevents unintended interference. Additionally, this PR resolves issue [#70](#70) and includes unit and integration tests that have been manually verified to ensure the fixture's proper functioning. The commit also demonstrates a bug fix related to table retrieval in the `test_remove_after_property_table` test case.
@nfx nfx mentioned this pull request Nov 4, 2024
nfx added a commit that referenced this pull request Nov 4, 2024
* Added Volume Fixture
([#72](#72)). This
commit introduces a Managed Volume fixture, `make_volume`, to the Unity
Catalog in the test suite, facilitating the creation and use of a random
volume for testing purposes. The fixture, when called without arguments,
generates a volume with a random name. Alternatively, specifying the
`name` argument creates a volume with the given name, using the
`MANAGED` volume type, and associating it with a randomly generated
catalog and schema. This promotes test isolation and prevents unintended
interference. Additionally, this PR resolves issue
[#70](#70) and includes
unit and integration tests that have been manually verified to ensure
the fixture's proper functioning. The commit also demonstrates a bug fix
related to table retrieval in the `test_remove_after_property_table`
test case.
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.

Add volume fixture
3 participants