-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature/test package br #8787
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
Feature/test package br #8787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just some comment with ConanCenter in mind:
- Right now we are only using one profile. I see the test works the same, but the
cmake_find_package
file is generated... is it a problem in this context? - The test suite needs a test case using
conan test
command to execute this functionality with a package that already exists (in the cache and/or in the remote), it should be exactly the same. - We need a test (additional feature?) where the package being tested is used as a
requirement
and also as abuild_requirement
. Recipes for packages likeprotobuf
are already doing it.
I see. Then, this might need some changes, I'll try to come up with a proposal for this. |
If we go with the explicit attribute approach, maybe it is enough to write explicitly: class Pkg(ConanFile):
test_build_require = True
test_require = True |
Proposed:
To have something that scales a bit better if we have other kind of requires in the future, and also changed the name, to avoid confusion with so many "xxx-requires" things. I have also added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing it locally and indeed the conan test
command is not adding the build_requires
when using only one profile... 😞 is this something that can be fixed?
In different scenarios in ConanCenter the packages are already built and we want to run only the tests: a commit in a PR that modifies only the test_package
files, a PR that is modifying only test_package/***
,...
If this is not something we can fix, we need to be really confident that the same packageID will be computed if using one profile or two (which, btw, is something we need to start checking sooner than later)...
This is not related to this feature. When using only 1 profile, there is only 1 context, and both requirements are the same node in host context, because they are compatible and do not conflict. Is kind of diamond with only 1 vertex. This cannot be fixed when using only 1 profile. |
Changelog: Feature: Implement
test_build_require
intest_package/conanfile.py
recipes, so build_requires can be tested as such.Docs: conan-io/docs#2081
Comes from #8627, but isolating only the
test_package
functionality, which is way more necessary, for example for ConanCenter.