conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.95k stars 951 forks source link

Auto-download most non-Windows tools for tests, refactor `files.unzip()` for internal use #16548

Closed valgur closed 4 days ago

valgur commented 4 days ago

The initial setup for running tests is currently quite substantial due to the number of tools and versions of them required. I hope this PR can alleviate this by adding optional support for downloading of the following test tools: CMake, Bazel, Premake, Ninja, Meson, Scons and Qbs.

I also refactored conan.tools.files.unzip() to re-use its functionality internally for this use case.

Some test dirs were also missing a __init__.py which caused issues for pytest on my machine. I included them in this PR as well.

I dropped the test tool paths from the default config for CMake and Bazel, which were pointing to paths used by CI. This was done partially to test this feature in CI. Since this re-downloading these tools every time adds some unnecessary overhead and fragility to the CI, perhaps the Jenkins pipeline could be reconfigured to cache and restore the test/tools subdir on every run?

I have only tested these changes on an x86_64 Linux system.


Changelog: (Feature | Fix | Bugfix): N/A Docs: https://github.com/conan-io/docs/pull/XXXX

valgur commented 4 days ago

Don't know what to do about the failing continuous-integration/jenkins/pr-merge check. I only see a "403 Forbidden" error.

czoido commented 4 days ago

Hi @valgur,

Thanks for the contribution. I'm sorry to say that we can't accept this PR. We believe that setting up the platform for running the tests should not be done within Conan's code. You can use a conftest_user.py file to point files to locations different from the ones we use in our CI. Additionally, you can run external scripts to configure the machines you use for testing.

Due to these reasons, I will have to close this PR. We appreciate your understanding.

czoido commented 4 days ago

Although I closed this I have to say that we understand your use case, and we encourage you to open an issue detailing it thoroughly. We can consider it and provide guidance if you decide to open another PR.