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

Automatically download mc and minio for unit tests #61

Open
bbockelm opened this issue Nov 25, 2024 · 2 comments
Open

Automatically download mc and minio for unit tests #61

bbockelm opened this issue Nov 25, 2024 · 2 comments
Assignees

Comments

@bbockelm
Copy link
Collaborator

The mc and minio binaries are requirements for running all the S3-related unit tests. If they aren't discovered in the $PATH, we should download them (probably with FetchContent?) from the relevant locations:

This will help simplify setting up the environment for running tests.

@bbockelm
Copy link
Collaborator Author

bbockelm commented Jan 3, 2025

Some thoughts on this:

  • The logic should be something along the lines of "find the mc command using find_program; if that fails, download mc and use that".
  • This should be added to the CMakeLists.txt in the tests subdirectory.
  • The CMake documentation for simple downloads (with checksum verification) is here; make sure you download into the CMAKE_CURRENT_BINARY_DIR, set things as executable, and point the variable to the newly-downloaded file. I think the file command may be closer to what we want than the FetchContent link I originally shared.
  • Once we've resolved the mc command to use at configure time, we would specify it to the tests via an environment variable (as is done here).

Rinse and repeat for minio.

Now, above, I include a few different sample URLs for the different clients.

  • CMAKE_SYSTEM_PROCESSOR should return x86_64 or arm64 (output of uname -m, I think). Probably have to do some conditionals to translate to the right URL (e.g., x86_64 -> amd64).
  • CMAKE_SYSTEM_NAME should return the OS name (many variants of "Linux" exist; may be best to detect if it's Darwin and otherwise use Linux).

@bbockelm
Copy link
Collaborator Author

bbockelm commented Feb 4, 2025

Input from @rw2 from Slack: if minio/mc are not available (for example, if this code exists but the container doesn't have network connectivity), we should completely skip the S3 tests at the CMake level. That'll avoid quite a bit of noise for cases where the test has no chance of success.

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

2 participants