mirror of
https://github.com/openshift/community.okd.git
synced 2026-07-30 03:14:31 +00:00
Can't use wait -n in the CI prow environment
This commit is contained in:
2
Makefile
2
Makefile
@@ -15,7 +15,7 @@ install: build
|
|||||||
ansible-galaxy collection install -p ansible_collections community-okd-$(VERSION).tar.gz
|
ansible-galaxy collection install -p ansible_collections community-okd-$(VERSION).tar.gz
|
||||||
|
|
||||||
test-sanity: install
|
test-sanity: install
|
||||||
cd ansible_collections/community/okd && ansible-test sanity -v $(SANITY_TEST_ARGS)
|
cd ansible_collections/community/okd && ansible-test sanity --exclude ci/ -v $(SANITY_TEST_ARGS)
|
||||||
|
|
||||||
test-integration: install
|
test-integration: install
|
||||||
molecule test
|
molecule test
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ eval IMAGE=$IMAGE_FORMAT
|
|||||||
PULL_POLICY=${PULL_POLICY:-IfNotPresent}
|
PULL_POLICY=${PULL_POLICY:-IfNotPresent}
|
||||||
|
|
||||||
echo "Deleting test job if it exists"
|
echo "Deleting test job if it exists"
|
||||||
kubectl delete job molecule-integration-test --wait --ignore-not-found
|
oc delete job molecule-integration-test --wait --ignore-not-found
|
||||||
|
|
||||||
echo "Creating molecule test job"
|
echo "Creating molecule test job"
|
||||||
cat << EOF | kubectl create -f -
|
cat << EOF | oc create -f -
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
@@ -40,25 +40,22 @@ spec:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Waiting for test job to report success"
|
function wait_for_success {
|
||||||
|
oc wait --for=condition=complete job/molecule-integration-test --timeout 5m
|
||||||
# Ensure the child processes are killed
|
|
||||||
trap 'kill $(jobs -p) || true' SIGINT SIGTERM EXIT
|
|
||||||
|
|
||||||
# Wait for job completion in background
|
|
||||||
kubectl wait --for=condition=complete job/molecule-integration-test --timeout 5m &
|
|
||||||
completion_pid=$!
|
|
||||||
|
|
||||||
# Wait for job failure in background
|
|
||||||
kubectl wait --for=condition=failed job/molecule-integration-test --timeout 5m && exit 1 &
|
|
||||||
failure_pid=$!
|
|
||||||
|
|
||||||
|
|
||||||
if wait -n $completion_pid $failure_pid ; then
|
|
||||||
echo "Molecule integration tests ran successfully"
|
echo "Molecule integration tests ran successfully"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
}
|
||||||
kubectl logs job/molecule-integration-test
|
|
||||||
|
function wait_for_failure {
|
||||||
|
oc wait --for=condition=failed job/molecule-integration-test --timeout 5m
|
||||||
|
oc logs job/molecule-integration-test
|
||||||
echo "Molecule integration tests failed, see logs for more information..."
|
echo "Molecule integration tests failed, see logs for more information..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
# Ensure the child processes are killed
|
||||||
|
trap 'kill -SIGTERM 0' SIGINT EXIT
|
||||||
|
|
||||||
|
echo "Waiting for test job to complete"
|
||||||
|
wait_for_success &
|
||||||
|
wait_for_failure
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/k8s.py validate-modules:return-syntax-error
|
plugins/modules/k8s.py validate-modules:return-syntax-error
|
||||||
ci/incluster_integration.sh shebang!skip
|
|
||||||
ci/incluster_integration.sh shellcheck!skip
|
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/k8s.py validate-modules:return-syntax-error
|
plugins/modules/k8s.py validate-modules:return-syntax-error
|
||||||
ci/incluster_integration.sh shebang!skip
|
|
||||||
ci/incluster_integration.sh shellcheck!skip
|
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
ci/incluster_integration.sh shebang!skip
|
|
||||||
ci/incluster_integration.sh shellcheck!skip
|
|
||||||
|
|||||||
Reference in New Issue
Block a user