Ejemplo n.º 1
0
def test_git(git_server, feed):
    git_server.create_repo("toolchains.git")
    oss_xml = """\
<feed>
    <package name="boost" url="boost.zip" />
</feed>
"""
    third_part_xml = """\
<feed>
  <package name="oracle-jdk" url="jdk.zip" />
</feed>
"""
    full_xml = """ \
<feed>
    <feed name="oss" />
    <feed name="3rdpart" />
</feed>
"""

    git_server.push_file("toolchains.git", "feeds/oss.xml", oss_xml)
    git_server.push_file("toolchains.git", "feeds/3rdpart.xml", third_part_xml)
    git_server.push_file("toolchains.git", "feeds/full.xml", full_xml)

    git_url = git_server.get_repo("toolchains.git").clone_url

    parser = ToolchainFeedParser("foo")
    parser.parse(git_url, name="full", branch="master")

    names = [x.name for x in parser.packages]
    assert names == ["boost", "oracle-jdk"]
Ejemplo n.º 2
0
def test_git_feed(qitoolchain_action, git_server, feed):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.change_branch("toolchains.git", "devel")
    git_server.push_file("toolchains.git",
                         "feeds/foo.xml",
                         feed.feed_xml.read(),
                         branch="devel")
    feed_url = git_server.get_repo("toolchains.git").clone_url

    qitoolchain_action("create", "--feed-name", "foo", "--branch", "devel",
                       "foo", feed_url)

    new_boost_package = qitoolchain.qipackage.QiPackage("boost",
                                                        version="1.55")
    feed.add_package(new_boost_package)
    git_server.push_file("toolchains.git",
                         "feeds/foo.xml",
                         feed.feed_xml.read(),
                         branch="devel")

    qitoolchain_action("update", "foo")
    foo_tc = qitoolchain.get_toolchain("foo")
    assert foo_tc.get_package("boost").version == "1.55"
Ejemplo n.º 3
0
def test_git(git_server, feed):
    git_server.create_repo("toolchains.git")
    oss_xml = """\
<feed>
    <package name="boost" url="boost.zip" />
</feed>
"""
    third_part_xml = """\
<feed>
  <package name="oracle-jdk" url="jdk.zip" />
</feed>
"""
    full_xml = """ \
<feed>
    <feed name="oss" />
    <feed name="3rdpart" />
</feed>
"""

    git_server.push_file("toolchains.git", "feeds/oss.xml", oss_xml)
    git_server.push_file("toolchains.git", "feeds/3rdpart.xml", third_part_xml)
    git_server.push_file("toolchains.git", "feeds/full.xml", full_xml)

    git_url = git_server.get_repo("toolchains.git").clone_url

    parser = ToolchainFeedParser("foo")
    parser.parse(git_url, name="full", branch="master")

    names = [x.name for x in parser.packages]
    assert names == ["boost", "oracle-jdk"]
Ejemplo n.º 4
0
def test_displays_git_info(tmpdir, git_server, feed, qitoolchain_action):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.change_branch("toolchains.git", "devel")
    git_server.push_file("toolchains.git",
                         "feeds/bar.xml",
                         feed.feed_xml.read(),
                         branch="devel")

    feed_url = git_server.get_repo("toolchains.git").clone_url

    git = qisrc.git.Git(tmpdir.strpath)
    _, out = git.call("ls-remote", feed_url, "devel", raises=False)
    devel_sha1 = out.split()[0][:8]

    qitoolchain_action("create", "--feed-name", "bar", "--branch", "devel",
                       "foo", feed_url)
    foo_tc = qitoolchain.get_toolchain("foo")
    as_str = str(foo_tc)
    print as_str
    assert "on devel" in as_str
    assert "(feeds/bar.xml)" in as_str
    assert "from %s" % feed_url in as_str
    assert devel_sha1 in as_str
Ejemplo n.º 5
0
def test_info(qibuild_action, qisrc_action, git_server, record_messages):
    git_server.create_repo("foo.git")
    qisrc_action("init", git_server.manifest_url)
    qibuild_action.create_project("foo")
    record_messages.reset()
    qibuild_action("info", "foo")
    assert record_messages.find("src: foo")
    assert record_messages.find("repo: foo.git")
Ejemplo n.º 6
0
def test_info(qibuild_action, qisrc_action, git_server, record_messages):
    git_server.create_repo("foo.git")
    qisrc_action("init", git_server.manifest_url)
    qibuild_action.create_project("foo")
    record_messages.reset()
    qibuild_action("info", "foo")
    assert record_messages.find("src: foo")
    assert record_messages.find("repo: foo.git")
Ejemplo n.º 7
0
def _generic_test_git(git_server, _feed, full_xml, oss_xml, third_part_xml):
    """ Generic Git Test """
    git_server.create_repo("toolchains.git")
    git_server.push_file("toolchains.git", "feeds/oss.xml", oss_xml)
    git_server.push_file("toolchains.git", "feeds/3rdpart.xml", third_part_xml)
    git_server.push_file("toolchains.git", "feeds/full.xml", full_xml)
    git_url = git_server.get_repo("toolchains.git").clone_url
    parser = ToolchainFeedParser("foo")
    parser.parse(git_url, name="full", branch="master")
    names = [x.name for x in parser.packages]
    assert names == ["boost", "oracle-jdk"]
