Skip to content

Commit 5e4e464

Browse files
authored
Merge pull request #19 from devsapp/add-test-in-action
add test in action
2 parents 28df64a + 1c1f861 commit 5e4e464

File tree

8 files changed

+69
-119
lines changed

8 files changed

+69
-119
lines changed

.github/workflows/ci_with_docker_linux.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
8-
branches:
9-
- master
107

118
env:
129
REGION: cn-hongkong

.github/workflows/ci_with_docker_macos.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
8-
branches:
9-
- master
107

118
env:
129
REGION: cn-hongkong

__tests__/e2e/apt/code/package-lock.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

__tests__/e2e/ci-mac-linux.sh

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77
set -e
88
set -v
99

10+
if [[ $(uname -s) == "Linux" ]]; then
11+
# echo "test trigger"
12+
# cd trigger && ./run
13+
# cd ..
14+
echo "test custom-domain"
15+
cd custom-domain
16+
s deploy -y
17+
s info
18+
s remove -y
19+
20+
s deploy -y -t s2.yaml
21+
s info -t s2.yaml
22+
s remove -y -t s2.yaml
23+
cd ..
24+
else
25+
echo "skip test trigger"
26+
fi
27+
1028
echo "test go runtime"
1129
cd go
1230
export fc_component_function_name=go1-$(uname)-$(uname -m)-$RANDSTR
@@ -40,15 +58,33 @@ s remove -y -t ./go/s.yaml
4058
rm -rf ./go/code/target
4159
cd ..
4260

43-
# echo "test nodejs runtime with auto ..."
44-
# cd nodejs
45-
# export fc_component_function_name=nodejs14-$(uname)-$(uname -m)-$RANDSTR
46-
# s deploy -y -t ./s_auto.yaml
47-
# s invoke -e '{"hello":"fc nodejs with auto"}' -t ./s_auto.yaml
48-
# s info -y -t ./s_auto.yaml
49-
# s remove -y -t ./s_auto.yaml
50-
# cd ..
61+
echo "test nodejs runtime with auto ..."
62+
cd nodejs
63+
export fc_component_function_name=nodejs14-$(uname)-$(uname -m)-$RANDSTR
64+
s deploy -y -t s_auto.yaml
65+
s invoke -e '{"hello":"fc nodejs with auto"}' -t s_auto.yaml
66+
s info -y -t s_auto.yaml
67+
s remove -y -t s_auto.yaml
68+
69+
echo "test deploy with alias"
70+
export fc_component_function_name=nodejs14-$(uname)-$(uname -m)-$RANDSTR
71+
s deploy --function -t s2.yaml
72+
versionId=$(s version publish -t s2.yaml --silent -o json | jq -r '."versionId"')
73+
echo "latest version = $versionId"
74+
if [[ "$versionId" -gt 1 ]]; then
75+
mainVersion=$((versionId - 1))
76+
echo "main version = $mainVersion"
77+
s alias publish --alias-name test --version-id $mainVersion --vw "{\"$versionId\": 0.2}" -t s2.yaml
78+
else
79+
s alias publish --alias-name test --version-id $versionId -t s2.yaml
80+
fi
81+
82+
s deploy --trigger -t s2.yaml
83+
s deploy --async-invoke-config -t s2.yaml
84+
s info -t s2.yaml
85+
s remove -y -t s2.yaml
86+
cd ..
5187

5288
echo " ********* command-api *********"
5389
cd command-api && ./run && cd -
54-
cd command-api && ./run_cli_mode && cd -
90+
cd command-api && ./run_cli_mode && cd -

__tests__/e2e/custom-domain/s.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name: hello-world-app
88
access: "quanxi"
99

1010
vars:
11-
region: ${env('REGION', 'cn-huhehaote')}
11+
region: 'cn-huhehaote'
1212

1313
resources:
1414
hello_world_1:

__tests__/e2e/nodejs/code/package-lock.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

__tests__/e2e/nodejs/s.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: test-node-app # 项目名称
33
access: quanxi
44

55
vars:
6-
region: ${env('REGION', 'cn-hangzhou')}
6+
region: ${env('REGION', 'cn-huhehaote')}
77

88
resources:
99
fcDemo: # 业务名称/模块名称

