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

The bucket_manager fixture teardown deletes buckets that weren't created in the testing session #9

Open
sagihirshfeld opened this issue Jan 28, 2024 · 0 comments

Comments

@sagihirshfeld
Copy link
Contributor

@pytest.fixture
def bucket_manager(request):
    bucket_manager = BucketManager()

    def bucket_cleanup():
        for bucket in bucket_manager.list():
            bucket_manager.delete(bucket)

    request.addfinalizer(bucket_cleanup)
    return bucket_manager

Since bucket_manager.list() lists all the buckets on the NSFS server, this fixture deletes all of them on teardown. This is somewhat of an unexpected result of running the CI.

From from QE perspective, it's merely inconvenient since we can lose buckets that we might rely on for manual testing, but if users outside of QE use this CI they might accidentally lose data after using the CI.

This can be easily fixed by keeping track of the created and deleted buckets in BucketManager in a list or a dict.

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

No branches or pull requests

1 participant