-
Notifications
You must be signed in to change notification settings - Fork 1k
tools.graph:skip_build to omit tool/test-requires #17117
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
Merged
czoido
merged 6 commits into
conan-io:develop2
from
memsharded:feature/skip_build_requires
Oct 25, 2024
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a569fb
tools.graph:skip_build to omit tool/test-requires
memsharded 3a5f4ec
Merge branch 'develop2' into feature/skip_build_requires
memsharded 430fe81
review, new confs
memsharded 7d20aed
Merge branch 'develop2' into feature/skip_build_requires
memsharded 882aaba
warnings
memsharded 045c0a8
Add missing experimental to conf desc
AbrilRBS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import textwrap | ||
|
||
from conan.test.assets.genconanfile import GenConanfile | ||
from conan.test.utils.tools import TestClient | ||
|
||
|
||
def test_graph_skip_build_test(): | ||
# app -> pkg -(test)-> gtest | ||
# \---(tool)-> cmake | ||
c = TestClient(light=True) | ||
pkg = textwrap.dedent(""" | ||
from conan import ConanFile | ||
class Pkg(ConanFile): | ||
name = "pkg" | ||
version = "1.0" | ||
test_requires = "gtest/1.0" | ||
tool_requires = "cmake/1.0" | ||
""") | ||
c.save({"gtest/conanfile.py": GenConanfile("gtest", "1.0"), | ||
"cmake/conanfile.py": GenConanfile("cmake", "1.0"), | ||
"pkg/conanfile.py": pkg, | ||
"app/conanfile.py": GenConanfile("app", "1.0").with_requires("pkg/1.0")}) | ||
c.run("create gtest") | ||
c.run("create cmake") | ||
c.run("create pkg") | ||
c.run("create app -c tools.graph:skip_build=True -c tools.graph:skip_test=True") | ||
assert "cmake" not in c.out | ||
assert "gtest" not in c.out | ||
c.run("create app -c tools.graph:skip_test=True") | ||
assert "cmake" in c.out | ||
assert "gtest" not in c.out | ||
c.run("create app -c tools.graph:skip_build=True") | ||
assert "cmake" not in c.out | ||
assert "gtest" in c.out | ||
|
||
c.run("install app") | ||
assert "cmake" in c.out | ||
assert "gtest" in c.out | ||
|
||
c.run("install app -c tools.graph:skip_build=True -c tools.graph:skip_test=True") | ||
assert "cmake" not in c.out | ||
assert "gtest" not in c.out | ||
|
||
c.run("install app -c tools.graph:skip_build=True --build=pkg/*", assert_error=True) | ||
assert "ERROR: Package pkg/1.0 skipped its test/tool requires with tools.graph:skip_build, " \ | ||
"but was marked to be built " in c.out |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.