@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.
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.