diff --git a/__tests__/e2e/ci-mac-linux.sh b/__tests__/e2e/ci-mac-linux.sh index 6e0b0f6e..6e1fb9bf 100755 --- a/__tests__/e2e/ci-mac-linux.sh +++ b/__tests__/e2e/ci-mac-linux.sh @@ -81,6 +81,10 @@ s deploy -y -t ./s_tags2.yaml s deploy -y -t ./s_tags3.yaml s remove -y -t ./s_tags3.yaml +echo "test nodejs runtime with custom endpoint ..." +s deploy -y -t ./s_custom_endpoint.yaml +s remove -y -t ./s_custom_endpoint.yaml + echo "test deploy with alias" export fc_component_function_name=nodejs18-$(uname)-$(uname -m)-$RANDSTR s deploy --function -t s2.yaml diff --git a/__tests__/e2e/ci.sh b/__tests__/e2e/ci.sh index 9cb68aec..c47dfabd 100755 --- a/__tests__/e2e/ci.sh +++ b/__tests__/e2e/ci.sh @@ -88,6 +88,11 @@ s deploy -y -t ./s_tags3.yaml s remove -y -t ./s_tags3.yaml cd .. +echo "test nodejs runtime with custom endpoint ..." +s deploy -y -t ./s_custom_endpoint.yaml +s remove -y -t ./s_custom_endpoint.yaml +cd .. + echo "test deploy with alias" cd nodejs export fc_component_function_name=nodejs18-$(uname)-$(uname -m)-$RANDSTR diff --git a/__tests__/e2e/nodejs/s_custom_endpoint.yaml b/__tests__/e2e/nodejs/s_custom_endpoint.yaml new file mode 100644 index 00000000..7a188004 --- /dev/null +++ b/__tests__/e2e/nodejs/s_custom_endpoint.yaml @@ -0,0 +1,19 @@ +edition: 3.0.0 +name: test-node-app +access: quanxi + +vars: + region: ${env('REGION', 'ap-southeast-1')} + +resources: + fcDemo1: # 业务名称/模块名称 + component: ${env('fc_component_version', path('../../../'))} + props: # 组件的属性值 + region: ${vars.region} + functionName: fc3-event-${env('fc_component_function_name', 'nodejs18')}-endpoint + runtime: ${env('fc_component_runtime', 'nodejs18')} + code: ./test-auto-code + handler: index.handler + memorySize: 128 + endpoint: http://${config('AccountID')}.${vars.region}.fc.aliyuncs.com + timeout: 30 \ No newline at end of file diff --git a/example/test_models_pipeline.sh b/example/test_models_pipeline.sh index 2a83f6c5..94732008 100755 --- a/example/test_models_pipeline.sh +++ b/example/test_models_pipeline.sh @@ -76,10 +76,10 @@ for MODEL_INFO in "${MODEL_LIST[@]}"; do if [ -z $SYSTEM_URL ]; then log "Failed to extract system_url for model: $MODEL_ID" # 清理资源 - REMOVE_OUTPUT=$(s model remove -y 2>&1) + REMOVE_OUTPUT=$(s model remove -t s-pipeline.yaml -y 2>&1) echo "$REMOVE_OUTPUT" >> "$LOG_FILE" echo "$REMOVE_OUTPUT" - REMOVE_OUTPUT=$(s remove -y 2>&1) + REMOVE_OUTPUT=$(s remove -t s-pipeline.yaml -y 2>&1) echo "$REMOVE_OUTPUT" >> "$LOG_FILE" echo "$REMOVE_OUTPUT" continue @@ -105,10 +105,10 @@ for MODEL_INFO in "${MODEL_LIST[@]}"; do # 清理资源 log "Removing resources..." - REMOVE_OUTPUT=$(s model remove -y 2>&1) + REMOVE_OUTPUT=$(s model remove -t s-pipeline.yaml -y 2>&1) echo "$REMOVE_OUTPUT" >> "$LOG_FILE" echo "$REMOVE_OUTPUT" - REMOVE_OUTPUT=$(s remove -y 2>&1) + REMOVE_OUTPUT=$(s remove -t s-pipeline.yaml -y 2>&1) echo "$REMOVE_OUTPUT" >> "$LOG_FILE" echo "$REMOVE_OUTPUT" diff --git a/src/resources/fc/impl/client.ts b/src/resources/fc/impl/client.ts index 3048a075..fb6435d8 100644 --- a/src/resources/fc/impl/client.ts +++ b/src/resources/fc/impl/client.ts @@ -99,7 +99,7 @@ export default class FC_Client { const { timeout, userAgent } = options || {}; const hostAddrInfo = getCustomEndpoint(options.endpoint); const { protocol } = hostAddrInfo; - let { endpoint } = hostAddrInfo; + let { host: endpoint } = hostAddrInfo; let invokeEndpoint = endpoint; if (_.isEmpty(endpoint)) {