From 4d3305f3f2da3bf4106c831fc6e91b6aba7fab2c Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:13:03 +0100 Subject: [PATCH 01/15] init ci docker compose integration file with community profile --- .../ci-docker-compose-integration.yml | 74 +++++++++++++++++++ dev/compose/community.yaml | 13 ++-- integration_requirements.txt | 3 +- 3 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci-docker-compose-integration.yml diff --git a/.github/workflows/ci-docker-compose-integration.yml b/.github/workflows/ci-docker-compose-integration.yml new file mode 100644 index 0000000000..2cf2d5b4b6 --- /dev/null +++ b/.github/workflows/ci-docker-compose-integration.yml @@ -0,0 +1,74 @@ +--- +name: Docker Compose Integration +on: + pull_request: + branches: + - '**' + push: + branches: + - '**' + workflow_dispatch: + +jobs: + integration: + strategy: + fail-fast: false + matrix: + env: +# - TEST_PROFILE: ldap +# - TEST_PROFILE: keycloak +# - TEST_PROFILE: standalone +# # - TEST_PROFILE: rbac +# - TEST_PROFILE: rbac_parallel_group_1 +# - TEST_PROFILE: rbac_parallel_group_2 +# - TEST_PROFILE: certified-sync +# - TEST_PROFILE: insights +# - TEST_PROFILE: iqe_rbac +# - TEST_PROFILE: x_repo_search + - TEST_PROFILE: community +# - TEST_PROFILE: dab_jwt + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: (Linux) Install docker compose + run: | + curl -L -o /tmp/docker-compose https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 + install /tmp/docker-compose /usr/local/bin/ + + - name: Spin up dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml + run: | + docker compose -f dev/compose/community.yaml up --detach + + - name: Export environment variables to host + run: | + docker compose -f dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml exec manager /bin/bash -c 'env | grep -v -w "HOME"' >> $GITHUB_ENV + cat $GITHUB_ENV + + - name: Wait for API online status + run: | + max_runs=10 + for i in $(seq 1 $max_runs); do + echo "$i: checking api status..." + RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -u "${{ env.DJANGO_SUPERUSER_USERNAME }}:${{ env.DJANGO_SUPERUSER_PASSWORD }}" -LI http://localhost:5001/api/galaxy/pulp/api/v3/status/) + if [ "$RESPONSE" -ne 200 ]; then + echo "API is down. Retrying in 10 seconds..." + sleep 10 + else + echo "API online." + exit 0 + fi + done + + - name: Install integration requirements + run: | + pip install -r integration_requirements.txt + + - name: Run integration tests + run: | + pytest -v -r sx --color=yes -m '${{ env.HUB_TEST_MARKS }}' galaxy_ng/tests/integration \ No newline at end of file diff --git a/dev/compose/community.yaml b/dev/compose/community.yaml index 72984732aa..9ff409f59e 100644 --- a/dev/compose/community.yaml +++ b/dev/compose/community.yaml @@ -30,9 +30,9 @@ x-common-env: &common-env # Hostname and prefix has to be correct PULP_GALAXY_API_PATH_PREFIX: '/api/' PULP_CONTENT_PATH_PREFIX: '/pulp/content/' - PULP_ANSIBLE_API_HOSTNAME: 'https://localhost' - PULP_ANSIBLE_CONTENT_HOSTNAME: "https://localhost" - PULP_CONTENT_ORIGIN: "https://localhost" + PULP_ANSIBLE_API_HOSTNAME: 'http://localhost:5001' + PULP_ANSIBLE_CONTENT_HOSTNAME: "http://localhost:5001" + PULP_CONTENT_ORIGIN: "http://localhost:5001" PULP_CSRF_TRUSTED_ORIGINS: "['https://localhost']" # auth ... @@ -59,7 +59,7 @@ x-common-env: &common-env PULP_GALAXY_AUTO_SIGN_COLLECTIONS: 'false' # disable user/group modifications - PULP_ALLOW_LOCAL_RESOURCE_MANAGEMENT: 'false' + PULP_ALLOW_LOCAL_RESOURCE_MANAGEMENT: 'true' # role content workaround PULP_ANSIBLE_BASE_ROLES_REQUIRE_VIEW: 'false' @@ -74,8 +74,9 @@ x-common-env: &common-env # PULP_RESOURCE_SERVER__VALIDATE_HTTPS='false' # Integration test settings - HUB_TEST_AUTHENTICATION_BACKEND: "community" - HUB_TEST_MARKS: "deployment_community" + HUB_TEST_AUTHENTICATION_BACKEND: 'community' + HUB_TEST_MARKS: 'deployment_community' + HUB_API_ROOT: 'http://localhost:5001/api/' # Unpin dependencies on setup.py if set to 0 LOCK_REQUIREMENTS: 0 diff --git a/integration_requirements.txt b/integration_requirements.txt index f48183403e..3a7ed8ecf0 100644 --- a/integration_requirements.txt +++ b/integration_requirements.txt @@ -11,4 +11,5 @@ importlib_resources galaxykit @ git+https://github.com/ansible/galaxykit pyyaml pytest-subtests -ldap3 \ No newline at end of file +ldap3 +setuptools \ No newline at end of file From f9f89cdff6c8cf988b630fe4ba7940a91fbf0ec5 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:14:04 +0100 Subject: [PATCH 02/15] dont run other CI for now --- .github/workflows/ci_full.yml | 2 +- .github/workflows/ci_oci-env-integration.yml | 12 ++++++------ .github/workflows/ci_tdd.yml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_full.yml index f59f9973a0..250c58567e 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_full.yml @@ -2,7 +2,7 @@ name: galaxy_ng/ci on: - push - - pull_request +# - pull_request jobs: diff --git a/.github/workflows/ci_oci-env-integration.yml b/.github/workflows/ci_oci-env-integration.yml index 45e6d3b654..97083d8f26 100644 --- a/.github/workflows/ci_oci-env-integration.yml +++ b/.github/workflows/ci_oci-env-integration.yml @@ -1,12 +1,12 @@ --- name: OCI Env Integration on: - pull_request: - branches: - - '**' - push: - branches: - - '**' +# pull_request: +# branches: +# - '**' +# push: +# branches: +# - '**' workflow_dispatch: jobs: diff --git a/.github/workflows/ci_tdd.yml b/.github/workflows/ci_tdd.yml index 83fb490563..318c0a4653 100644 --- a/.github/workflows/ci_tdd.yml +++ b/.github/workflows/ci_tdd.yml @@ -1,9 +1,9 @@ --- name: TDD on: - pull_request: - branches: - - '*' +# pull_request: +# branches: +# - '*' workflow_dispatch: jobs: From acd286b2df00643fea0a877ccec4d0b1c53a240b Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:14:29 +0100 Subject: [PATCH 03/15] dont run sonar as well --- .github/workflows/sonar-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar-pr.yaml b/.github/workflows/sonar-pr.yaml index 352d3219d6..4c701c6d30 100644 --- a/.github/workflows/sonar-pr.yaml +++ b/.github/workflows/sonar-pr.yaml @@ -4,8 +4,8 @@ name: SonarCloud on: workflow_run: - workflows: - - galaxy_ng/ci +# workflows: +# - galaxy_ng/ci types: - completed jobs: From b2e276a623095deca91c2e025131731d9d91a7c9 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:20:14 +0100 Subject: [PATCH 04/15] add django browsable api and fix test --- docker/etc/settings.py | 5 ++++- galaxy_ng/tests/integration/community/test_community_api.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/etc/settings.py b/docker/etc/settings.py index 7d2f22728c..18e9992517 100644 --- a/docker/etc/settings.py +++ b/docker/etc/settings.py @@ -11,7 +11,10 @@ ANSIBLE_API_HOSTNAME = os.environ.get('PULP_CONTENT_ORIGIN') GALAXY_API_PATH_PREFIX = "/api/automation-hub" -GALAXY_AUTHENTICATION_CLASSES = ['galaxy_ng.app.auth.auth.RHIdentityAuthentication'] +GALAXY_AUTHENTICATION_CLASSES = [ + 'galaxy_ng.app.auth.auth.RHIdentityAuthentication', + 'galaxy_ng.app.renderers.CustomBrowsableAPIRenderer' +] # GALAXY_AUTO_SIGN_COLLECTIONS = True # GALAXY_COLLECTION_SIGNING_SERVICE = "ansible-default" diff --git a/galaxy_ng/tests/integration/community/test_community_api.py b/galaxy_ng/tests/integration/community/test_community_api.py index e538cb87fd..8a6354494d 100644 --- a/galaxy_ng/tests/integration/community/test_community_api.py +++ b/galaxy_ng/tests/integration/community/test_community_api.py @@ -813,10 +813,10 @@ def test_v1_role_versions(ansible_config): id = resp["results"][0]["id"] versions = resp["results"][0]["summary_fields"]["versions"] - resp = api_client(f'/api/v1/roles/{id}/versions') + resp = api_client(f'/api/v1/roles/{id}/versions/') assert resp["count"] >= len(versions) with pytest.raises(AnsibleError) as html: - api_client(f"v1/roles/{id}/versions", headers={"Accept": "text/html"}) + api_client(f"v1/roles/{id}/versions/", headers={"Accept": "text/html"}) assert not isinstance(html.value, dict) assert "results" in str(html.value) From 6755700a4f22f90b6adc4a06c364c1eee6613460 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:21:25 +0100 Subject: [PATCH 05/15] fix tests with browsable api --- galaxy_ng/tests/integration/community/test_v1_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/galaxy_ng/tests/integration/community/test_v1_api.py b/galaxy_ng/tests/integration/community/test_v1_api.py index dac5e2c5d9..9b2d9f064e 100644 --- a/galaxy_ng/tests/integration/community/test_v1_api.py +++ b/galaxy_ng/tests/integration/community/test_v1_api.py @@ -133,7 +133,7 @@ def test_custom_browsable_format(ansible_config): require_auth=True, ) - resp = api_client("v1/namespaces") + resp = api_client("v1/namespaces/") assert isinstance(resp, dict) assert "results" in resp @@ -142,7 +142,7 @@ def test_custom_browsable_format(ansible_config): assert "results" in resp with pytest.raises(AnsibleError) as html: - api_client("v1/namespaces", headers={"Accept": "text/html"}) + api_client("v1/namespaces/", headers={"Accept": "text/html"}) assert not isinstance(html.value, dict) assert "results" in str(html.value) @@ -154,7 +154,7 @@ def test_custom_browsable_format(ansible_config): require_auth=True, ) - resp = api_client("v1/namespaces") + resp = api_client("v1/namespaces/") assert isinstance(resp, dict) assert "results" in resp @@ -163,6 +163,6 @@ def test_custom_browsable_format(ansible_config): assert "results" in resp with pytest.raises(AnsibleError) as html: - api_client("v1/namespaces", headers={"Accept": "text/html"}) + api_client("v1/namespaces/", headers={"Accept": "text/html"}) assert not isinstance(html.value, dict) assert "results" in str(html.value) From 29465a1af04af0ff0cbc7d998dd1580560416631 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:22:21 +0100 Subject: [PATCH 06/15] run commands inside docker compose profile --- galaxy_ng/tests/integration/api/test_ui_paths.py | 9 ++------- .../tests/integration/cli/test_community_sync.py | 9 ++------- galaxy_ng/tests/integration/conftest.py | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/galaxy_ng/tests/integration/api/test_ui_paths.py b/galaxy_ng/tests/integration/api/test_ui_paths.py index 787044b152..b28efce596 100644 --- a/galaxy_ng/tests/integration/api/test_ui_paths.py +++ b/galaxy_ng/tests/integration/api/test_ui_paths.py @@ -1,6 +1,5 @@ import random import json -import subprocess from http import HTTPStatus import pytest @@ -874,7 +873,7 @@ def build_upload_wait(tags): # /api/automation-hub/_ui/v1/tags/roles/ @pytest.mark.deployment_community -def test_api_ui_v1_tags_roles(ansible_config): +def test_api_ui_v1_tags_roles(ansible_config, docker_compose_exec): """Test endpoint's sorting and filtering""" def _sync_role(github_user, role_name): @@ -886,11 +885,7 @@ def _sync_role(github_user, role_name): wait_for_v1_task(resp=resp, api_client=api_admin_client) def _populate_tags_cmd(): - proc = subprocess.run( - "django-admin populate-role-tags", - shell=True, - capture_output=True, - ) + proc = docker_compose_exec('django-admin populate-role-tags') assert proc.returncode == 0 config = ansible_config("basic_user") diff --git a/galaxy_ng/tests/integration/cli/test_community_sync.py b/galaxy_ng/tests/integration/cli/test_community_sync.py index a2d00f9365..289231e7e3 100644 --- a/galaxy_ng/tests/integration/cli/test_community_sync.py +++ b/galaxy_ng/tests/integration/cli/test_community_sync.py @@ -4,7 +4,6 @@ import json import pytest import requests -import subprocess from ansible.galaxy.api import GalaxyError @@ -15,7 +14,7 @@ @pytest.mark.deployment_community -def test_community_collection_download_count_sync(ansible_config): +def test_community_collection_download_count_sync(ansible_config, docker_compose_exec): """ Test collection download count sync command """ # FIXME(jctanner): once beta switches over, this test is no longer needed. @@ -83,11 +82,7 @@ def test_community_collection_download_count_sync(ansible_config): wait_for_task(api_client, sync_task) # run the django command - pid = subprocess.run( - 'pulpcore-manager sync-collection-download-counts', - shell=True, - capture_output=True, - ) + pid = docker_compose_exec('pulpcore-manager sync-collection-download-counts') assert pid.returncode == 0 # check the counter in the api diff --git a/galaxy_ng/tests/integration/conftest.py b/galaxy_ng/tests/integration/conftest.py index a6d44e53e9..0f01c74877 100644 --- a/galaxy_ng/tests/integration/conftest.py +++ b/galaxy_ng/tests/integration/conftest.py @@ -3,6 +3,7 @@ import os import shutil import yaml +import subprocess import pytest from orionutils.utils import increment_version @@ -726,3 +727,17 @@ def skip_if_require_signature_for_approval(): def skip_if_not_require_signature_for_approval(): if not require_signature_for_approval(): pytest.skip("This test needs refactoring to work with signatures required on move.") + + +@pytest.fixture +def docker_compose_exec(): + def _exec(cmd: str): + proc = subprocess.run( + # "django-admin populate-role-tags", + f"docker compose -f dev/compose/community.yaml exec manager /bin/bash -c '{cmd}'", + shell=True, + capture_output=True, + ) + return proc + + return _exec From 1df354b3f22076490b7c223cdfb05fea6b68af31 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 14:26:43 +0100 Subject: [PATCH 07/15] run less CI --- .../ci-docker-compose-integration.yml | 6 +++--- .../ci_automation_hub_collection.yml | 20 +++++++++---------- .github/workflows/ci_full.yml | 4 +++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-docker-compose-integration.yml b/.github/workflows/ci-docker-compose-integration.yml index 2cf2d5b4b6..beebe30436 100644 --- a/.github/workflows/ci-docker-compose-integration.yml +++ b/.github/workflows/ci-docker-compose-integration.yml @@ -4,9 +4,9 @@ on: pull_request: branches: - '**' - push: - branches: - - '**' +# push: +# branches: +# - '**' workflow_dispatch: jobs: diff --git a/.github/workflows/ci_automation_hub_collection.yml b/.github/workflows/ci_automation_hub_collection.yml index 5bc5cda8ca..1b711cb711 100644 --- a/.github/workflows/ci_automation_hub_collection.yml +++ b/.github/workflows/ci_automation_hub_collection.yml @@ -1,16 +1,16 @@ --- name: Galaxy Collection CI on: - pull_request: - branches: - - "*" - paths-ignore: - - "CHANGES/**" - - "docs/**" - - "mkdocs.yml" - push: - branches: - - "*" +# pull_request: +# branches: +# - "*" +# paths-ignore: +# - "CHANGES/**" +# - "docs/**" +# - "mkdocs.yml" +# push: +# branches: +# - "*" workflow_dispatch: jobs: diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_full.yml index 250c58567e..1803778b3c 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_full.yml @@ -1,7 +1,9 @@ --- name: galaxy_ng/ci on: - - push + workflow_dispatch: + +# - push # - pull_request jobs: From 70dc4c523770511068c6056979a58a6d459790fc Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Mon, 25 Nov 2024 17:24:02 +0100 Subject: [PATCH 08/15] fix browsable api mistake --- docker/etc/settings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/etc/settings.py b/docker/etc/settings.py index 18e9992517..a5c1912361 100644 --- a/docker/etc/settings.py +++ b/docker/etc/settings.py @@ -11,10 +11,7 @@ ANSIBLE_API_HOSTNAME = os.environ.get('PULP_CONTENT_ORIGIN') GALAXY_API_PATH_PREFIX = "/api/automation-hub" -GALAXY_AUTHENTICATION_CLASSES = [ - 'galaxy_ng.app.auth.auth.RHIdentityAuthentication', - 'galaxy_ng.app.renderers.CustomBrowsableAPIRenderer' -] +GALAXY_AUTHENTICATION_CLASSES = ['galaxy_ng.app.auth.auth.RHIdentityAuthentication'] # GALAXY_AUTO_SIGN_COLLECTIONS = True # GALAXY_COLLECTION_SIGNING_SERVICE = "ansible-default" @@ -42,7 +39,10 @@ REDIS_HOST = os.environ.get('PULP_REDIS_HOST') REDIS_PORT = os.environ.get('PULP_REDIS_PORT') -REST_FRAMEWORK__DEFAULT_RENDERER_CLASSES = ['rest_framework.renderers.JSONRenderer'] +REST_FRAMEWORK__DEFAULT_RENDERER_CLASSES = [ + 'rest_framework.renderers.JSONRenderer', + 'galaxy_ng.app.renderers.CustomBrowsableAPIRenderer' +] _enabled_handlers = ['console'] _extra_handlers = {} From 7e8a9440469e958a0399ca4a02a07ff6b2a44920 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Tue, 26 Nov 2024 16:10:20 +0100 Subject: [PATCH 09/15] remove comment --- galaxy_ng/tests/integration/conftest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/galaxy_ng/tests/integration/conftest.py b/galaxy_ng/tests/integration/conftest.py index 0f01c74877..33ca3607c7 100644 --- a/galaxy_ng/tests/integration/conftest.py +++ b/galaxy_ng/tests/integration/conftest.py @@ -733,7 +733,6 @@ def skip_if_not_require_signature_for_approval(): def docker_compose_exec(): def _exec(cmd: str): proc = subprocess.run( - # "django-admin populate-role-tags", f"docker compose -f dev/compose/community.yaml exec manager /bin/bash -c '{cmd}'", shell=True, capture_output=True, From 25a7b87a6f3c721265158001863f3aee3a2befc6 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Wed, 27 Nov 2024 15:57:47 +0100 Subject: [PATCH 10/15] first checkin --- .../gitrepo_avdz_uei/foo.bar/README.md | 38 ++++++++++++++ .../foo.bar/defaults/main.yml | 2 + .../foo.bar/handlers/main.yml | 2 + .../gitrepo_avdz_uei/foo.bar/meta/main.yml | 52 +++++++++++++++++++ .../gitrepo_avdz_uei/foo.bar/tasks/main.yml | 2 + .../gitrepo_avdz_uei/foo.bar/tests/inventory | 2 + .../gitrepo_avdz_uei/foo.bar/tests/test.yml | 5 ++ .../gitrepo_avdz_uei/foo.bar/vars/main.yml | 2 + 8 files changed, 105 insertions(+) create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml create mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md new file mode 100644 index 0000000000..225dd44b9f --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml new file mode 100644 index 0000000000..29e59e0958 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml new file mode 100644 index 0000000000..4b32fe613b --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml new file mode 100644 index 0000000000..c572acc9f8 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml new file mode 100644 index 0000000000..a9c1aeffa4 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory new file mode 100644 index 0000000000..878877b077 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml new file mode 100644 index 0000000000..99aaa91976 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml new file mode 100644 index 0000000000..f1bc7af493 --- /dev/null +++ b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for foo.bar From dff67890c47c6f7361c46943f3a8df40451819b3 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Wed, 27 Nov 2024 22:53:18 +0100 Subject: [PATCH 11/15] fix test_role_import_overrides --- .gitignore | 1 + .../community/test_role_import_overrides.py | 9 ++-- galaxy_ng/tests/integration/conftest.py | 8 +++- galaxy_ng/tests/integration/utils/legacy.py | 47 +++++++++++++------ 4 files changed, 45 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 0d2485c730..4b6f283984 100644 --- a/.gitignore +++ b/.gitignore @@ -110,6 +110,7 @@ gng_unit_testing/ # Galaxy NG db_snapshots/ +temp_roles/* # oci-env profile files .compiled/ diff --git a/galaxy_ng/tests/integration/community/test_role_import_overrides.py b/galaxy_ng/tests/integration/community/test_role_import_overrides.py index 3798ba726b..0df7c608fa 100644 --- a/galaxy_ng/tests/integration/community/test_role_import_overrides.py +++ b/galaxy_ng/tests/integration/community/test_role_import_overrides.py @@ -39,11 +39,10 @@ 'alternate_namespace_name': None, 'alternate_role_name': None, } - ] ) @pytest.mark.deployment_community -def test_role_import_overrides(ansible_config, spec): +def test_role_import_overrides(ansible_config, spec, docker_compose_exec): """" Validate setting namespace in meta/main.yml does the right thing """ admin_config = ansible_config("admin") @@ -83,10 +82,12 @@ def test_role_import_overrides(ansible_config, spec): 'meta_namespace': spec['meta_namespace'], 'meta_name': spec['meta_name'], } - lr = LegacyRoleGitRepoBuilder(**builder_kwargs) + lr = LegacyRoleGitRepoBuilder(**builder_kwargs, docker_compose_exec=docker_compose_exec) + + local_tmp_dir = lr.role_cont_dir # run the import - payload = {'alternate_clone_url': lr.role_dir} + payload = {'alternate_clone_url': local_tmp_dir} for key in ['github_user', 'github_repo', 'alternate_namespace_name', 'alternate_role_name']: if spec.get(key): payload[key] = spec[key] diff --git a/galaxy_ng/tests/integration/conftest.py b/galaxy_ng/tests/integration/conftest.py index 33ca3607c7..efa272dc7a 100644 --- a/galaxy_ng/tests/integration/conftest.py +++ b/galaxy_ng/tests/integration/conftest.py @@ -731,9 +731,13 @@ def skip_if_not_require_signature_for_approval(): @pytest.fixture def docker_compose_exec(): - def _exec(cmd: str): + def _exec(cmd: str, cwd=None): + cd = '' + if cwd is not None: + cd = f'cd {cwd};' + proc = subprocess.run( - f"docker compose -f dev/compose/community.yaml exec manager /bin/bash -c '{cmd}'", + f"docker exec compose-manager-1 /bin/bash -c '{cd}{cmd}'", shell=True, capture_output=True, ) diff --git a/galaxy_ng/tests/integration/utils/legacy.py b/galaxy_ng/tests/integration/utils/legacy.py index 3a0c9603bc..3027a039e9 100644 --- a/galaxy_ng/tests/integration/utils/legacy.py +++ b/galaxy_ng/tests/integration/utils/legacy.py @@ -234,32 +234,49 @@ def __init__( namespace=None, name=None, meta_namespace=None, - meta_name=None + meta_name=None, + docker_compose_exec=None ): self.namespace = namespace self.name = name self.meta_namespace = meta_namespace self.meta_name = meta_name - self.workdir = tempfile.mkdtemp(prefix='gitrepo_') + self.docker_compose_exec = docker_compose_exec + + # local tmp dir for roles + temp_roles = 'temp_roles/' + if not os.path.exists(temp_roles): + os.makedirs(temp_roles) + + self.workdir = tempfile.mkdtemp(prefix='gitrepo_', dir=temp_roles) + path_parts = self.workdir.partition(temp_roles) + + # should be equal to HOME=/app + # TODO: better way to get env var from container? + pid = self.docker_compose_exec('printenv HOME') + home = pid.stdout.decode('utf-8').strip() or '/app' + + self.workdir_cont = os.path.join(home, path_parts[1], path_parts[2]) + self.role_dir = None + self.role_cont_dir = None self.role_init() self.role_edit() self.git_init() self.git_commit() - self.fix_perms() - - def fix_perms(self): - subprocess.run(f'chown -R pulp:pulp {self.workdir}', shell=True) - def role_init(self): cmd = f'ansible-galaxy role init {self.namespace}.{self.name}' self.role_dir = os.path.join(self.workdir, self.namespace + '.' + self.name) - pid = subprocess.run(cmd, shell=True, cwd=self.workdir) + self.role_cont_dir = os.path.join(self.workdir_cont, self.namespace + '.' + self.name) + + pid = subprocess.run(cmd, shell=True, cwd=self.workdir, capture_output=True) + assert pid.returncode == 0 assert os.path.exists(self.role_dir) + assert pid.stdout.decode('utf-8').strip() == f'- Role {self.namespace}.{self.name} was created successfully' def role_edit(self): if self.meta_namespace or self.meta_name: @@ -277,12 +294,14 @@ def role_edit(self): f.write(yaml.dump(meta)) def git_init(self): - subprocess.run('git init', shell=True, cwd=self.role_dir) + pid1 =self.docker_compose_exec('git init', cwd=self.role_cont_dir) - def git_commit(self): + # hack to make git inside git dir work + self.docker_compose_exec(f'git config --global --add safe.directory {self.role_cont_dir}') - subprocess.run('git config --global user.email "root@localhost"', shell=True) - subprocess.run('git config --global user.name "root at localhost"', shell=True) + def git_commit(self): + self.docker_compose_exec('git config --global user.email "root@localhost"') + self.docker_compose_exec('git config --global user.name "root at localhost"') - subprocess.run('git add *', shell=True, cwd=self.role_dir) - subprocess.run('git commit -m "first checkin"', shell=True, cwd=self.role_dir) + self.docker_compose_exec('git add *', cwd=self.role_cont_dir) + self.docker_compose_exec('git commit -m "first checkin"', cwd=self.role_cont_dir) From 982c5a1e442d8554f1baf89019786b2cb3a7c9e8 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Wed, 27 Nov 2024 23:54:19 +0100 Subject: [PATCH 12/15] cleanup --- .gitignore | 1 + .../community/test_role_import_overrides.py | 3 +++ galaxy_ng/tests/integration/utils/legacy.py | 16 ++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4b6f283984..9584dba2f2 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,7 @@ gng_unit_testing/ # Galaxy NG db_snapshots/ temp_roles/* +.gitconfig # oci-env profile files .compiled/ diff --git a/galaxy_ng/tests/integration/community/test_role_import_overrides.py b/galaxy_ng/tests/integration/community/test_role_import_overrides.py index 0df7c608fa..ad03832729 100644 --- a/galaxy_ng/tests/integration/community/test_role_import_overrides.py +++ b/galaxy_ng/tests/integration/community/test_role_import_overrides.py @@ -103,3 +103,6 @@ def test_role_import_overrides(ansible_config, spec, docker_compose_exec): assert roles_search['results'][0]['name'] == spec['name'] assert roles_search['results'][0]['github_user'] == spec['github_user'] assert roles_search['results'][0]['github_repo'] == spec['github_repo'] + + # cleanup + lr.local_roles_cleanup() diff --git a/galaxy_ng/tests/integration/utils/legacy.py b/galaxy_ng/tests/integration/utils/legacy.py index 3027a039e9..75f3d8a27a 100644 --- a/galaxy_ng/tests/integration/utils/legacy.py +++ b/galaxy_ng/tests/integration/utils/legacy.py @@ -245,12 +245,13 @@ def __init__( self.docker_compose_exec = docker_compose_exec # local tmp dir for roles - temp_roles = 'temp_roles/' - if not os.path.exists(temp_roles): - os.makedirs(temp_roles) + self.temp_roles = 'temp_roles/' + self.local_roles_cleanup() + if not os.path.exists(self.temp_roles): + os.makedirs(self.temp_roles) - self.workdir = tempfile.mkdtemp(prefix='gitrepo_', dir=temp_roles) - path_parts = self.workdir.partition(temp_roles) + self.workdir = tempfile.mkdtemp(prefix='gitrepo_', dir=self.temp_roles) + path_parts = self.workdir.partition(self.temp_roles) # should be equal to HOME=/app # TODO: better way to get env var from container? @@ -294,7 +295,7 @@ def role_edit(self): f.write(yaml.dump(meta)) def git_init(self): - pid1 =self.docker_compose_exec('git init', cwd=self.role_cont_dir) + self.docker_compose_exec('git init', cwd=self.role_cont_dir) # hack to make git inside git dir work self.docker_compose_exec(f'git config --global --add safe.directory {self.role_cont_dir}') @@ -305,3 +306,6 @@ def git_commit(self): self.docker_compose_exec('git add *', cwd=self.role_cont_dir) self.docker_compose_exec('git commit -m "first checkin"', cwd=self.role_cont_dir) + + def local_roles_cleanup(self): + self.docker_compose_exec(f'rm -rf {self.temp_roles}') \ No newline at end of file From b15873c59c7c6a7791cca28ab987035773dc1930 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Thu, 28 Nov 2024 11:22:38 +0100 Subject: [PATCH 13/15] remove unused and revert --- .../ci-docker-compose-integration.yml | 6 +-- .../ci_automation_hub_collection.yml | 20 +++---- .github/workflows/ci_full.yml | 6 +-- .github/workflows/ci_oci-env-integration.yml | 12 ++--- .github/workflows/ci_tdd.yml | 6 +-- .github/workflows/sonar-pr.yaml | 4 +- .../gitrepo_avdz_uei/foo.bar/README.md | 38 -------------- .../foo.bar/defaults/main.yml | 2 - .../foo.bar/handlers/main.yml | 2 - .../gitrepo_avdz_uei/foo.bar/meta/main.yml | 52 ------------------- .../gitrepo_avdz_uei/foo.bar/tasks/main.yml | 2 - .../gitrepo_avdz_uei/foo.bar/tests/inventory | 2 - .../gitrepo_avdz_uei/foo.bar/tests/test.yml | 5 -- .../gitrepo_avdz_uei/foo.bar/vars/main.yml | 2 - 14 files changed, 26 insertions(+), 133 deletions(-) delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml delete mode 100644 local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml diff --git a/.github/workflows/ci-docker-compose-integration.yml b/.github/workflows/ci-docker-compose-integration.yml index beebe30436..2cf2d5b4b6 100644 --- a/.github/workflows/ci-docker-compose-integration.yml +++ b/.github/workflows/ci-docker-compose-integration.yml @@ -4,9 +4,9 @@ on: pull_request: branches: - '**' -# push: -# branches: -# - '**' + push: + branches: + - '**' workflow_dispatch: jobs: diff --git a/.github/workflows/ci_automation_hub_collection.yml b/.github/workflows/ci_automation_hub_collection.yml index 1b711cb711..5bc5cda8ca 100644 --- a/.github/workflows/ci_automation_hub_collection.yml +++ b/.github/workflows/ci_automation_hub_collection.yml @@ -1,16 +1,16 @@ --- name: Galaxy Collection CI on: -# pull_request: -# branches: -# - "*" -# paths-ignore: -# - "CHANGES/**" -# - "docs/**" -# - "mkdocs.yml" -# push: -# branches: -# - "*" + pull_request: + branches: + - "*" + paths-ignore: + - "CHANGES/**" + - "docs/**" + - "mkdocs.yml" + push: + branches: + - "*" workflow_dispatch: jobs: diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_full.yml index 1803778b3c..f59f9973a0 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_full.yml @@ -1,10 +1,8 @@ --- name: galaxy_ng/ci on: - workflow_dispatch: - -# - push -# - pull_request + - push + - pull_request jobs: diff --git a/.github/workflows/ci_oci-env-integration.yml b/.github/workflows/ci_oci-env-integration.yml index 97083d8f26..45e6d3b654 100644 --- a/.github/workflows/ci_oci-env-integration.yml +++ b/.github/workflows/ci_oci-env-integration.yml @@ -1,12 +1,12 @@ --- name: OCI Env Integration on: -# pull_request: -# branches: -# - '**' -# push: -# branches: -# - '**' + pull_request: + branches: + - '**' + push: + branches: + - '**' workflow_dispatch: jobs: diff --git a/.github/workflows/ci_tdd.yml b/.github/workflows/ci_tdd.yml index 318c0a4653..83fb490563 100644 --- a/.github/workflows/ci_tdd.yml +++ b/.github/workflows/ci_tdd.yml @@ -1,9 +1,9 @@ --- name: TDD on: -# pull_request: -# branches: -# - '*' + pull_request: + branches: + - '*' workflow_dispatch: jobs: diff --git a/.github/workflows/sonar-pr.yaml b/.github/workflows/sonar-pr.yaml index 4c701c6d30..352d3219d6 100644 --- a/.github/workflows/sonar-pr.yaml +++ b/.github/workflows/sonar-pr.yaml @@ -4,8 +4,8 @@ name: SonarCloud on: workflow_run: -# workflows: -# - galaxy_ng/ci + workflows: + - galaxy_ng/ci types: - completed jobs: diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md deleted file mode 100644 index 225dd44b9f..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml deleted file mode 100644 index 29e59e0958..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml deleted file mode 100644 index 4b32fe613b..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml deleted file mode 100644 index c572acc9f8..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/meta/main.yml +++ /dev/null @@ -1,52 +0,0 @@ -galaxy_info: - author: your name - description: your role description - company: your company (optional) - - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker - - # Choose a valid license ID from https://spdx.org - some suggested licenses: - # - BSD-3-Clause (default) - # - MIT - # - GPL-2.0-or-later - # - GPL-3.0-only - # - Apache-2.0 - # - CC-BY-4.0 - license: license (GPL-2.0-or-later, MIT, etc) - - min_ansible_version: 2.1 - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml deleted file mode 100644 index a9c1aeffa4..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory deleted file mode 100644 index 878877b077..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml deleted file mode 100644 index 99aaa91976..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - foo.bar diff --git a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml b/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml deleted file mode 100644 index f1bc7af493..0000000000 --- a/local_tmp_dir/gitrepo_avdz_uei/foo.bar/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for foo.bar From 9507130cf5a198f1d66e33619488276136b23206 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Thu, 28 Nov 2024 11:29:20 +0100 Subject: [PATCH 14/15] run ruff and flake --- galaxy_ng/tests/integration/utils/legacy.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/galaxy_ng/tests/integration/utils/legacy.py b/galaxy_ng/tests/integration/utils/legacy.py index 75f3d8a27a..bf7a56e7fa 100644 --- a/galaxy_ng/tests/integration/utils/legacy.py +++ b/galaxy_ng/tests/integration/utils/legacy.py @@ -254,7 +254,7 @@ def __init__( path_parts = self.workdir.partition(self.temp_roles) # should be equal to HOME=/app - # TODO: better way to get env var from container? + # TODO(jjerabek): better way to get env var from container? pid = self.docker_compose_exec('printenv HOME') home = pid.stdout.decode('utf-8').strip() or '/app' @@ -277,7 +277,8 @@ def role_init(self): assert pid.returncode == 0 assert os.path.exists(self.role_dir) - assert pid.stdout.decode('utf-8').strip() == f'- Role {self.namespace}.{self.name} was created successfully' + ag_init_stdout = f'- Role {self.namespace}.{self.name} was created successfully' + assert pid.stdout.decode('utf-8').strip() == ag_init_stdout def role_edit(self): if self.meta_namespace or self.meta_name: @@ -305,7 +306,7 @@ def git_commit(self): self.docker_compose_exec('git config --global user.name "root at localhost"') self.docker_compose_exec('git add *', cwd=self.role_cont_dir) - self.docker_compose_exec('git commit -m "first checkin"', cwd=self.role_cont_dir) + self.docker_compose_exec('git commit -m "first checkin"', cwd=self.role_cont_dir) def local_roles_cleanup(self): - self.docker_compose_exec(f'rm -rf {self.temp_roles}') \ No newline at end of file + self.docker_compose_exec(f'rm -rf {self.temp_roles}') From c357eb81c3a2209123641ab712998b2af77c0351 Mon Sep 17 00:00:00 2001 From: jerabekjiri Date: Thu, 28 Nov 2024 18:56:11 +0100 Subject: [PATCH 15/15] dont run community in oci env --- .github/workflows/ci_oci-env-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_oci-env-integration.yml b/.github/workflows/ci_oci-env-integration.yml index 45e6d3b654..8558fa0c56 100644 --- a/.github/workflows/ci_oci-env-integration.yml +++ b/.github/workflows/ci_oci-env-integration.yml @@ -25,7 +25,7 @@ jobs: - TEST_PROFILE: insights - TEST_PROFILE: iqe_rbac - TEST_PROFILE: x_repo_search - - TEST_PROFILE: community + # - TEST_PROFILE: community - TEST_PROFILE: dab_jwt runs-on: ubuntu-latest steps: