Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Mar 26, 2024
1 parent a7ace26 commit 6a6a2cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/config/_test_repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ projects:
- name: osrf
type: stable
- name: ignition-transport7
distributions:
ubuntu:
- no-existing-distro
repositories:
- name: osrf
type: stable
Expand Down
13 changes: 13 additions & 0 deletions plugins/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,19 @@ def process_project_install(project, config, linux_distro, dry_run=False):
project_config = get_project_config(project, config)
if not project_config:
error('Unknown project: ' + project)

print(project_config)
try:
if linux_distro in project_config['distributions'][distro.id()]:
print("FOO")
print(project_config['distributions'][distro.id()])
except KeyError as kerror:
print(kerror)
if kerror == 'distributions':
pass # supported use case, no distributions defined
else:
warn(str(kerror))

if not dry_run: # useful for tests
install_repos(get_repositories_config(project_config),
config,
Expand Down
13 changes: 13 additions & 0 deletions plugins/repository_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ def test_regexp(self):

class TestProjectInstall(TestBase):

def test_no_distributions(self):
repository.process_project_install('ignition-math6',
self.config,
'jammy',
dry_run=True)

def test_distributions(self):
repository.process_project_install('ignition-transport7',
self.config,
'jammy',
dry_run=True)


def test_non_exist(self):
with self.assertRaises(SystemExit):
repository.process_project_install('fooooo',
Expand Down

0 comments on commit 6a6a2cb

Please sign in to comment.