-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use galaxy-importer LegacyRoleLoader
No-Issue Signed-off-by: eamontracey <etracey@redhat.com>
- Loading branch information
1 parent
dd7c39a
commit 6f4e92d
Showing
2 changed files
with
65 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
|
||
from ..utils import ansible_galaxy, SocialGithubClient | ||
from ..utils.legacy import clean_all_roles | ||
|
||
|
||
@pytest.mark.community_only | ||
def test_import_role_lint(ansible_config, caplog): | ||
"""Test that ansible-lint runs when importing a legacy role.""" | ||
|
||
github_user = "jctannerTEST" | ||
github_repo = "role1" | ||
|
||
# Cleanup all roles. | ||
clean_all_roles(ansible_config) | ||
|
||
# Login as jctannerTEST. | ||
test_config = ansible_config(github_user) | ||
test_client = SocialGithubClient(config=test_config) | ||
test_client.login() | ||
token = test_client.get_hub_token() | ||
assert token is not None | ||
|
||
# Import jctannerTEST role1 as jctannerTEST. | ||
import_pid = ansible_galaxy( | ||
f"role import {github_user} {github_repo}", | ||
ansible_config=test_config, | ||
token=token, | ||
force_token=True, | ||
cleanup=False, | ||
check_retcode=False | ||
) | ||
assert import_pid.returncode == 0 | ||
|
||
assert caplog.text == "" |