__tests__/e2e/trigger/run

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,26 @@ s deploy -y
4646
s info
4747
s plan
4848
s remove -y
49+
50+
echo "test http trigger with jwt ..."
51+
cd ../jwt
52+
export fc_component_function_name=nodejs16-$(uname)-$(uname -m)-$RANDSTR
53+
s deploy -y -t ./s.yaml
54+
s invoke -e '{"hello":"fc http trigger with jwt"}' -t ./s.yaml
55+
url1=$(s info -y -t ./s.yaml --silent -o json | jq -r '.hello_world.url.system_url')
56+
url2=$(s info -y -t ./s.yaml --silent -o json | jq -r '.hello_world_2.url.system_url')
57+
echo $url1
58+
echo $url2
59+
curl -XPOST $url1/black1/aa -d '{"test":"jwt"}'
60+
curl -XPOST $url1/black2/aaa -d '{"test":"jwt"}'
61+
curl -XPOST $url1/black1/bbb -d '{"test":"jwt"}'
62+
curl -XPOST $url1/black1/bbb -d '{"test":"jwt"}' -H "Authentication: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiIsImFkbWluIjp0cnVlLCJleHAiOjE3MDkxODg1MzksIm5iZiI6MTcwOTAxNTc1NCwiaWF0IjoxNzA5MDE1NzU2fQ.LknspC5W2QEThq9xpF1OciAJKpQMJmhkPGRWCS4rRoEeyTYl7bzKLqTuEhKE1I-luzjjIXNsnK6Ypbk_ith5mV2Wz6TTfQ-BF_dfBEfx75A9lDaTyLrn_zNLlOs-qsxst2y7eAOQQ7lb2mubFlLA3LDAWO-4UBJDLes0Mn6rp5pzSbF5zNypd319J1R6gAGBUBsPFGeTkxjr3ykHlB_nKNV0G7WpK9z_QvXQkT4os3oU2rs2tL1QQO4P3pSDB2lvEJ0dsXVggJi1rr6Av22uDI1lFo0PEekJmdFns-VIS36ipy3Ppgd7f5gicBNgUyhNUggPbdyePfV7zCkw3IrU-w"
63+
curl -XPOST $url1/black1/bbb -d '{"test":"jwt"}' -H "Authentication: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ind3dy5iZWpzb24uY29tIiwic3ViIjoiZGVtbyIsImlhdCI6MTcwOTAxOTM5MCwibmJmIjoxNzA5MDE5MzkwLCJleHAiOjE3MDkxMDU3OTB9.TmHPtcD76VBNelt0Qdjc-SsYxfpxIzNIL0FSz8JAQchhqkXnhpqK5j2_sE0ot6Fx_bwFQHEB0erJLn4Ey7OtJgT4B3etxlpcw39jk2M1YidkFfKHgq2d8tUXa-Nu8mpvVQP7kQJ-Z-l_OkiJZs1NpgaKo5646k0vEaQqmzW3aYwuL4NE2tumDoYDCzexLzUTuzNUucxZ8sZYqf5_yIcLXueHItGampnLMtsWLNH3StXoiQWkS79Lhj04Lq5YTO4Sd074KNc5juJRZwqNpjddaQ08_5ry_jhOr0C3c1uEatehCePJozQZIdELf0Y6gN0-CYRhcJPiz5ynbOB9pNMLUw"
64+
curl -XPOST $url2/white1/aaa -d '{"test":"jwt"}'
65+
curl -XPOST $url2/white2/ccc -d '{"test":"jwt"}'
66+
curl -XPOST $url2/common/aaa -d '{"test":"jwt"}' -H "Authentication: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiIsImFkbWluIjp0cnVlLCJleHAiOjE3MDkxODg1MzksIm5iZiI6MTcwOTAxNTc1NCwiaWF0IjoxNzA5MDE1NzU2fQ.LknspC5W2QEThq9xpF1OciAJKpQMJmhkPGRWCS4rRoEeyTYl7bzKLqTuEhKE1I-luzjjIXNsnK6Ypbk_ith5mV2Wz6TTfQ-BF_dfBEfx75A9lDaTyLrn_zNLlOs-qsxst2y7eAOQQ7lb2mubFlLA3LDAWO-4UBJDLes0Mn6rp5pzSbF5zNypd319J1R6gAGBUBsPFGeTkxjr3ykHlB_nKNV0G7WpK9z_QvXQkT4os3oU2rs2tL1QQO4P3pSDB2lvEJ0dsXVggJi1rr6Av22uDI1lFo0PEekJmdFns-VIS36ipy3Ppgd7f5gicBNgUyhNUggPbdyePfV7zCkw3IrU-w"
67+
curl -XPOST $url2/common/aaa -d '{"test":"jwt"}' -H "Authentication: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ind3dy5iZWpzb24uY29tIiwic3ViIjoiZGVtbyIsImlhdCI6MTcwOTAxOTM5MCwibmJmIjoxNzA5MDE5MzkwLCJleHAiOjE3MDkxMDU3OTB9.TmHPtcD76VBNelt0Qdjc-SsYxfpxIzNIL0FSz8JAQchhqkXnhpqK5j2_sE0ot6Fx_bwFQHEB0erJLn4Ey7OtJgT4B3etxlpcw39jk2M1YidkFfKHgq2d8tUXa-Nu8mpvVQP7kQJ-Z-l_OkiJZs1NpgaKo5646k0vEaQqmzW3aYwuL4NE2tumDoYDCzexLzUTuzNUucxZ8sZYqf5_yIcLXueHItGampnLMtsWLNH3StXoiQWkS79Lhj04Lq5YTO4Sd074KNc5juJRZwqNpjddaQ08_5ry_jhOr0C3c1uEatehCePJozQZIdELf0Y6gN0-CYRhcJPiz5ynbOB9pNMLUw"
68+
s plan -t ./s.yaml
69+
s info -y -t ./s.yaml
70+
s remove -y -t ./s.yaml
4971
cd ..

0 commit comments

Comments
 (0)