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 () {
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@ echo "deploy create test: passed"
|
||||||
docker pull registry:2.8
|
docker pull registry:2.8
|
||||||
|
|
||||||
# Try to start the deployment
|
# 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
|
wait_for_pods_started
|
||||||
# Check logs command works
|
# Check logs command works
|
||||||
wait_for_log_output
|
wait_for_log_output
|
||||||
|
|
@ -132,15 +132,25 @@ docker tag hello-world localhost:80/hello-world
|
||||||
docker push localhost:80/hello-world
|
docker push localhost:80/hello-world
|
||||||
# Then do a quick check that we actually pushed something there
|
# 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
|
# 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)
|
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"
|
echo "registry content test: passed"
|
||||||
else
|
else
|
||||||
echo "registry content test: FAILED"
|
echo "registry content test: FAILED"
|
||||||
echo $registry_response
|
echo "Response: $registry_response"
|
||||||
delete_cluster_exit
|
delete_cluster_exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop and clean up
|
# 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"
|
echo "Test passed"
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ wait_for_test_complete () {
|
||||||
|
|
||||||
|
|
||||||
delete_cluster_exit () {
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ fi
|
||||||
echo "deploy create test: passed"
|
echo "deploy create test: passed"
|
||||||
|
|
||||||
# Try to start the deployment
|
# 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
|
wait_for_pods_started
|
||||||
# Check logs command works
|
# Check logs command works
|
||||||
wait_for_test_complete
|
wait_for_test_complete
|
||||||
|
|
@ -111,10 +111,10 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop then start again and check the volume was preserved
|
# 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 a bit just in case
|
||||||
sleep 20
|
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_pods_started
|
||||||
wait_for_test_complete
|
wait_for_test_complete
|
||||||
|
|
||||||
|
|
@ -127,5 +127,5 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop and clean up
|
# 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"
|
echo "Test passed"
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ wait_for_log_output () {
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_cluster_exit () {
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,7 +189,7 @@ EOF
|
||||||
deployment_id=$(cat ${test_deployment_dir}/deployment.yml | cut -d ' ' -f 2)
|
deployment_id=$(cat ${test_deployment_dir}/deployment.yml | cut -d ' ' -f 2)
|
||||||
|
|
||||||
# Try to start the deployment
|
# 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
|
wait_for_pods_started
|
||||||
# Check logs command works
|
# Check logs command works
|
||||||
wait_for_log_output
|
wait_for_log_output
|
||||||
|
|
@ -218,5 +218,5 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop and clean up
|
# 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"
|
echo "Test passed"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue