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

test to cover test_requires potential loop #15413

Merged
merged 3 commits into from Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions conans/test/integration/graph/core/test_build_requires.py
Expand Up @@ -405,6 +405,24 @@ def test_trait_aggregated(self):
_check_transitive(lib, [(gtest, True, True, False, False),
(zlib, True, True, False, False, False)])

def test_test_require_loop(self):
# https://github.com/conan-io/conan/issues/15412
self._cache_recipe("gtest/1.11", GenConanfile())
self._cache_recipe("abseil/1.0", GenConanfile().with_test_requires("gtest/[>=1 <1.14]"))
self._cache_recipe("gtest/1.14", GenConanfile().with_requires("abseil/1.0"))
deps_graph = self.build_graph(GenConanfile("opencv", "1.0").with_test_requires("gtest/1.14"))

self.assertEqual(4, len(deps_graph.nodes))
opencv = deps_graph.root
gtest14 = opencv.dependencies[0].dst
abseil = gtest14.dependencies[0].dst
gtest11 = abseil.dependencies[0].dst

self._check_node(opencv, "opencv/1.0@", deps=[gtest14], dependents=[])
self._check_node(gtest14, "gtest/1.14#123", deps=[abseil], dependents=[opencv])
self._check_node(abseil, "abseil/1.0#123", deps=[gtest11], dependents=[gtest14])
self._check_node(gtest11, "gtest/1.11#123", deps=[], dependents=[abseil])


class TestTestRequiresProblemsShared(GraphManagerTest):

Expand Down