opendal icon indicating copy to clipboard operation
opendal copied to clipboard

new feature: improve the test cleanup to remove all test files after running tests

Open meteorgan opened this issue 1 year ago • 0 comments

Feature Description

delete all test files permanently after running tests

Problem and Solution

Current behaviors

  1. some test files are generated by TEST_FIXTURE, they gets deleted automatically after running the tests. such as: https://github.com/apache/opendal/blob/d479ac39efa9a88e10448ad81e47292b3b4ed688/core/tests/behavior/async_write.rs#L71
  2. some test files are generated during test cases and are manually removed before the test cases finish. such as: https://github.com/apache/opendal/blob/d479ac39efa9a88e10448ad81e47292b3b4ed688/core/tests/behavior/async_write.rs#L143

Problems

There are some cases where the test files might not be permanently deleted, which could lead to increased storage usage in backend services.

  1. In the first scenario, when versioning is enabled, even if we delete the test files after running the tests, they still remain due to versioning. To remove them permanently, we must use a delete operation that specifies the version.
  2. In the second scenario, if the test cases fail, the cleanup process will not be executed, leaving the test files behind.

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • [ ] Yes, I am willing to contribute to the development of this feature.

meteorgan avatar Sep 25 '24 13:09 meteorgan