fix: add --perform-cluster-management to k8s test scripts
Since --skip-cluster-management is now the default, k8s test scripts that rely on Kind cluster creation/destruction need explicit flags. - container-registry: add flag to start/stop/cleanup, add retry loop for registry catalog check (10 attempts × 3s) - k8s-deployment-control: add flag to start/stop/cleanup - database: add flag to first start and final stop, use explicit --skip-cluster-management for mid-test restart (volume persistence) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>pull/739/head
parent
eb881ac179
commit
7d7934ea7c
|
|
@ -49,7 +49,7 @@ wait_for_log_output () {
|
|||
|
||||
|
||||
delete_cluster_exit () {
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ echo "deploy create test: passed"
|
|||
docker pull registry:2.8
|
||||
|
||||
# Try to start the deployment
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start --perform-cluster-management
|
||||
wait_for_pods_started
|
||||
# Check logs command works
|
||||
wait_for_log_output
|
||||
|
|
@ -132,15 +132,25 @@ docker tag hello-world localhost:80/hello-world
|
|||
docker push localhost:80/hello-world
|
||||
# Then do a quick check that we actually pushed something there
|
||||
# See: https://stackoverflow.com/questions/31251356/how-to-get-a-list-of-images-on-docker-registry-v2
|
||||
# Wait for the catalog to reflect the pushed image
|
||||
registry_ok=false
|
||||
for i in {1..10}; do
|
||||
registry_response=$(curl -s -X GET http://localhost:80/v2/_catalog)
|
||||
if [[ "$registry_response" == *"{\"repositories\":[\"hello-world\"]}"* ]]; then
|
||||
if [[ "$registry_response" == *"hello-world"* ]]; then
|
||||
registry_ok=true
|
||||
break
|
||||
fi
|
||||
echo "Waiting for registry catalog (attempt $i)..."
|
||||
sleep 3
|
||||
done
|
||||
if $registry_ok; then
|
||||
echo "registry content test: passed"
|
||||
else
|
||||
echo "registry content test: FAILED"
|
||||
echo $registry_response
|
||||
echo "Response: $registry_response"
|
||||
delete_cluster_exit
|
||||
fi
|
||||
|
||||
# Stop and clean up
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
echo "Test passed"
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ wait_for_test_complete () {
|
|||
|
||||
|
||||
delete_cluster_exit () {
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ fi
|
|||
echo "deploy create test: passed"
|
||||
|
||||
# Try to start the deployment
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start --perform-cluster-management
|
||||
wait_for_pods_started
|
||||
# Check logs command works
|
||||
wait_for_test_complete
|
||||
|
|
@ -111,10 +111,10 @@ else
|
|||
fi
|
||||
|
||||
# Stop then start again and check the volume was preserved
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --skip-cluster-management
|
||||
# Sleep a bit just in case
|
||||
sleep 20
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start --skip-cluster-management
|
||||
wait_for_pods_started
|
||||
wait_for_test_complete
|
||||
|
||||
|
|
@ -127,5 +127,5 @@ else
|
|||
fi
|
||||
|
||||
# Stop and clean up
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
echo "Test passed"
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ wait_for_log_output () {
|
|||
}
|
||||
|
||||
delete_cluster_exit () {
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ EOF
|
|||
deployment_id=$(cat ${test_deployment_dir}/deployment.yml | cut -d ' ' -f 2)
|
||||
|
||||
# Try to start the deployment
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir start --perform-cluster-management
|
||||
wait_for_pods_started
|
||||
# Check logs command works
|
||||
wait_for_log_output
|
||||
|
|
@ -218,5 +218,5 @@ else
|
|||
fi
|
||||
|
||||
# Stop and clean up
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes
|
||||
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --perform-cluster-management
|
||||
echo "Test passed"
|
||||
|
|
|
|||
Loading…
Reference in New Issue