Ejemplo n.º 8
0
def _generic_test_git(git_server, _feed, full_xml, oss_xml, third_part_xml):
    """ Generic Git Test """
    git_server.create_repo("toolchains.git")
    git_server.push_file("toolchains.git", "feeds/oss.xml", oss_xml)
    git_server.push_file("toolchains.git", "feeds/3rdpart.xml", third_part_xml)
    git_server.push_file("toolchains.git", "feeds/full.xml", full_xml)
    git_url = git_server.get_repo("toolchains.git").clone_url
    parser = ToolchainFeedParser("foo")
    parser.parse(git_url, name="full", branch="master")
    names = [x.name for x in parser.packages]
    assert names == ["boost", "oracle-jdk"]
Ejemplo n.º 9
0
def test_info(qibuild_action, qisrc_action, git_server, record_messages):
    """ Test Info """
    git_server.create_repo("foo.git")
    qisrc_action("init", git_server.manifest_url)
    foo_project = qibuild_action.create_project("foo")
    record_messages.reset()
    qibuild_action("info", "foo")
    assert record_messages.find("src: foo")
    assert record_messages.find("repo: foo.git")
    qibuild_action.chdir(foo_project.path)
    record_messages.reset()
    qibuild_action("info")
    assert record_messages.find("Build project: foo")
Ejemplo n.º 10
0
def test_info(qibuild_action, qisrc_action, git_server, record_messages):
    """ Test Info """
    git_server.create_repo("foo.git")
    qisrc_action("init", git_server.manifest_url)
    foo_project = qibuild_action.create_project("foo")
    record_messages.reset()
    qibuild_action("info", "foo")
    assert record_messages.find("src: foo")
    assert record_messages.find("repo: foo.git")
    qibuild_action.chdir(foo_project.path)
    record_messages.reset()
    qibuild_action("info")
    assert record_messages.find("Build project: foo")
Ejemplo n.º 11
0
def test_git_feed(qitoolchain_action, git_server, feed):
    """ Test Git Feed """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.change_branch("toolchains.git", "devel")
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read(), branch="devel")
    feed_url = git_server.get_repo("toolchains.git").clone_url
    qitoolchain_action("create", "--feed-name", "foo", "--branch", "devel", "foo", feed_url)
    new_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.55")
    feed.add_package(new_boost_package)
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read(), branch="devel")
    qitoolchain_action("update", "foo")
    foo_tc = qitoolchain.get_toolchain("foo")
    assert foo_tc.get_package("boost").version == "1.55"
Ejemplo n.º 12
0
def test_git_feed(toolchain_db, feed, git_server):
    """ Test Git Feed """
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read())
    url = git_server.get_repo("toolchains.git").clone_url
    toolchain = qitoolchain.toolchain.Toolchain("foo")
    toolchain.update(url, branch="master", name="foo")
    boost = toolchain.get_package("boost")
    assert boost.version == "1.44"
    new_boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.55")
    feed.add_package(new_boost_package)
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read())
    toolchain.update()
    boost = toolchain.get_package("boost")
    assert boost.version == "1.55"
Ejemplo n.º 13
0
def test_switching_to_git_feed(qitoolchain_action, git_server, feed, record_messages):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    qitoolchain_action("create", "foo", feed.feed_xml.strpath)
    toolchain_repo = git_server.create_repo("toolchains.git")
    boost_package.version = "1.45"
    feed.add_package(boost_package)
    git_server.push_file("toolchains.git", "feeds/foo.xml", feed.feed_xml.read())
    qitoolchain_action("update", "--feed-name", "foo", "foo", toolchain_repo.clone_url)
    assert record_messages.find("from 1.44 to 1.45")
    qitoolchain_action("info", "foo")
    assert record_messages.find("on master")
Ejemplo n.º 14
0
def test_displays_git_info(tmpdir, git_server, feed, qitoolchain_action):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    git_server.create_repo("toolchains.git")
    git_server.change_branch("toolchains.git", "devel")
    git_server.push_file("toolchains.git", "feeds/bar.xml", feed.feed_xml.read(),
                         branch="devel")

    feed_url = git_server.get_repo("toolchains.git").clone_url

    git = qisrc.git.Git(tmpdir.strpath)
    _, out = git.call("ls-remote", feed_url, "devel", raises=False)
    devel_sha1 = out.split()[0][:8]

    qitoolchain_action("create", "--feed-name", "bar", "--branch", "devel", "foo", feed_url)
    foo_tc = qitoolchain.get_toolchain("foo")
    as_str = str(foo_tc)
    print as_str
    assert "on devel" in as_str
    assert "(feeds/bar.xml)" in as_str
    assert "from %s" % feed_url in as_str
    assert devel_sha1 in as_str
def test_switching_to_git_feed(qitoolchain_action, git_server, feed,
                               record_messages):
    boost_package = qitoolchain.qipackage.QiPackage("boost", version="1.44")
    feed.add_package(boost_package)
    qitoolchain_action("create", "foo", feed.feed_xml.strpath)
    toolchain_repo = git_server.create_repo("toolchains.git")
    boost_package.version = "1.45"
    feed.add_package(boost_package)
    git_server.push_file("toolchains.git", "feeds/foo.xml",
                         feed.feed_xml.read())
    qitoolchain_action("update", "--feed-name", "foo", "foo",
                       toolchain_repo.clone_url)
    assert record_messages.find("from 1.44 to 1.45")
    qitoolchain_action("info", "foo")
    assert record_messages.find("on master")