Skip to content

Commit

Permalink
Update the catkin release test to use noetic
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Mar 22, 2024
1 parent 7b534e4 commit 7e41ccc
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions test/system_tests/test_catkin_release.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These system tests are testing the release of melodic+ catkin projects.
These system tests are testing the release of noetic+ catkin projects.
"""

from __future__ import print_function
Expand Down Expand Up @@ -36,14 +36,14 @@


def create_upstream_repository(packages, directory=None, format_versions=None):
upstream_dir = 'upstream_repo_melodic'
upstream_dir = 'upstream_repo_noetic'
user('mkdir ' + upstream_dir)
with change_directory(upstream_dir):
user('git init .')
user('echo "readme stuff" >> README.md')
user('git add README.md')
user('git commit -m "Initial commit" --allow-empty')
user('git checkout -b melodic_devel')
user('git checkout -b noetic_devel')
if format_versions is None:
format_versions = [1] * len(packages)
for package, format_version in zip(packages, format_versions):
Expand All @@ -54,7 +54,7 @@ def create_upstream_repository(packages, directory=None, format_versions=None):
<package format="{format_version}">
<name>{package}</name>
<version>0.1.0</version>
<description>A catkin (melodic) ROS package called '{package}'</description>
<description>A catkin (noetic) ROS package called '{package}'</description>
<maintainer email="bar@baz.com">Bar</maintainer>
<license{license_file_attr}>BSD</license>
Expand Down Expand Up @@ -94,7 +94,7 @@ def _test_unary_package_repository(release_dir, version, directory=None, env=Non
with change_directory(release_dir):
# First run everything
with bloom_answer(bloom_answer.ASSERT_NO_QUESTION):
cmd = 'git-bloom-release{0} melodic'
cmd = 'git-bloom-release{0} noetic'
if 'BLOOM_VERBOSE' not in os.environ:
cmd = cmd.format(' --quiet')
else:
Expand Down Expand Up @@ -127,20 +127,20 @@ def _test_unary_package_repository(release_dir, version, directory=None, env=Non
# patch import should have reported OK
assert ret == code.OK, "actually returned ({0})".format(ret)
# do the proper branches exist?
assert branch_exists('release/melodic/foo'), \
"no release/melodic/foo branch"
assert branch_exists('patches/release/melodic/foo'), \
"no patches/release/melodic/foo branch"
assert branch_exists('release/noetic/foo'), \
"no release/noetic/foo branch"
assert branch_exists('patches/release/noetic/foo'), \
"no patches/release/noetic/foo branch"
# was the release tag created?
ret, out, err = user('git tag', return_io=True)
expected = 'release/melodic/foo/' + version + '-1'
expected = 'release/noetic/foo/' + version + '-1'
assert out.count(expected) == 1, \
"no release tag created, expected: '{0}'".format(expected)

###
### Make patch
###
with inbranch('release/melodic/foo'):
with inbranch('release/noetic/foo'):
assert os.path.exists(os.path.join('debian', 'something.udev')), \
"Lost the debian overlaid files in release branch"
assert os.path.exists('white space.txt~'), \
Expand All @@ -158,7 +158,7 @@ def _test_unary_package_repository(release_dir, version, directory=None, env=Non
###
### Test import and export
###
with inbranch('release/melodic/foo'):
with inbranch('release/noetic/foo'):
export_cmd.export_patches()
remove_cmd.remove_patches()
import_cmd.import_patches()
Expand All @@ -169,26 +169,26 @@ def _test_unary_package_repository(release_dir, version, directory=None, env=Non
# patch import should have reported OK
assert ret == code.OK, "actually returned ({0})".format(ret)
# do the proper branches exist?
assert branch_exists('release/melodic/foo'), \
"no release/melodic/foo branch"
assert branch_exists('patches/release/melodic/foo'), \
"no patches/release/melodic/foo branch"
assert branch_exists('release/noetic/foo'), \
"no release/noetic/foo branch"
assert branch_exists('patches/release/noetic/foo'), \
"no patches/release/noetic/foo branch"
# was the release tag created?
ret, out, err = user('git tag', return_io=True)
assert out.count('release/melodic/foo/' + version) == 1, \
assert out.count('release/noetic/foo/' + version) == 1, \
"no release tag created"


@in_temporary_directory
def test_unary_package_repository(directory=None):
"""
Release a single package catkin (melodic) repository.
Release a single package catkin (noetic) repository.
"""
directory = directory if directory is not None else os.getcwd()
# Initialize rosdep
rosdep_dir = os.path.join(directory, 'foo_rosdep')
env = dict(os.environ)
fake_distros = {'melodic': {'ubuntu': ['bionic']}}
fake_distros = {'noetic': {'ubuntu': ['focal']}}
fake_rosdeps = {
'catkin': {'ubuntu': []},
'roscpp_core': {'ubuntu': []}
Expand All @@ -200,8 +200,8 @@ def test_unary_package_repository(directory=None):
release_url = create_release_repo(
upstream_url,
'git',
'melodic_devel',
'melodic')
'noetic_devel',
'noetic')
release_dir = os.path.join(directory, 'foo_release_clone')
release_client = get_vcs_client('git', release_dir)
assert release_client.checkout(release_url)
Expand All @@ -217,16 +217,16 @@ def test_unary_package_repository(directory=None):
@in_temporary_directory
def test_multi_package_repository(directory=None):
"""
Release a multi package catkin (melodic) repository.
Release a multi package catkin (noetic) repository.
"""
directory = directory if directory is not None else os.getcwd()
# Initialize rosdep
rosdep_dir = os.path.join(directory, 'foo_rosdep')
env = dict(os.environ)
fake_distros = {
'melodic': {
'debian': ['stretch'],
'ubuntu': ['bionic']
'noetic': {
'debian': ['buster'],
'ubuntu': ['focal']
}
}
fake_rosdeps = {
Expand All @@ -241,15 +241,15 @@ def test_multi_package_repository(directory=None):
release_url = create_release_repo(
upstream_url,
'git',
'melodic_devel',
'melodic')
'noetic_devel',
'noetic')
release_dir = os.path.join(directory, 'foo_release_clone')
release_client = get_vcs_client('git', release_dir)
assert release_client.checkout(release_url)
with change_directory(release_dir):
# First run everything
with bloom_answer(bloom_answer.ASSERT_NO_QUESTION):
cmd = 'git-bloom-release{0} melodic'
cmd = 'git-bloom-release{0} noetic'
if 'BLOOM_VERBOSE' not in os.environ:
cmd = cmd.format(' --quiet')
else:
Expand Down Expand Up @@ -284,24 +284,24 @@ def test_multi_package_repository(directory=None):
ret, out, err = user('git tag', return_io=True)
for pkg in pkgs:
# Does the release/pkg branch exist?
assert branch_exists('release/melodic/' + pkg), \
"no release/melodic/" + pkg + " branch"
assert branch_exists('release/noetic/' + pkg), \
"no release/noetic/" + pkg + " branch"
# Does the patches/release/pkg branch exist?
assert branch_exists('patches/release/melodic/' + pkg), \
"no patches/release/melodic/" + pkg + " branch"
assert branch_exists('patches/release/noetic/' + pkg), \
"no patches/release/noetic/" + pkg + " branch"
# Did the release tag get created?
assert out.count('release/melodic/' + pkg + '/0.1.0-1') == 1, \
assert out.count('release/noetic/' + pkg + '/0.1.0-1') == 1, \
"no release tag created for " + pkg
# Is there a package.xml in the top level?
with inbranch('release/melodic/' + pkg):
with inbranch('release/noetic/' + pkg):
assert os.path.exists('package.xml'), "release branch invalid"
# Is it the correct package.xml for this pkg?
package_xml = open('package.xml', 'r').read()
assert package_xml.count('<name>' + pkg + '</name>'), \
"incorrect package.xml for " + str(pkg)

# Make a patch
with inbranch('release/melodic/' + pkgs[0]):
with inbranch('release/noetic/' + pkgs[0]):
user('echo "This is a change" >> README.md')
user('git add README.md')
user('git commit -m "added a readme" --allow-empty')
Expand All @@ -310,23 +310,23 @@ def test_multi_package_repository(directory=None):
### Release generator, again
###
with bloom_answer(bloom_answer.ASSERT_NO_QUESTION):
ret = user('git-bloom-generate -y rosrelease melodic -s upstream', env=env)
ret = user('git-bloom-generate -y rosrelease noetic -s upstream', env=env)
# patch import should have reported OK
assert ret == code.OK, "actually returned ({0})".format(ret)
# Check the environment after the release generator
ret, out, err = user('git tag', return_io=True)
for pkg in pkgs:
# Does the release/pkg branch exist?
assert branch_exists('release/melodic/' + pkg), \
"no release/melodic/" + pkg + " branch"
assert branch_exists('release/noetic/' + pkg), \
"no release/noetic/" + pkg + " branch"
# Does the patches/release/pkg branch exist?
assert branch_exists('patches/release/melodic/' + pkg), \
"no patches/release/melodic/" + pkg + " branch"
assert branch_exists('patches/release/noetic/' + pkg), \
"no patches/release/noetic/" + pkg + " branch"
# Did the release tag get created?
assert out.count('release/melodic/' + pkg + '/0.1.0-1') == 1, \
assert out.count('release/noetic/' + pkg + '/0.1.0-1') == 1, \
"no release tag created for " + pkg
# Is there a package.xml in the top level?
with inbranch('release/melodic/' + pkg):
with inbranch('release/noetic/' + pkg):
assert os.path.exists(os.path.join('debian', 'something.udev')), \
"Lost the debian overlaid files in release branch"
assert os.path.exists('white space.txt~'), \
Expand All @@ -343,22 +343,22 @@ def test_multi_package_repository(directory=None):
# Check the environment after the release generator
ret, out, err = user('git tag', return_io=True)
for pkg in pkgs:
for distro in ['bionic', 'stretch']:
for distro in ['focal', 'buster']:
pkg_san = sanitize_package_name(pkg)
# Does the debian/distro/pkg branch exist?
assert branch_exists('debian/melodic/' + distro + '/' + pkg), \
"no debian/melodic/" + pkg + " branch"
assert branch_exists('debian/noetic/' + distro + '/' + pkg), \
"no debian/noetic/" + pkg + " branch"
# Does the patches/debian/distro/pkg branch exist?
patches_branch = 'patches/debian/melodic/' + distro + '/' + pkg
patches_branch = 'patches/debian/noetic/' + distro + '/' + pkg
assert branch_exists(patches_branch), \
"no " + patches_branch + " branch"
# Did the debian tag get created?
tag = 'debian/ros-melodic-' + pkg_san + '_0.1.0-1_' + distro
tag = 'debian/ros-noetic-' + pkg_san + '_0.1.0-1_' + distro
assert out.count(tag) == 1, \
"no '" + tag + "'' tag created for '" + pkg + "': `\n" + \
out + "\n`"
# Is there a package.xml in the top level?
with inbranch('debian/melodic/' + distro + '/' + pkg):
with inbranch('debian/noetic/' + distro + '/' + pkg):
assert os.path.exists(
os.path.join('debian', 'something.udev')), \
"Lost the debian overlaid files in debian branch"
Expand All @@ -385,15 +385,15 @@ def test_multi_package_repository(directory=None):
@in_temporary_directory
def test_upstream_tag_special_tag(directory=None):
"""
Release a single package catkin (melodic) repository, first put
Release a single package catkin (noetic) repository, first put
an upstream tag into the release repository to test that bloom
can handle it.
"""
directory = directory if directory is not None else os.getcwd()
# Initialize rosdep
rosdep_dir = os.path.join(directory, 'foo_rosdep')
env = dict(os.environ)
fake_distros = {'melodic': {'ubuntu': ['bionic']}}
fake_distros = {'noetic': {'ubuntu': ['focal']}}
fake_rosdeps = {
'catkin': {'ubuntu': []},
'roscpp_core': {'ubuntu': []}
Expand All @@ -405,8 +405,8 @@ def test_upstream_tag_special_tag(directory=None):
release_url = create_release_repo(
upstream_url,
'git',
'melodic_devel',
'melodic')
'noetic_devel',
'noetic')
release_dir = os.path.join(directory, 'foo_release_clone')
release_client = get_vcs_client('git', release_dir)
assert release_client.checkout(release_url)
Expand Down

0 comments on commit 7e41ccc

Please sign in to comment.