Skip to content

Commit dc6bda7

Browse files
committed
ci: move functional tests from Konflux to GitHub Actions
Run the 6 functional test suites (pulp_rpm, pulpcore, pulp_maven, pulp_npm, pulp_service) in a GHA workflow using the dev container instead of the Konflux deploy-and-test pipeline. This frees Konflux resources for what only it can do: image build, security scans, and deployment verification. Konflux pipeline retains: deploy → build bindings → install bindings → push API schemas → publish to PyPI. The pulp-functional-tests task is removed and push-api-json-files-to-pulp now runs after install-bindings. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7e132f9 commit dc6bda7

2 files changed

Lines changed: 147 additions & 127 deletions

File tree

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Functional Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
functional-tests:
12+
name: "Pulp Functional Tests"
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 45
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v4
20+
21+
- name: Build dev container
22+
uses: docker/build-push-action@v7
23+
with:
24+
context: .
25+
file: dev-container/Dockerfile
26+
load: true
27+
tags: pulp-dev:test
28+
cache-from: type=gha,scope=dev-container
29+
cache-to: type=gha,mode=max,scope=dev-container
30+
31+
- name: Start dev container
32+
run: |
33+
docker run -d \
34+
--name pulp-dev \
35+
-e PULP_API_WORKERS=1 \
36+
-e PULP_CONTENT_WORKERS=1 \
37+
-e PULP_WORKERS=2 \
38+
pulp-dev:test
39+
40+
- name: Wait for Pulp API
41+
run: |
42+
echo "Waiting for Pulp API to become ready..."
43+
for i in $(seq 1 120); do
44+
if docker exec pulp-dev curl -sf http://localhost:24817/api/pulp/api/v3/status/ > /dev/null 2>&1; then
45+
echo "API ready after ${i}s"
46+
exit 0
47+
fi
48+
sleep 1
49+
done
50+
echo "ERROR: API not ready after 120s"
51+
docker logs pulp-dev
52+
exit 1
53+
54+
- name: Install test dependencies and generate bindings
55+
run: |
56+
docker exec pulp-dev bash -c "pip install 'pytest<8' pytest-django gnupg 2>&1 | tail -1"
57+
docker exec pulp-dev bash -c "\
58+
curl -sf -o /tmp/functest_requirements.txt \
59+
https://raw.githubusercontent.com/pulp/pulp_rpm/main/functest_requirements.txt && \
60+
curl -sf -o /tmp/unittest_requirements.txt \
61+
https://raw.githubusercontent.com/pulp/pulp_rpm/main/unittest_requirements.txt && \
62+
pip install -r /tmp/functest_requirements.txt -r /tmp/unittest_requirements.txt 2>&1 | tail -1"
63+
docker exec pulp-dev pulp-test --bindings-only
64+
65+
- name: "Test 1/6: pulp_rpm parallel (test_download_content)"
66+
run: |
67+
docker exec pulp-dev bash -c "\
68+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
69+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
70+
pytest -v -r sx --color=yes \
71+
--suppress-no-test-exit-code \
72+
--pyargs pulp_rpm.tests.functional \
73+
-m parallel -n 4 -k 'test_download_content' \
74+
--junitxml=/tmp/junit-rpm-parallel.xml"
75+
76+
- name: "Test 2/6: pulp_rpm serial (test_download_policies)"
77+
run: |
78+
docker exec pulp-dev bash -c "\
79+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
80+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
81+
pytest -v -r sx --color=yes \
82+
--pyargs pulp_rpm.tests.functional \
83+
-m 'not parallel' -k 'test_download_policies' \
84+
--junitxml=/tmp/junit-rpm-serial.xml"
85+
86+
- name: "Test 3/6: pulpcore (test_jq_header_remote_auth)"
87+
run: |
88+
docker exec pulp-dev bash -c "\
89+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
90+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
91+
pytest -v -r sx --color=yes \
92+
--pyargs pulpcore.tests.functional \
93+
-m parallel -n 4 -k 'test_jq_header_remote_auth' \
94+
--junitxml=/tmp/junit-core.xml"
95+
96+
- name: "Test 4/6: pulp_maven (test_download_content)"
97+
run: |
98+
docker exec pulp-dev bash -c "\
99+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
100+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
101+
pytest -v -r sx --color=yes \
102+
--pyargs pulp_maven.tests.functional.api.test_download_content \
103+
--junitxml=/tmp/junit-maven.xml"
104+
105+
- name: "Test 5/6: pulp_npm (test_pull_through_install)"
106+
run: |
107+
docker exec pulp-dev bash -c "\
108+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
109+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
110+
pytest -v -r sx --color=yes \
111+
--pyargs pulp_npm.tests.functional \
112+
-k 'test_pull_through_install' \
113+
--junitxml=/tmp/junit-npm.xml"
114+
115+
- name: "Test 6/6: pulp_service functional"
116+
run: |
117+
docker exec pulp-dev bash -c "\
118+
API_PROTOCOL=http API_HOST=localhost API_PORT=24817 \
119+
ADMIN_USERNAME=admin ADMIN_PASSWORD=password \
120+
pytest -v -r sx --color=yes \
121+
--pyargs pulp_service.tests.functional \
122+
-m 'not parallel' \
123+
--junitxml=/tmp/junit-service.xml"
124+
125+
- name: Collect test results
126+
if: always()
127+
run: |
128+
mkdir -p test-results
129+
docker cp pulp-dev:/tmp/junit-rpm-parallel.xml test-results/ 2>/dev/null || true
130+
docker cp pulp-dev:/tmp/junit-rpm-serial.xml test-results/ 2>/dev/null || true
131+
docker cp pulp-dev:/tmp/junit-core.xml test-results/ 2>/dev/null || true
132+
docker cp pulp-dev:/tmp/junit-maven.xml test-results/ 2>/dev/null || true
133+
docker cp pulp-dev:/tmp/junit-npm.xml test-results/ 2>/dev/null || true
134+
docker cp pulp-dev:/tmp/junit-service.xml test-results/ 2>/dev/null || true
135+
136+
- name: Upload test results
137+
if: always()
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: junit-results
141+
path: test-results/
142+
retention-days: 14
143+
144+
- name: Dump container logs on failure
145+
if: failure()
146+
run: docker logs pulp-dev

