Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make timeout configurable. #298

Merged
merged 3 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions tests/acceptance/semiautomation/helper.fish
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function waitForKubectl
set -l select $argv[2]
set -l good (string split -- ";" "$argv[3]")
set -l expected $argv[4]
set -l timeout $argv[5]
set -l timeout (math "$argv[5]" \* "$TIMEOUT")

echo
echo "Testing `kubectl $op`"
Expand Down Expand Up @@ -42,8 +42,8 @@ function waitForKubectl
end

function output
if which say > /dev/null
say $argv[1] > /dev/null ^ /dev/null
if test -n "$SAY"
eval $SAY $argv[1] > /dev/null ^ /dev/null
end
echo
for l in $argv[2..-1] ; echo $l ; end
Expand Down Expand Up @@ -71,7 +71,7 @@ end

function testArangoDB
set -l ip $argv[1]
set -l timeout $argv[2]
set -l timeout (math "$argv[2]" \* "$TIMEOUT")
set -l n 0
echo Waiting for ArangoDB to be ready...
while true
Expand Down Expand Up @@ -114,3 +114,14 @@ function checkImages
exit 1
end
end

if test -z "$TIMEOUT"
set -xg TIMEOUT 60
end

if test -z "$SAY"
if which say > /dev/null
set -xg SAY say
end
end

10 changes: 5 additions & 5 deletions tests/acceptance/semiautomation/test1a.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ patchYamlFile $YAMLFILE $ARANGODB_COMMUNITY Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -29,7 +29,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
14 changes: 7 additions & 7 deletions tests/acceptance/semiautomation/test1b.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ patchYamlFile $YAMLFILE $ARANGODB_COMMUNITY Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -31,7 +31,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
waitForKubectl "get pod" $DEPLOYMENT "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
14 changes: 7 additions & 7 deletions tests/acceptance/semiautomation/test1c.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ patchYamlFile $YAMLFILE $ARANGODB_ENTERPRISE Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -31,7 +31,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
waitForKubectl "get pod" $DEPLOYMENT "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
22 changes: 11 additions & 11 deletions tests/acceptance/semiautomation/test1d.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ patchYamlFile $YAMLFILE $ARANGODB_ENTERPRISE Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 15 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-syma" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-sywo" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get service" "$DEPLOYMENT-sync *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 15 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-syma" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-sywo" "1/1 *Running" 3 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
and waitForKubectl "get service" "$DEPLOYMENT-sync *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -35,7 +35,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
waitForKubectl "get pod" $DEPLOYMENT "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
26 changes: 13 additions & 13 deletions tests/acceptance/semiautomation/test2a.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ patchYamlFile $YAMLFILE $ARANGODB_ENTERPRISE Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Scale up the deployment
output "Next" "Patching Spec for Scaling up"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":3}]'
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 6 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 2 120
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 6 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 2 2
or fail "Patched deployment did not get ready."

# Scale down the deployment
output "Next" "Patching Spec for Scaling down"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":2}]'
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 2
or fail "Patched deployment did not get ready."

# Manual check
Expand All @@ -47,7 +47,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
48 changes: 24 additions & 24 deletions tests/acceptance/semiautomation/test2b.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,53 @@ patchYamlFile $YAMLFILE $ARANGODB_ENTERPRISE Development work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Patching
output "Scaling db servers up" "Patching Spec for Scaling up DBservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":5}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 11 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 11 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 2
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators up" "Patching Spec for Scaling up coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":4}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 12 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 12 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 2
or fail "Deployment did not get ready."

# Patching
output "Scaling dbservers down" "Patching Spec for Scaling down dbservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":2}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 2
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators down" "Patching Spec for Scaling down coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":1}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 6 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 6 2
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 2
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 2
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 1 2
or fail "Deployment did not get ready."

# Manual check
Expand All @@ -68,7 +68,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 120
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 2
or fail "Could not delete deployment."

output "Ready" ""
10 changes: 5 additions & 5 deletions tests/acceptance/semiautomation/test3a.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ patchYamlFile $YAMLFILE $ARANGODB_ENTERPRISE Production work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -29,7 +29,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
14 changes: 7 additions & 7 deletions tests/acceptance/semiautomation/test3b.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ patchYamlFile $YAMLFILE $ARANGODB_COMMUNITY Production work.yaml

# Deploy and check
kubectl apply -f work.yaml
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 2
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 2
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 2
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 3
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
testArangoDB $ip 2
or fail "ArangoDB was not reachable."

# Manual check
Expand All @@ -31,7 +31,7 @@ inputAndLogResult

# Cleanup
kubectl delete -f work.yaml
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
waitForKubectl "get pod" $DEPLOYMENT "" 0 2
or fail "Could not delete deployment."

output "Ready" ""
Loading