Github Actions Workflows (#1876)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com> Co-authored-by: sahil-lakhwani <sahilakhwani@gmail.com> Co-authored-by: agiwalpooja20 Co-authored-by: abhisheks-infracloud
This commit is contained in:
co-authored by
Vishal
sahil-lakhwani
agiwalpooja20
abhisheks-infracloud
parent
e438df87fa
commit
a68f3edcd4
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ ! -f ${HOME}/.kube/config ]
|
||||
then
|
||||
echo "Skipping end to end tests, no cluster credentials"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
source ./test/test_utils.sh
|
||||
|
||||
echo "source test_utils done"
|
||||
|
||||
dump_system_info
|
||||
|
||||
# run tests without newdeploy in parallel.
|
||||
|
||||
export FAILURES=0
|
||||
main() {
|
||||
set +e
|
||||
export TIMEOUT=1000 # 15 minutes per test
|
||||
# run tests without newdeploy in parallel.
|
||||
export JOBS=6
|
||||
source $ROOT/test/run_test.sh \
|
||||
$ROOT/test/tests/test_canary.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_idle_objects_reaper.sh \
|
||||
$ROOT/test/tests/mqtrigger/kafka/test_kafka.sh \
|
||||
$ROOT/test/tests/test_annotations.sh \
|
||||
$ROOT/test/tests/test_archive_pruner.sh \
|
||||
$ROOT/test/tests/test_backend_poolmgr.sh \
|
||||
$ROOT/test/tests/test_buildermgr.sh \
|
||||
$ROOT/test/tests/test_env_vars.sh \
|
||||
$ROOT/test/tests/test_environments/test_python_env.sh \
|
||||
$ROOT/test/tests/test_function_test/test_fn_test.sh \
|
||||
$ROOT/test/tests/test_function_update.sh \
|
||||
$ROOT/test/tests/test_ingress.sh \
|
||||
$ROOT/test/tests/test_internal_routes.sh \
|
||||
$ROOT/test/tests/test_logging/test_function_logs.sh \
|
||||
$ROOT/test/tests/test_node_hello_http.sh \
|
||||
$ROOT/test/tests/test_package_command.sh \
|
||||
$ROOT/test/tests/test_package_checksum.sh \
|
||||
$ROOT/test/tests/test_pass.sh \
|
||||
$ROOT/test/tests/test_specs/test_spec.sh \
|
||||
$ROOT/test/tests/test_specs/test_spec_multifile.sh \
|
||||
$ROOT/test/tests/test_specs/test_spec_merge/test_spec_merge.sh \
|
||||
$ROOT/test/tests/test_specs/test_spec_archive/test_spec_archive.sh \
|
||||
$ROOT/test/tests/test_environments/test_tensorflow_serving_env.sh \
|
||||
$ROOT/test/tests/test_environments/test_go_env.sh \
|
||||
$ROOT/test/tests/mqtrigger/nats/test_mqtrigger.sh \
|
||||
$ROOT/test/tests/mqtrigger/nats/test_mqtrigger_error.sh \
|
||||
$ROOT/test/tests/test_huge_response/test_huge_response.sh \
|
||||
$ROOT/test/tests/test_kubectl/test_kubectl.sh
|
||||
|
||||
export JOBS=3
|
||||
source $ROOT/test/run_test.sh \
|
||||
$ROOT/test/tests/test_backend_newdeploy.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_scale_change.sh \
|
||||
$ROOT/test/tests/test_secret_cfgmap/test_secret_cfgmap.sh \
|
||||
$ROOT/test/tests/test_environments/test_java_builder.sh \
|
||||
$ROOT/test/tests/test_environments/test_java_env.sh \
|
||||
$ROOT/test/tests/test_environments/test_nodejs_env.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_configmap_update.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_env_update.sh \
|
||||
$ROOT/test/tests/test_obj_create_in_diff_ns.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_resource_change.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_secret_update.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_nd_pkg_update.sh \
|
||||
$ROOT/test/tests/test_fn_update/test_poolmgr_nd.sh
|
||||
|
||||
set -e
|
||||
|
||||
# dump test logs
|
||||
# TODO: the idx does not match seq number in recap.
|
||||
idx=1
|
||||
log_files=$(find test/logs/ -name '*.log')
|
||||
|
||||
for log_file in $log_files; do
|
||||
test_name=${log_file#test/logs/}
|
||||
# travis_fold_start run_test.$idx $test_name
|
||||
echo "========== start $test_name =========="
|
||||
cat $log_file
|
||||
echo "========== end $test_name =========="
|
||||
# travis_fold_end run_test.$idx
|
||||
idx=$((idx+1))
|
||||
done
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
echo "Total Failures" $FAILURES
|
||||
if [[ $FAILURES != '0' ]]; then
|
||||
exit 1
|
||||
fi
|
||||
+38
-3
@@ -16,7 +16,40 @@ source $(dirname $BASH_SOURCE)/init_tools.sh
|
||||
ROOT=$(readlink -f $(dirname $0)/..)
|
||||
LOG_DIR=${LOG_DIR:-$ROOT/test/logs}
|
||||
JOBS=${JOBS:-1}
|
||||
TIMEOUT=${TIMEOUT:-0}
|
||||
|
||||
export FUNCTION_NAMESPACE=fission-function
|
||||
export FISSION_NAMESPACE=fission
|
||||
export FISSION_ROUTER=127.0.0.1:8888
|
||||
export NODE_RUNTIME_IMAGE=fission/node-env-12.16:1.11.0
|
||||
export NODE_BUILDER_IMAGE=fission/node-builder-12.16:1.11.0
|
||||
export PYTHON_RUNTIME_IMAGE=fission/python-env
|
||||
export PYTHON_BUILDER_IMAGE=fission/python-builder
|
||||
export GO_RUNTIME_IMAGE=fission/go-env-1.12
|
||||
export GO_BUILDER_IMAGE=fission/go-builder-1.12
|
||||
export JVM_RUNTIME_IMAGE=fission/jvm-env
|
||||
export JVM_BUILDER_IMAGE=fission/jvm-builder
|
||||
export JVM_JERSEY_RUNTIME_IMAGE=fission/jvm-jersey-env
|
||||
export JVM_JERSEY_BUILDER_IMAGE=fission/jvm-jersey-builder
|
||||
export TS_RUNTIME_IMAGE=fission/tensorflow-serving-env
|
||||
export CONTROLLER_IP=127.0.0.1:8889
|
||||
export FISSION_NATS_STREAMING_URL=http://defaultFissionAuthToken@127.0.0.1:8890
|
||||
|
||||
echo "Pulling env and builder images"
|
||||
docker pull $NODE_RUNTIME_IMAGE && kind load docker-image $NODE_RUNTIME_IMAGE --name kind
|
||||
docker pull $NODE_BUILDER_IMAGE && kind load docker-image $NODE_BUILDER_IMAGE --name kind
|
||||
docker system prune -a -f
|
||||
docker pull $PYTHON_RUNTIME_IMAGE && kind load docker-image $PYTHON_RUNTIME_IMAGE --name kind
|
||||
docker pull $PYTHON_BUILDER_IMAGE && kind load docker-image $PYTHON_BUILDER_IMAGE --name kind
|
||||
docker pull $JVM_RUNTIME_IMAGE && kind load docker-image $JVM_RUNTIME_IMAGE --name kind
|
||||
docker pull $JVM_BUILDER_IMAGE && kind load docker-image $JVM_BUILDER_IMAGE --name kind
|
||||
docker system prune -a -f
|
||||
docker pull $JVM_JERSEY_RUNTIME_IMAGE && kind load docker-image $JVM_JERSEY_RUNTIME_IMAGE --name kind
|
||||
docker pull $JVM_JERSEY_BUILDER_IMAGE && kind load docker-image $JVM_JERSEY_BUILDER_IMAGE --name kind
|
||||
docker pull $GO_RUNTIME_IMAGE && kind load docker-image $GO_RUNTIME_IMAGE --name kind
|
||||
docker pull $GO_BUILDER_IMAGE && kind load docker-image $GO_BUILDER_IMAGE --name kind
|
||||
docker system prune -a -f
|
||||
docker pull $TS_RUNTIME_IMAGE && kind load docker-image $TS_RUNTIME_IMAGE --name kind
|
||||
echo "Successfully pull env and builder images"
|
||||
|
||||
main() {
|
||||
if [ $# -eq 0 ]; then
|
||||
@@ -24,7 +57,6 @@ main() {
|
||||
else
|
||||
args="$@"
|
||||
fi
|
||||
|
||||
num_skip=0
|
||||
mkdir -p $LOG_DIR
|
||||
test_files=""
|
||||
@@ -54,7 +86,9 @@ main() {
|
||||
done
|
||||
|
||||
start_time=$(date +%s)
|
||||
|
||||
parallel \
|
||||
--retries 8 \
|
||||
--joblog - \
|
||||
--jobs $JOBS \
|
||||
--timeout $TIMEOUT \
|
||||
@@ -72,7 +106,8 @@ main() {
|
||||
time=$((end_time - start_time))
|
||||
echo ============================================================
|
||||
echo "PASS: $num_pass FAIL: $num_fail SKIP: $num_skip TIME: ${time}s"
|
||||
return $num_fail
|
||||
FAILURES=$((FAILURES+$num_fail))
|
||||
}
|
||||
|
||||
docker system prune -a -f
|
||||
main "$@"
|
||||
|
||||
+2
-2
@@ -210,7 +210,7 @@ set_environment() {
|
||||
}
|
||||
|
||||
generate_test_id() {
|
||||
echo $(cat /dev/urandom | tr -dc 'a-z' | fold -w 6 | head -n 1)
|
||||
echo $(((10000 + $RANDOM) % 99999))
|
||||
}
|
||||
|
||||
helm_install_fission() {
|
||||
@@ -618,7 +618,7 @@ install_and_test() {
|
||||
# Commented out due to Travis-CI log length limit
|
||||
# describe each pod in fission ns and function namespace
|
||||
# describe_all_pods $id
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ get_archive_url_from_package() {
|
||||
|
||||
get_archive_from_storage() {
|
||||
storage_service_url=$1
|
||||
controller_ip=$(kubectl -n $FISSION_NAMESPACE get svc controller -o jsonpath='{...ip}')
|
||||
controller_ip=$CONTROLLER_IP
|
||||
controller_proxy_url=`echo $storage_service_url | sed -e "s/storagesvc.$FISSION_NAMESPACE/$controller_ip\/proxy\/storage/"`
|
||||
log "controller_proxy_url=$controller_proxy_url"
|
||||
http_status=`curl --retry 5 -sw "%{http_code}" $controller_proxy_url -o /dev/null`
|
||||
@@ -109,7 +109,7 @@ main() {
|
||||
|
||||
# archivePruner is set to run every minute for test. In production, its set to run every hour.
|
||||
log "waiting for packages to get recycled"
|
||||
sleep 120
|
||||
sleep 300
|
||||
|
||||
# curl on the archive url
|
||||
get_archive_from_storage $url_1
|
||||
|
||||
@@ -21,7 +21,7 @@ route_succ=route-succ-$TEST_ID
|
||||
route_fail=route-fail-$TEST_ID
|
||||
canary_1=canary-1-$TEST_ID
|
||||
canary_2=canary-2-$TEST_ID
|
||||
|
||||
echo "Exported all the things"
|
||||
cleanup() {
|
||||
log "Cleaning up..."
|
||||
clean_resource_by_id $TEST_ID
|
||||
@@ -53,7 +53,7 @@ success_scenario() {
|
||||
sleep 60
|
||||
|
||||
log "Fire requests to the route"
|
||||
ab -n 300 -c 1 http://$FISSION_ROUTER/$route_succ
|
||||
p=$(ab -n 300 -c 1 http://$FISSION_ROUTER/$route_succ)
|
||||
|
||||
sleep 60
|
||||
|
||||
|
||||
@@ -68,6 +68,6 @@ then
|
||||
log "Failed to update target CPU for the function"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fission fn list
|
||||
timeout 60 bash -c "test_fn $fn 'world'"
|
||||
log "Test PASSED"
|
||||
|
||||
@@ -53,7 +53,6 @@ echo $response | grep -i foo
|
||||
# function to emulate real online traffic. The router
|
||||
# should be able to update cache under this situation.
|
||||
( watch -n1 curl http://$FISSION_ROUTER/$fn ) > /dev/null 2>&1 &
|
||||
pid=$!
|
||||
|
||||
log "Updating function"
|
||||
echo 'module.exports = function(context, callback) { callback(200, "bar!\n"); }' > $tmp_dir/bar.js
|
||||
@@ -68,6 +67,4 @@ response=$(curl http://$FISSION_ROUTER/$fn)
|
||||
log "Checking for valid response again"
|
||||
echo $response | grep -i bar
|
||||
|
||||
kill -15 $pid
|
||||
|
||||
log "All done."
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash
|
||||
#test:disabled
|
||||
# this test is disabled only for Kind tests and for GKE/EKS tests should be enabled
|
||||
|
||||
set -euo pipefail
|
||||
source $(dirname $0)/../utils.sh
|
||||
|
||||
@@ -103,7 +106,7 @@ log "Modifying the route by adding host, path, annotations, tls"
|
||||
fission route update --name $routeName --function $functionName --ingressannotation "foo=bar" --ingressrule "$hostName=/foo/bar" --ingresstls "dummy"
|
||||
|
||||
sleep 3
|
||||
checkIngress $routeName $hostName "/foo/bar" "map[foo:bar]" "dummy"
|
||||
checkIngress $routeName $hostName "/foo/bar" '{"foo":"bar"}' "dummy"
|
||||
|
||||
log "Remove ingress annotations, host, rule and tls"
|
||||
fission route update --name $routeName --function $functionName --ingressannotation "-" --ingressrule "-" --ingresstls "-"
|
||||
@@ -127,7 +130,7 @@ fission route create --name $routeName --url $relativeUrl --function $functionNa
|
||||
--ingressrule "*=$wildcardPath"
|
||||
|
||||
sleep 3
|
||||
checkIngress $routeName "" $wildcardPath "map[nginx.ingress.kubernetes.io/ssl-redirect:false nginx.ingress.kubernetes.io/use-regex:true]" ""
|
||||
checkIngress $routeName "" $wildcardPath '{"nginx.ingress.kubernetes.io/ssl-redirect":"false","nginx.ingress.kubernetes.io/use-regex":"true"}' ""
|
||||
timeout 10 bash -c "test_ingress $realPath 'hello, world!'"
|
||||
|
||||
log "Test PASSED"
|
||||
|
||||
@@ -7,12 +7,12 @@ metadata:
|
||||
spec:
|
||||
builder:
|
||||
command: build
|
||||
image: fission/go-builder-1.12:1.7.1
|
||||
image: fission/go-builder-1.12
|
||||
imagepullsecret: ""
|
||||
keeparchive: false
|
||||
poolsize: 3
|
||||
resources: {}
|
||||
runtime:
|
||||
image: fission/go-env-1.12:1.7.1
|
||||
image: fission/go-env-1.12
|
||||
terminationGracePeriod: 5
|
||||
version: 2
|
||||
|
||||
@@ -26,9 +26,6 @@ fi
|
||||
name="go-spec-kubectl"
|
||||
pkgName="go-b4bbb0e0-2d93-47f0-8c4e-eea644eec2a9"
|
||||
|
||||
# cleanup first
|
||||
cleanup
|
||||
|
||||
# apply environment & function
|
||||
kubectl apply -f spec-yaml -R
|
||||
|
||||
@@ -47,4 +44,6 @@ timeout 90 bash -c "waitBuild $pkgName"
|
||||
|
||||
fission fn test --name $name
|
||||
|
||||
log "Test PASSED"
|
||||
cleanup
|
||||
|
||||
log "Test PASSED"
|
||||
@@ -71,6 +71,9 @@ fission route create --function ${fn_secret} --url /${fn_secret} --method GET
|
||||
log "Waiting for router to catch up"
|
||||
sleep 5
|
||||
|
||||
fission fn list
|
||||
kubectl get secrets --all-namespaces
|
||||
kubectl get configmaps --all-namespaces
|
||||
timeout 60 bash -c "checkFunctionResponse ${fn_secret} 'TESTVALUE' 'secret'"
|
||||
|
||||
log "Creating second secret"
|
||||
|
||||
+6
-25
@@ -10,7 +10,7 @@ log() {
|
||||
export -f log
|
||||
|
||||
generate_test_id() {
|
||||
echo $(cat /dev/urandom | tr -dc 'a-z' | fold -w 8 | head -n 1)
|
||||
echo $(((10000 + $RANDOM) % 99999))
|
||||
}
|
||||
|
||||
clean_resource_by_id() {
|
||||
@@ -72,8 +72,11 @@ test_response() {
|
||||
set +e
|
||||
while true; do
|
||||
log "test_fn: call curl"
|
||||
echo $(curl "$url")
|
||||
resp=$(curl --silent --show-error "$url")
|
||||
# log "response:" $resp
|
||||
status_code=$?
|
||||
log "status_code:" $status_code
|
||||
if [ $status_code -ne 0 ]; then
|
||||
log "test_fn: curl failed ($status_code). Retrying ..."
|
||||
sleep 1
|
||||
@@ -138,7 +141,7 @@ export -f wait_for_builder
|
||||
|
||||
waitBuild() {
|
||||
log "Waiting for builder manager to finish the build"
|
||||
|
||||
echo "Waiting for builder manager"
|
||||
set +e
|
||||
while true; do
|
||||
kubectl --namespace default get packages $1 -o jsonpath='{.status.buildstatus}'|grep succeeded
|
||||
@@ -152,6 +155,7 @@ waitBuild() {
|
||||
export -f waitBuild
|
||||
|
||||
waitBuildExpectedStatus() {
|
||||
echo "In wait expected status"
|
||||
pkg=$1
|
||||
status=$2
|
||||
|
||||
@@ -169,26 +173,3 @@ waitBuildExpectedStatus() {
|
||||
}
|
||||
export -f waitBuildExpectedStatus
|
||||
|
||||
|
||||
## Common env parameters
|
||||
export FISSION_NAMESPACE=${FISSION_NAMESPACE:-fission}
|
||||
export FUNCTION_NAMESPACE=${FUNCTION_NAMESPACE:-fission-function}
|
||||
|
||||
router=$(kubectl -n $FISSION_NAMESPACE get svc router -o jsonpath='{...ip}')
|
||||
|
||||
export FISSION_ROUTER=${FISSION_ROUTER:-$router}
|
||||
export FISSION_NATS_STREAMING_URL="http://defaultFissionAuthToken@$(kubectl -n $FISSION_NAMESPACE get svc nats-streaming -o jsonpath='{...ip}:{.spec.ports[0].port}')"
|
||||
|
||||
## Parameters used by some specific test cases
|
||||
## To change the environment image setting for CI test, please refer run_all_tests() in test_utils.sh.
|
||||
export PYTHON_RUNTIME_IMAGE=${PYTHON_RUNTIME_IMAGE:-fission/python-env}
|
||||
export PYTHON_BUILDER_IMAGE=${PYTHON_BUILDER_IMAGE:-fission/python-builder}
|
||||
export GO_RUNTIME_IMAGE=${GO_RUNTIME_IMAGE:-fission/go-env-1.12}
|
||||
export GO_BUILDER_IMAGE=${GO_BUILDER_IMAGE:-fission/go-builder-1.12}
|
||||
export JVM_RUNTIME_IMAGE=${JVM_RUNTIME_IMAGE:-fission/jvm-env}
|
||||
export JVM_JERSEY_RUNTIME_IMAGE=${JVM_JERSEY_RUNTIME_IMAGE:-fission/jvm-jersey-env}
|
||||
export JVM_BUILDER_IMAGE=${JVM_BUILDER_IMAGE:-fission/jvm-builder}
|
||||
export NODE_RUNTIME_IMAGE=${NODE_RUNTIME_IMAGE:-fission/node-env}
|
||||
export NODE_BUILDER_IMAGE=${NODE_BUILDER_IMAGE:-fission/node-env-builder}
|
||||
export TS_RUNTIME_IMAGE=${TS_RUNTIME_IMAGE:-fission/tensorflow-serving-env}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user