.tekton/pulp-deploy-and-test.yaml

Lines changed: 1 addition & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -697,132 +697,6 @@ spec:
697697
cat __tmp_init__.py | cmd_stdin_prefix bash -c "cat > /tmp/home/.local/lib/python3.11/site-packages/pulpcore/__init__.py"
698698
cat __tmp_init__.py | cmd_stdin_prefix bash -c "cat > /tmp/home/.local/lib/python3.11/site-packages/pulpcore/client/__init__.py"
699699
700-
- name: pulp-functional-tests
701-
when:
702-
- input: '$(tasks.test-metadata.results.test-event-type)'
703-
operator: in
704-
values: ["pull_request"]
705-
runAfter:
706-
- install-bindings
707-
params:
708-
- name: BONFIRE_IMAGE
709-
value: "$(params.BONFIRE_IMAGE)"
710-
- name: NS
711-
value: "$(tasks.reserve-namespace.results.NS)"
712-
- name: EPHEMERAL_ENV_PROVIDER_SECRET
713-
value: "$(params.EPHEMERAL_ENV_PROVIDER_SECRET)"
714-
taskSpec:
715-
params:
716-
- name: BONFIRE_IMAGE
717-
type: string
718-
description: The container Bonfire image to use for the tekton tasks
719-
default: quay.io/redhat-user-workloads/hcc-devprod-tenant/hcc-cicd-tools/cicd-tools:834176766e3f911ffa24bfacff59dd15126e4b3a
720-
- name: EPHEMERAL_ENV_PROVIDER_SECRET
721-
type: string
722-
default: ephemeral-env-provider
723-
- name: NS
724-
type: string
725-
description: Namespace name to deploy the application to
726-
steps:
727-
- name: functional-tests
728-
image: "$(params.BONFIRE_IMAGE)"
729-
env:
730-
- name: OC_LOGIN_TOKEN
731-
valueFrom:
732-
secretKeyRef:
733-
name: $(params.EPHEMERAL_ENV_PROVIDER_SECRET)
734-
key: token
735-
- name: OC_LOGIN_SERVER
736-
valueFrom:
737-
secretKeyRef:
738-
name: $(params.EPHEMERAL_ENV_PROVIDER_SECRET)
739-
key: url
740-
- name: NS
741-
value: $(params.NS)
742-
script: |
743-
set -ex
744-
745-
login.sh
746-
747-
if [ -n "$NS" ]; then
748-
oc_wrapper project $NS
749-
else
750-
export NS=$(oc_wrapper project | grep -oE 'ephemeral-......')
751-
fi
752-
echo "Namespace is $NS"
753-
754-
PASSWORD=$(oc_wrapper extract secret/pulp-admin-password --to=-)
755-
756-
POD=$(oc_wrapper get pod | grep -oE "pulp-api\S*")
757-
echo $POD
758-
oc_wrapper get pod $POD -o yaml | grep memory:
759-
760-
oc_wrapper get clowdenvironment env-$(oc_wrapper project | grep -oE 'ephemeral-......') -o yaml
761-
762-
oc_wrapper get clowdapp pulp -o yaml
763-
764-
### Adapted from ./.github/workflows/scripts/utils.sh
765-
# Run a command
766-
cmd_prefix() {
767-
oc_wrapper exec -c pulp-api deployment/pulp-api -- "$@"
768-
}
769-
770-
# Run a command, and pass STDIN
771-
cmd_stdin_prefix() {
772-
oc_wrapper exec -c pulp-api -i deployment/pulp-api -- "$@"
773-
}
774-
### END Adapted from ./.github/workflows/scripts/utils.sh
775-
776-
debug_and_fail() {
777-
oc_wrapper logs $(oc_wrapper get pod | grep -oE "pulp-content\S*")
778-
oc_wrapper logs $(oc_wrapper get pod | grep -oE "pulp-api\S*")
779-
for pod in $(oc_wrapper get pod | grep -oE "pulp-worker\S*"); do
780-
oc_wrapper logs "$pod"
781-
done
782-
echo "CURL OUTPUT"
783-
curl https://env-${NS}.apps.crc-eph.r9lp.p1.openshiftapps.com/api/pulp-content/default/
784-
echo "ROUTES"
785-
oc_wrapper get route
786-
exit 1
787-
}
788-
789-
cmd_prefix bash -c "HOME=/tmp/home pip3 install pytest\<8 gnupg"
790-
791-
curl -o functest_requirements.txt https://raw.githubusercontent.com/pulp/pulp_rpm/main/functest_requirements.txt
792-
curl -o unittest_requirements.txt https://raw.githubusercontent.com/pulp/pulp_rpm/main/unittest_requirements.txt
793-
794-
### Adapted from ./.github/workflows/scripts/script.sh
795-
cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"
796-
cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt"
797-
cmd_prefix bash -c "HOME=/tmp/home pip3 install -r /tmp/unittest_requirements.txt -r /tmp/functest_requirements.txt"
798-
# Because we pass the path to pytest -o cache_dir=/tmp/home/.cache/pytest_cache, pulpcore-manager must be in the same dir
799-
cmd_prefix bash -c "ln -s /usr/local/lib/pulp/bin/pulpcore-manager /tmp/home/.local/bin/pulpcore-manager || /bin/true"
800-
echo "CURL OUTPUT"
801-
curl https://env-${NS}.apps.crc-eph.r9lp.p1.openshiftapps.com/api/pulp-content/default/
802-
echo "ROUTES"
803-
oc_wrapper get route
804-
set +e
805-
# Only testing test_download_content because it is a very thorough test that tests that all the components of pulp can work
806-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_rpm.tests.functional -m parallel -n 8 -k 'test_download_content' --junitxml=/tmp/home/junit-pulp-parallel.xml" || debug_and_fail
807-
# Never test test_package_manager_consume because they require sudo
808-
# Do not test test_domain_create because it requires more than 2GB of RAM
809-
# Only testing test_download_policies because they are very thorough tests that test that all the components of pulp can work
810-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --pyargs pulp_rpm.tests.functional -m 'not parallel' -k 'test_download_policies' --junitxml=/tmp/home/junit-pulp-serial.xml" || debug_and_fail
811-
812-
# Run the jq header auth test
813-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --pyargs pulpcore.tests.functional -m 'parallel' -n 8 -k 'test_jq_header_remote_auth' --junitxml=/tmp/home/junit-pulp-serial.xml" || debug_and_fail
814-
815-
### END Adapted from ./.github/workflows/scripts/script.sh
816-
817-
# Run pulp_maven functional tests
818-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --pyargs pulp_maven.tests.functional.api.test_download_content --junitxml=/tmp/home/junit-pulp-serial.xml" || debug_and_fail
819-
820-
# Run pulp_npm functional tests
821-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --pyargs pulp_npm.tests.functional -k 'test_pull_through_install' --junitxml=/tmp/home/junit-pulp-serial.xml" || debug_and_fail
822-
823-
# Run pulp_service functional tests
824-
cmd_prefix bash -c "HOME=/tmp/home PYTHONPATH=/tmp/home/.local/lib/python3.11/site-packages/ XDG_CONFIG_HOME=/tmp/home/.config API_PROTOCOL=http API_HOST=pulp-api API_PORT=8000 ADMIN_USERNAME=admin ADMIN_PASSWORD=$PASSWORD /tmp/home/.local/bin/pytest -o cache_dir=/tmp/home/.cache/pytest_cache -v -r sx --color=yes --pyargs pulp_service.tests.functional -m 'not parallel' --junitxml=/tmp/home/junit-pulp-serial.xml" || debug_and_fail
825-
826700
- name: push-api-json-files-to-pulp
827701
when:
828702
- input: '$(tasks.test-metadata.results.test-event-type)'
@@ -838,7 +712,7 @@ spec:
838712
- name: SNAPSHOT
839713
value: "$(params.SNAPSHOT)"
840714
runAfter:
841-
- pulp-functional-tests
715+
- install-bindings
842716
taskSpec:
843717
params:
844718
- name: BONFIRE_IMAGE

0 commit comments

Comments
 (0)