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

- BugFix: allow tested_reference_str to be None #10834

Merged
merged 1 commit into from Mar 21, 2022

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Mar 21, 2022

closes: #10714

Changelog: Feature: Allow tested_reference_str to be None.
Docs: omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@SSE4 SSE4 force-pushed the info_tested_reference_str branch from 47328b5 to f0776ff Compare March 21, 2022 07:46
Copy link
Contributor

@lasote lasote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to avoid that new argument. We've been discussing and we might prefer if self.requires(None) and self.build_requires(None) don't do anything, that is actually more accurate to the current behavior with 1.X, because the whole graph is not computed either, just the test_package and its requires. Probably we need to initialize the self.tested_reference_str to None always. WDYT?

@SSE4
Copy link
Contributor Author

SSE4 commented Mar 21, 2022

We would like to avoid that new argument. We've been discussing and we might prefer if self.requires(None) and self.build_requires(None) don't do anything, that is actually more accurate to the current behavior with 1.X, because the whole graph is not computed either, just the test_package and its requires. Probably we need to initialize the self.tested_reference_str to None always. WDYT?

I am personally fine with that. it will allow to compute requirements of test_package in our CI, and we already have requirements of the package itself computed. (well, it might not work if test_package changes options of requirements, but it doesn't matter for CCI in this case, as it will fail for a different reason - missing package, cause package built is not one being tested).

@SSE4 SSE4 force-pushed the info_tested_reference_str branch from f0776ff to 9cd2470 Compare March 21, 2022 13:20
@SSE4 SSE4 changed the title - BugFix: set tested_reference_str from conan info - BugFix: allow tested_reference_str to be None Mar 21, 2022
@SSE4
Copy link
Contributor Author

SSE4 commented Mar 21, 2022

@lasote I've changed the implementation according to your suggestion. tested_reference_str is initialized to None. self.requires(None) and self.build_requires(None) are no-ops now.

.with_test_type("explicit")\
.with_requirement("placeholder")\
.with_build_requirement("placeholder")
conanfile = str(conanfile).replace('"placeholder"', 'self.tested_reference_str')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth the trick. Just write a explicit conanfile it will be just a couple of lines longer, but way more explicit and understandable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, changed

Signed-off-by: SSE4 <tomskside@gmail.com>
@SSE4 SSE4 force-pushed the info_tested_reference_str branch from 9cd2470 to dbb7fa8 Compare March 21, 2022 13:34
@lasote lasote added this to the 1.47 milestone Mar 21, 2022
@lasote lasote merged commit 2d67de9 into conan-io:develop Mar 21, 2022
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

Successfully merging this pull request may close these issues.

[question] how to run conan info on test_package?
3 participants