Skip to content

Conversation

HJLebbink
Copy link
Member

@HJLebbink HJLebbink commented Feb 13, 2025

Note: depends on #114

Refactored one large test into separate tests. It runs 2 twice as fast as a result

@HJLebbink HJLebbink added the enhancement Used in release doc generation label Feb 13, 2025
@HJLebbink HJLebbink force-pushed the update-tests branch 2 times, most recently from 533bf80 to 08fd05c Compare February 13, 2025 09:43
@HJLebbink HJLebbink requested review from balamurugana and donatello and removed request for donatello February 13, 2025 09:53
@HJLebbink HJLebbink marked this pull request as ready for review February 13, 2025 09:58
@HJLebbink HJLebbink marked this pull request as draft February 13, 2025 11:01
@HJLebbink HJLebbink marked this pull request as ready for review February 13, 2025 12:07
@donatello
Copy link
Member

Please fix conflicts @HJLebbink

@HJLebbink
Copy link
Member Author

Please fix conflicts @HJLebbink

@donatello I rebased. Two minor issues with the code.

  1. Every test is responsible for removing the stuff it created. But if the test fails the remove_bucket_helper may not be called.
  2. TestContext.new_from_env (that reads the environment variables) only works with the configuration used by the build server. For a setup with play.min.io or my local box, it has bugs reading the env variables. A fixed version TestContex.new_from_env_new fixes that, but it does not work on with the build server.

@HJLebbink
Copy link
Member Author

@donatello

I fixed that tests may not always cleanup their stuff.

PTAL

@donatello
Copy link
Member

donatello commented Feb 26, 2025

TestContext.new_from_env (that reads the environment variables) only works with the configuration used by the build server. For a setup with play.min.io or my local box, it has bugs reading the env variables. A fixed version TestContex.new_from_env_new fixes that, but it does not work on with the build server.

For this part, you can check a CI variable like CI=true https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables to decide if test is running in CI environment.

@donatello
Copy link
Member

It is also ok to hardcode play creds for running tests in the local environment. I suggest something like:

  1. if CI=true, assume the minio server launched in CI environment for running in github CI
  2. Otherwise, look for endpoint env var like MINIO_ENDPOINT=domain:port with MINIO_ACCESS_KEY and MINIO_SECRET_KEY for creds (maybe default these to minioadmin:minioadmin if not present) and MINIO_SECURE=1 for https (default to http).
  3. if no endpoint is given, assume play server's creds and run tests.

@HJLebbink HJLebbink force-pushed the update-tests branch 2 times, most recently from 12e6f61 to e9a226d Compare February 27, 2025 08:44
@HJLebbink
Copy link
Member Author

Hi @donatello, I've updated the creation of the TextContext from env variables.

PTAL

@donatello donatello merged commit c4e302d into minio:master Feb 28, 2025
2 checks passed
@HJLebbink HJLebbink deleted the update-tests branch February 28, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Used in release doc generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants