Replace flag text with const (#1391)

This commit is contained in:
Ta-Ching Chen
2019-11-09 22:13:35 +08:00
committed by GitHub
parent 6f5f6900b6
commit d3d8ff6c1b
73 changed files with 867 additions and 926 deletions
@@ -65,5 +65,8 @@ if [[ "$response" != "$expectedRespOutput" ]]; then
exit 1
fi
log "Deleting message queue trigger"
fission mqtrigger delete --name $mqt
log "Subscriber received expected response: $response"
log "Test PASSED"
@@ -73,4 +73,8 @@ if [[ "$response" != "$expectedRespOutput" ]]; then
else
log "Responses match."
fi
log "Deleting message queue trigger"
fission mqtrigger delete --name $mqt
log "Test PASSED"
+5 -5
View File
@@ -36,7 +36,7 @@ create_archive() {
create_package() {
log "Creating package"
pkg=$(fission package create --deploy "$tmp_dir/test-deploy-pkg.zip" --env $env| cut -f2 -d' '| tr -d \')
fission package create --name $1 --deploy "$tmp_dir/test-deploy-pkg.zip" --env $env
}
delete_package() {
@@ -74,14 +74,14 @@ main() {
log "created archive test-deploy-pkg.zip"
# create packages with the huge archive
create_package
pkg_1=$pkg
pkg_1=$(generate_test_id)
create_package $pkg_1
get_archive_url_from_package $pkg_1
url_1=$url
log "pkg: $pkg_1, archive_url : $url_1"
create_package
pkg_2=$pkg
pkg_2=$(generate_test_id)
create_package $pkg_2
get_archive_url_from_package $pkg_2
url_2=$url
log "pkg: $pkg_2, archive_url : $url_2"
+4 -2
View File
@@ -33,7 +33,8 @@ fission env create --name $env --image $GO_RUNTIME_IMAGE --builder $GO_BUILDER_I
timeout 90 bash -c "wait_for_builder $env"
pkgName=$(fission package create --src hello.go --env $env| cut -f2 -d' '| tr -d \')
pkgName=$(generate_test_id)
fission package create --name $pkgName --src hello.go --env $env
# wait for build to finish at most 90s
timeout 90 bash -c "waitBuild $pkgName"
@@ -58,7 +59,8 @@ timeout 60 bash -c "test_fn $fn_nd 'Hello'"
# Create zip file without top level directory (module-example)
cd module-example && zip -r $tmp_dir/module.zip *
pkgName=$(fission package create --src $tmp_dir/module.zip --env $env| cut -f2 -d' '| tr -d \')
pkgName=$(generate_test_id)
fission package create --name $pkgName --src $tmp_dir/module.zip --env $env
# wait for build to finish at most 90s
timeout 90 bash -c "waitBuild $pkgName"
@@ -37,7 +37,8 @@ fission env create --name $env --image $JVM_RUNTIME_IMAGE --version 2 --keeparch
timeout 90 bash -c "wait_for_builder $env"
log "Creating package from the source archive"
pkg_name=`fission package create --sourcearchive $tmp_dir/java-src-pkg.zip --env $env|cut -d' ' -f 2|cut -d"'" -f 2`
pkg_name=$(generate_test_id)
fission package create --name $pkg_name --sourcearchive $tmp_dir/java-src-pkg.zip --env $env
log "Created package $pkg_name"
log "Checking the status of package"
@@ -29,7 +29,6 @@ fn2=test-python-env-2-$TEST_ID
fn3=test-python-env-3-$TEST_ID
fn4=test-python-env-4-$TEST_ID
fn5=test-python-env-5-$TEST_ID
pkg=
log "Creating v1api environment ..."
@@ -50,7 +49,8 @@ log "Creating package ..."
pushd $ROOT/test/tests/test_environments/python_src/
zip -r $tmp_dir/src-pkg.zip *
popd
pkg=$(fission package create --src $tmp_dir/src-pkg.zip --env $env_v2api | cut -f2 -d' '| tr -d \')
pkg=$(generate_test_id)
fission package create --name $pkg --src $tmp_dir/src-pkg.zip --env $env_v2api
timeout 60s bash -c "waitBuild $pkg"
@@ -33,7 +33,8 @@ fission env create --name $env --image $TS_RUNTIME_IMAGE --version 2 --period 5
zip -r half_plus_two.zip ./half_plus_two
pkgName=$(fission package create --deploy half_plus_two.zip --env $env| cut -f2 -d' '| tr -d \')
pkgName=$(generate_test_id)
fission package create --name $pkgName --deploy half_plus_two.zip --env $env
# wait for build to finish at most 90s
timeout 90 bash -c "waitBuild $pkgName"
+8 -4
View File
@@ -59,7 +59,8 @@ timeout 180s bash -c "wait_for_builder $env"
# 1) Multiple source files (multiple inputs, Using * expression, from a directory)
# Currently only * expression implemented as a test
pushd $ROOT/examples/python/
pkg1=$(fission package create --src "sourcepkg/*" --env $env --buildcmd "./build.sh"| cut -f2 -d' '| tr -d \')
pkg1="pkg1-${TEST_ID}"
fission package create --name $pkg1 --src "sourcepkg/*" --env $env --buildcmd "./build.sh"
popd
# wait for build to finish at most 60s
timeout 60s bash -c "waitBuild $pkg1"
@@ -77,7 +78,8 @@ checkFunctionResponse $fn1 'a: 1 b: {c: 3, d: 4}'
# 2) Source archive file
log "Creating pacakage with source archive"
zip -jr $tmp_dir/demo-src-pkg.zip $ROOT/examples/python/sourcepkg/
pkg2=$(fission package create --src $tmp_dir/demo-src-pkg.zip --env $env --buildcmd "./build.sh"| cut -f2 -d' '| tr -d \')
pkg2="pkg2-${TEST_ID}"
fission package create --name $pkg2 --src $tmp_dir/demo-src-pkg.zip --env $env --buildcmd "./build.sh"
# wait for build to finish at most 60s
timeout 60s bash -c "waitBuild $pkg2"
@@ -98,7 +100,8 @@ checkFunctionResponse $fn2 'a: 1 b: {c: 3, d: 4}'
# 4) Deployment files from a directory
pushd $ROOT/examples/python/
pkg4=$(fission package create --deploy "multifile/*" --env $env| cut -f2 -d' '| tr -d \')
pkg4="pkg4-${TEST_ID}"
fission package create --name $pkg4 --deploy "multifile/*" --env $env
popd
log "Creating function " $fn4
fission fn create --name $fn4 --pkg $pkg4 --entrypoint "main.main"
@@ -118,7 +121,8 @@ mkdir $tmp_dir/deploypkg
touch $tmp_dir/deploypkg/__init__.py
printf 'def main():\n return "Hello, world!"' > $tmp_dir/deploypkg/hello.py
zip -jr $tmp_dir/demo-deploy-pkg.zip $tmp_dir/deploypkg/
pkg5=$(fission package create --deploy $tmp_dir/demo-deploy-pkg.zip --env $env| cut -f2 -d' '| tr -d \')
pkg5="pkg5-${TEST_ID}"
fission package create --name $pkg5 --deploy $tmp_dir/demo-deploy-pkg.zip --env $env
log "Updating function " $fn5