Skip to content

Commit

Permalink
Switch collection testing over to oci-env. (#2107)
Browse files Browse the repository at this point in the history
* Switch collection testing over to oci-env.
* Try not re-setting OCI_ENV_PATH ...
* Poll the stack.
* Move poll to it's own task.
* Need the test users.
* Use the old container name style.
* Not interactive.
* Set a max runtime on approval, because it's hanging in github.

No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner authored Mar 27, 2024
1 parent 8326785 commit 65421b2
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 11 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/ci_automation_hub_collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,39 @@ jobs:
ansible-galaxy collection build -vvv
ansible-galaxy collection install galaxy-galaxy-1.0.0.tar.gz -vvv
- name: Spin up a standalone galaxy_ng installation
#- name: Spin up a standalone galaxy_ng installation
# run: |
# echo "COMPOSE_PROFILE=standalone" > .compose.env
# echo "DEV_SOURCE_PATH=galaxy_ng" >> .compose.env
# make docker/all
# ./compose up -d
# pip3 install --upgrade requests pyyaml
# python3 dev/common/poll.py

- name: set env vars
run: |
echo "OCI_ENV_PATH=${HOME}/work/galaxy_ng/oci_env" >> $GITHUB_ENV
echo "COMPOSE_INTERACTIVE_NO_CLI=1" >> $GITHUB_ENV
echo "OCI_VERBOSE=1" >> $GITHUB_ENV
echo "GH_DUMP_LOGS=0" >> $GITHUB_ENV
- name: setup oci-env
run: |
echo "COMPOSE_PROFILE=standalone" > .compose.env
echo "DEV_SOURCE_PATH=galaxy_ng" >> .compose.env
make docker/all
./compose up -d
pip3 install --upgrade requests pyyaml
python3 dev/common/poll.py
git clone https://github.com/pulp/oci_env.git $OCI_ENV_PATH
pip install -e $OCI_ENV_PATH/client/
mkdir $OCI_ENV_PATH/db_backup/
- name: run the standalone stack detached
run: OCI_COMPOSE_DETACH=1 make oci/standalone

- name: wait for the system to start
run: make oci/standalone/poll

- name: create the test users+data
run: docker exec -t ci-standalone_pulp_1 bash -c 'cd /src/galaxy_ng; django-admin shell < ./dev/common/setup_test_data.py'

- name: make messages
run: docker exec -t ci-standalone_pulp_1 bash -c 'cd /src/galaxy_ng/galaxy_ng; django-admin makemessages --all'

- name: Test the user playbook
run: ansible-playbook dev/galaxy_collection_plays/user.yml -vvv
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ docs/serve:
oci/standalone:
dev/oci_start standalone

.PHONY: oci/standalone/poll
oci/standalone/poll:
dev/oci_poll standalone

.PHONY: oci/insights
oci/insights:
dev/oci_start insights
Expand Down
2 changes: 2 additions & 0 deletions dev/galaxy_collection_plays/content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
ah_host: "{{ ah_host }}"
ah_token: "{{ ah_token }}"
ah_path_prefix: "{{ ah_path_prefix }}"
async: 600
poll: 10

- name: Delete the galaxy collection
ah_collection:
Expand Down
4 changes: 2 additions & 2 deletions dev/galaxy_collection_plays/vars.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ah_host: http://localhost:5001
ah_host: http://localhost:55001
ah_username: iqe_admin
ah_password: redhat
ah_path_prefix: automation-hub
ah_path_prefix: galaxy
ah_artifact_runner_absolute_path: /home/runner/work/galaxy_ng/galaxy_ng/galaxy_collection/galaxy-galaxy-1.0.0.tar.gz
16 changes: 16 additions & 0 deletions dev/oci_poll
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -x

profile=$1
echo "USING PROFILE ${profile}"

# find the oci-env checkout
if [[ -z $OCI_ENV_PATH ]]; then
OCI_ENV_PATH=$(dirname $(pip show oci-env | egrep ^Location | awk '{print $2}'))
fi
echo "FOUND OCI_ENV_PATH: ${OCI_ENV_PATH}"

export COMPOSE_INTERACTIVE_NO_CLI=1
env_path=dev/oci_env_integration/oci_env_configs/$profile.compose.env
oci-env -e ${env_path} poll
13 changes: 11 additions & 2 deletions dev/oci_start
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ profile=$1
echo "USING PROFILE ${profile}"

# find the oci-env checkout
OCI_ENV_PATH=$(dirname $(pip show oci-env | egrep ^Location | awk '{print $2}'))
if [[ -z $OCI_ENV_PATH ]]; then
OCI_ENV_PATH=$(dirname $(pip show oci-env | egrep ^Location | awk '{print $2}'))
fi
echo "FOUND OCI_ENV_PATH: ${OCI_ENV_PATH}"


if [[ -n $OCI_COMPOSE_DETACH ]]; then
DETACH_ARGS="--detach"
else
DETACH_ARGS=""
fi

export COMPOSE_INTERACTIVE_NO_CLI=1
env_path=dev/oci_env_integration/oci_env_configs/$profile.compose.env
oci-env -e ${env_path} compose build --progress=plain
oci-env -e ${env_path} compose up
oci-env -e ${env_path} compose up ${DETACH_ARGS}

0 comments on commit 65421b2

Please sign in to comment.