Beispiel #1
0
        def assert_order(inputs):
            info = IvyInfo("default")
            for module in inputs:
                info.add_module(module)

            def collector(dep):
                return OrderedSet([dep])

            result = [ref for ref in info.traverse_dependency_graph(ref1, collector)]
            self.assertEqual([ref1, ref2, ref3, ref5, ref6, ref4], result)
Beispiel #2
0
        def assert_order(inputs):
            info = IvyInfo("default")
            for module in inputs:
                info.add_module(module)

            def collector(dep):
                return OrderedSet([dep])

            result = [ref for ref in info.traverse_dependency_graph(ref1, collector)]
            self.assertEquals([ref1, ref2, ref3, ref5, ref6, ref4], result)
Beispiel #3
0
        def mock_ivy_info_for(conf):
            ivy_info = IvyInfo(conf)

            # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
            # resolve, it's possible that before it was evicted, it would
            # generate some resolution data.

            artifact_1 = artifact_path("bogus0")
            unused_artifact = artifact_path("unused")

            # Because guava 16.0 was evicted, it has no artifacts.
            guava_0 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0"), None, [])
            guava_1 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0.1"), artifact_1, [])
            ivy_info.add_module(guava_0)
            ivy_info.add_module(guava_1)

            artifact_dep_1 = artifact_path("bogus1")

            # Because fake#dep 16.0 was evicted before it was resolved,
            # its deps are never examined, so we don't call add_module.
            guava_dep_0 = IvyModule(IvyModuleRef("com.google.fake", "dep", "16.0.0"), None, [guava_0.ref])
            guava_dep_1 = IvyModule(IvyModuleRef("com.google.fake", "dep", "16.0.1"), artifact_dep_1, [guava_1.ref])

            ivy_info.add_module(guava_dep_0)
            ivy_info.add_module(guava_dep_1)

            # Add an unrelated module to ensure that it's not returned.
            unrelated_parent = IvyModuleRef("com.google.other", "parent", "1.0")
            unrelated = IvyModule(
                IvyModuleRef("com.google.unrelated", "unrelated", "1.0"), unused_artifact, [unrelated_parent]
            )
            ivy_info.add_module(unrelated)

            return ivy_info
Beispiel #4
0
        def mock_generate_ivy_jar_products(cache_key_ignored):
            ivy_products = defaultdict(list)
            ivy_info = IvyInfo()

            # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
            # resolve, it's possible that before it was evicted, it would
            # generate some resolution data.

            artifact_1 = artifact_path('bogus0')
            unused_artifact = artifact_path('unused')

            # Because guava 16.0 was evicted, it has no artifacts
            guava_0 = IvyModule(
                IvyModuleRef('com.google.guava', 'guava', '16.0'), None, [])
            guava_1 = IvyModule(
                IvyModuleRef('com.google.guava', 'guava', '16.0.1'),
                artifact_1, [])
            ivy_info.add_module(guava_0)
            ivy_info.add_module(guava_1)

            artifact_dep_1 = artifact_path('bogus1')

            # Because fake#dep 16.0 was evicted before it was resolved,
            # its deps are never examined, so we don't call add_module.
            guava_dep_0 = IvyModule(
                IvyModuleRef('com.google.fake', 'dep', '16.0.0'), None,
                [guava_0.ref])
            guava_dep_1 = IvyModule(
                IvyModuleRef('com.google.fake', 'dep', '16.0.1'),
                artifact_dep_1, [guava_1.ref])

            ivy_info.add_module(guava_dep_0)
            ivy_info.add_module(guava_dep_1)

            # Add an unrelated module to ensure that it's not returned
            unrelated_parent = IvyModuleRef('com.google.other', 'parent',
                                            '1.0')
            unrelated = IvyModule(
                IvyModuleRef('com.google.unrelated', 'unrelated', '1.0'),
                unused_artifact, [unrelated_parent])
            ivy_info.add_module(unrelated)

            ivy_products['default'] = [ivy_info]
            return ivy_products
Beispiel #5
0
        def mock_ivy_info_for(conf):
            ivy_info = IvyInfo(conf)

            # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
            # resolve, it's possible that before it was evicted, it would
            # generate some resolution data.

            artifact_1 = artifact_path("bogus0")
            unused_artifact = artifact_path("unused")

            # Because guava 16.0 was evicted, it has no artifacts.
            guava_0 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0"), None, [])
            guava_1 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0.1"), artifact_1, [])
            ivy_info.add_module(guava_0)
            ivy_info.add_module(guava_1)

            artifact_dep_1 = artifact_path("bogus1")

            # Because fake#dep 16.0 was evicted before it was resolved,
            # its deps are never examined, so we don't call add_module.
            guava_dep_0 = IvyModule(
                IvyModuleRef("com.google.fake", "dep", "16.0.0"), None, [guava_0.ref]
            )
            guava_dep_1 = IvyModule(
                IvyModuleRef("com.google.fake", "dep", "16.0.1"), artifact_dep_1, [guava_1.ref]
            )

            ivy_info.add_module(guava_dep_0)
            ivy_info.add_module(guava_dep_1)

            # Add an unrelated module to ensure that it's not returned.
            unrelated_parent = IvyModuleRef("com.google.other", "parent", "1.0")
            unrelated = IvyModule(
                IvyModuleRef("com.google.unrelated", "unrelated", "1.0"),
                unused_artifact,
                [unrelated_parent],
            )
            ivy_info.add_module(unrelated)

            return ivy_info
Beispiel #6
0
    def mock_generate_ivy_jar_products(targets):
      ivy_products = defaultdict(list)
      ivy_info = IvyInfo()
      artifacts = []
      callers = []

      # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
      # resolve, it's possible that before it was evicted, it would
      # generate some resolution data.

      artifact_1 = IvyUtilArtifact('bogus0', 'default')
      unused_artifact = IvyUtilArtifact('unused', 'default')

      # Because guava 16.0 was evicted, it has no artifacts
      guava_0 = IvyModule(IvyModuleRef('com.google.guava', 'guava', '16.0'),
                          [], [])
      guava_1 = IvyModule(IvyModuleRef('com.google.guava', 'guava', '16.0.1'),
                          [artifact_1], [])
      ivy_info.add_module(guava_0)
      ivy_info.add_module(guava_1)

      artifact_dep_1 = IvyUtilArtifact('bogus1', 'default')

      # Because fake#dep 16.0 was evicted before it was resolved,
      # its deps are never examined, so we don't call add_module.
      guava_dep_0 = IvyModule(IvyModuleRef('com.google.fake', 'dep', '16.0.0'),
                              [], [guava_0.ref])
      guava_dep_1 = IvyModule(IvyModuleRef('com.google.fake', 'dep', '16.0.1'),
                              [artifact_dep_1], [guava_1.ref])

      ivy_info.add_module(guava_dep_0)
      ivy_info.add_module(guava_dep_1)

      # Add an unrelated module to ensure that it's not returned
      unrelated_parent = IvyModuleRef('com.google.other', 'parent', '1.0')
      unrelated = IvyModule(IvyModuleRef('com.google.unrelated', 'unrelated', '1.0'),
                            [unused_artifact], [unrelated_parent])
      ivy_info.add_module(unrelated)

      ivy_products['default'] = [ivy_info]
      return ivy_products
Beispiel #7
0
    def mock_parse_report(resolve_hash_name_ignored, conf):
      ivy_info = IvyInfo(conf)

      # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
      # resolve, it's possible that before it was evicted, it would
      # generate some resolution data.

      artifact_1 = artifact_path('bogus0')
      unused_artifact = artifact_path('unused')

      # Because guava 16.0 was evicted, it has no artifacts
      guava_0 = IvyModule(IvyModuleRef('com.google.guava', 'guava', '16.0'),
                          None, [])
      guava_1 = IvyModule(IvyModuleRef('com.google.guava', 'guava', '16.0.1'),
                          artifact_1, [])
      ivy_info.add_module(guava_0)
      ivy_info.add_module(guava_1)

      artifact_dep_1 = artifact_path('bogus1')

      # Because fake#dep 16.0 was evicted before it was resolved,
      # its deps are never examined, so we don't call add_module.
      guava_dep_0 = IvyModule(IvyModuleRef('com.google.fake', 'dep', '16.0.0'),
                              None, [guava_0.ref])
      guava_dep_1 = IvyModule(IvyModuleRef('com.google.fake', 'dep', '16.0.1'),
                              artifact_dep_1, [guava_1.ref])

      ivy_info.add_module(guava_dep_0)
      ivy_info.add_module(guava_dep_1)

      # Add an unrelated module to ensure that it's not returned
      unrelated_parent = IvyModuleRef('com.google.other', 'parent', '1.0')
      unrelated = IvyModule(IvyModuleRef('com.google.unrelated', 'unrelated', '1.0'),
                            unused_artifact, [unrelated_parent])
      ivy_info.add_module(unrelated)

      return ivy_info
        def mock_generate_ivy_jar_products(cache_key_ignored):
            ivy_products = defaultdict(list)
            ivy_info = IvyInfo()

            # Guava 16.0 would be evicted by Guava 16.0.1.  But in a real
            # resolve, it's possible that before it was evicted, it would
            # generate some resolution data.

            artifact_1 = IvyUtilArtifact("bogus0", "default")
            unused_artifact = IvyUtilArtifact("unused", "default")

            # Because guava 16.0 was evicted, it has no artifacts
            guava_0 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0"), [], [])
            guava_1 = IvyModule(IvyModuleRef("com.google.guava", "guava", "16.0.1"), [artifact_1], [])
            ivy_info.add_module(guava_0)
            ivy_info.add_module(guava_1)

            artifact_dep_1 = IvyUtilArtifact("bogus1", "default")

            # Because fake#dep 16.0 was evicted before it was resolved,
            # its deps are never examined, so we don't call add_module.
            guava_dep_0 = IvyModule(IvyModuleRef("com.google.fake", "dep", "16.0.0"), [], [guava_0.ref])
            guava_dep_1 = IvyModule(IvyModuleRef("com.google.fake", "dep", "16.0.1"), [artifact_dep_1], [guava_1.ref])

            ivy_info.add_module(guava_dep_0)
            ivy_info.add_module(guava_dep_1)

            # Add an unrelated module to ensure that it's not returned
            unrelated_parent = IvyModuleRef("com.google.other", "parent", "1.0")
            unrelated = IvyModule(
                IvyModuleRef("com.google.unrelated", "unrelated", "1.0"), [unused_artifact], [unrelated_parent]
            )
            ivy_info.add_module(unrelated)

            ivy_products["default"] = [ivy_info]
            return ivy_products