Skip to content

Commit dbb4ae0

Browse files
committed
fix: customEndpoint invalid
1 parent 671cf89 commit dbb4ae0

File tree

5 files changed

+33
-5
lines changed

5 files changed

+33
-5
lines changed

__tests__/e2e/ci-mac-linux.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ s deploy -y -t ./s_tags2.yaml
8181
s deploy -y -t ./s_tags3.yaml
8282
s remove -y -t ./s_tags3.yaml
8383

84+
echo "test nodejs runtime with custom endpoint ..."
85+
s deploy -y -t ./s_custom_endpoint.yaml
86+
s remove -y -t ./s_custom_endpoint.yaml
87+
8488
echo "test deploy with alias"
8589
export fc_component_function_name=nodejs18-$(uname)-$(uname -m)-$RANDSTR
8690
s deploy --function -t s2.yaml

__tests__/e2e/ci.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ s deploy -y -t ./s_tags3.yaml
8888
s remove -y -t ./s_tags3.yaml
8989
cd ..
9090

91+
echo "test nodejs runtime with custom endpoint ..."
92+
s deploy -y -t ./s_custom_endpoint.yaml
93+
s remove -y -t ./s_custom_endpoint.yaml
94+
cd ..
95+
9196
echo "test deploy with alias"
9297
cd nodejs
9398
export fc_component_function_name=nodejs18-$(uname)-$(uname -m)-$RANDSTR
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
edition: 3.0.0
2+
name: test-node-app
3+
access: quanxi
4+
5+
vars:
6+
region: ${env('REGION', 'ap-southeast-1')}
7+
8+
resources:
9+
fcDemo1: # 业务名称/模块名称
10+
component: ${env('fc_component_version', path('../../../'))}
11+
props: # 组件的属性值
12+
region: ${vars.region}
13+
functionName: fc3-event-${env('fc_component_function_name', 'nodejs18')}-endpoint
14+
runtime: ${env('fc_component_runtime', 'nodejs18')}
15+
code: ./test-auto-code
16+
handler: index.handler
17+
memorySize: 128
18+
endpoint: http://${config('AccountID')}.${vars.region}.fc.aliyuncs.com
19+
timeout: 30

example/test_models_pipeline.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ for MODEL_INFO in "${MODEL_LIST[@]}"; do
7676
if [ -z $SYSTEM_URL ]; then
7777
log "Failed to extract system_url for model: $MODEL_ID"
7878
# 清理资源
79-
REMOVE_OUTPUT=$(s model remove -y 2>&1)
79+
REMOVE_OUTPUT=$(s model remove -t s-pipeline.yaml -y 2>&1)
8080
echo "$REMOVE_OUTPUT" >> "$LOG_FILE"
8181
echo "$REMOVE_OUTPUT"
82-
REMOVE_OUTPUT=$(s remove -y 2>&1)
82+
REMOVE_OUTPUT=$(s remove -t s-pipeline.yaml -y 2>&1)
8383
echo "$REMOVE_OUTPUT" >> "$LOG_FILE"
8484
echo "$REMOVE_OUTPUT"
8585
continue
@@ -105,10 +105,10 @@ for MODEL_INFO in "${MODEL_LIST[@]}"; do
105105

106106
# 清理资源
107107
log "Removing resources..."
108-
REMOVE_OUTPUT=$(s model remove -y 2>&1)
108+
REMOVE_OUTPUT=$(s model remove -t s-pipeline.yaml -y 2>&1)
109109
echo "$REMOVE_OUTPUT" >> "$LOG_FILE"
110110
echo "$REMOVE_OUTPUT"
111-
REMOVE_OUTPUT=$(s remove -y 2>&1)
111+
REMOVE_OUTPUT=$(s remove -t s-pipeline.yaml -y 2>&1)
112112
echo "$REMOVE_OUTPUT" >> "$LOG_FILE"
113113
echo "$REMOVE_OUTPUT"
114114

src/resources/fc/impl/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default class FC_Client {
9999
const { timeout, userAgent } = options || {};
100100
const hostAddrInfo = getCustomEndpoint(options.endpoint);
101101
const { protocol } = hostAddrInfo;
102-
let { endpoint } = hostAddrInfo;
102+
let { host: endpoint } = hostAddrInfo;
103103
let invokeEndpoint = endpoint;
104104

105105
if (_.isEmpty(endpoint)) {

0 commit comments

Comments
 (0)