Skip to content

Commit

Permalink
add index-v4.yaml file with additional metadata, a test to ensure bot…
Browse files Browse the repository at this point in the history
…h indexes don't diverge
  • Loading branch information
dirk-thomas committed Nov 6, 2018
1 parent 177562a commit a82e2ec
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
42 changes: 42 additions & 0 deletions index-v4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
%YAML 1.1
# ROS index file
# see REP 153: http://ros.org/reps/rep-0153.html
---
distributions:
groovy:
distribution: [groovy/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/groovy-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
hydro:
distribution: [hydro/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/hydro-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
indigo:
distribution: [indigo/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/indigo-cache.yaml.gz
distribution_status: active
distribution_type: ros1
jade:
distribution: [jade/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/jade-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
kinetic:
distribution: [kinetic/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/kinetic-cache.yaml.gz
distribution_status: active
distribution_type: ros1
lunar:
distribution: [lunar/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/lunar-cache.yaml.gz
distribution_status: active
distribution_type: ros1
melodic:
distribution: [melodic/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/melodic-cache.yaml.gz
distribution_status: active
distribution_type: ros1
type: index
version: 4
35 changes: 35 additions & 0 deletions test/test_indexes_equal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os

from rosdistro import get_index

from .fold_block import Fold

INDEX_V3_YAML = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), '..', 'index.yaml'))
INDEX_V4_YAML = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), '..', 'index-v4.yaml'))


def test_build_caches():
with Fold():
print('Checking that the index.yaml and index-v4.yaml files contain '
'the same information expect additional metadata in the v4.')
index_v3 = get_index('file://' + os.path.abspath(INDEX_V3_YAML))
index_v4 = get_index('file://' + os.path.abspath(INDEX_V4_YAML))

dist_names_v3 = list(sorted(index_v3.distributions.keys()))
dist_names_v4 = list(sorted(index_v4.distributions.keys()))
assert dist_names_v3 == dist_names_v4, \
'Different set of distribution names'

for dist_name in dist_names_v3:
dist_v3_data = index_v3.distributions[dist_name]
dist_v4_data = index_v4.distributions[dist_name]

for key, value in dist_v3_data.items():
assert key in dist_v4_data, \
"For distribution '%s' index.yaml contains the key '%s' " \
"but v4 doesn't contain it" % (dist_name, key)
assert dist_v4_data[key] == value, \
"For distribution '%s' both yaml files contains the key " \
"'%s' but with different values" % (dist_name, key)

0 comments on commit a82e2ec

Please sign in to comment.