@@ -7,7 +7,7 @@ describe('Scf - singapore', () => {
77 SecretId : process . env . TENCENT_SECRET_ID ,
88 SecretKey : process . env . TENCENT_SECRET_KEY ,
99 } ;
10- const scf = new Scf ( credentials , 'ap-singapore ' ) ;
10+ const scf = new Scf ( credentials , 'ap-guangzhou ' ) ;
1111
1212 const triggers = {
1313 apigw : {
@@ -41,15 +41,15 @@ describe('Scf - singapore', () => {
4141 // name: `serverless-test-${Date.now()}`,
4242 name : `serverless-test-fixed` ,
4343 code : {
44- bucket : 'test-singapore' ,
45- object : 'express_code .zip' ,
44+ bucket : process . env . BUCKET ,
45+ object : 'express_code_pure .zip' ,
4646 } ,
4747 namespace : 'test' ,
4848 role : 'SCF_QcsRole' ,
4949 handler : 'sl_handler.handler' ,
5050 runtime : 'Nodejs12.16' ,
51- region : 'ap-singapore ' ,
52- description : 'Created by Serverless Framework ' ,
51+ region : 'ap-guangzhou ' ,
52+ description : 'Created by Serverless' ,
5353 memorySize : 256 ,
5454 timeout : 20 ,
5555 tags : {
@@ -61,143 +61,34 @@ describe('Scf - singapore', () => {
6161 } ,
6262 } ,
6363 events,
64+ installDependency : true ,
6465 } ;
6566
6667 let outputs ;
6768
6869 test ( 'should deploy SCF success' , async ( ) => {
6970 await sleep ( 3000 ) ;
7071 outputs = await scf . deploy ( inputs ) ;
71- expect ( outputs ) . toEqual ( {
72- Qualifier : '$LATEST' ,
73- Description : 'Created by Serverless Framework' ,
74- Timeout : inputs . timeout ,
75- InitTimeout : expect . any ( Number ) ,
76- MemorySize : inputs . memorySize ,
77- Runtime : inputs . runtime ,
78- VpcConfig : { VpcId : '' , SubnetId : '' } ,
79- Environment : {
80- Variables : [
81- {
82- Key : 'TEST' ,
83- Value : 'value' ,
84- } ,
85- ] ,
86- } ,
87- Handler : inputs . handler ,
88- AsyncRunEnable : 'FALSE' ,
89- LogType : expect . any ( String ) ,
90- TraceEnable : 'FALSE' ,
91- UseGpu : 'FALSE' ,
92- Role : inputs . role ,
93- CodeSize : 0 ,
94- FunctionVersion : '$LATEST' ,
95- FunctionName : inputs . name ,
96- Namespace : 'test' ,
97- InstallDependency : 'FALSE' ,
98- Status : 'Active' ,
99- AvailableStatus : 'Available' ,
100- StatusDesc : expect . any ( String ) ,
101- FunctionId : expect . stringContaining ( 'lam-' ) ,
102- L5Enable : 'FALSE' ,
103- EipConfig : { EipFixed : 'FALSE' , Eips : expect . any ( Array ) } ,
104- ModTime : expect . any ( String ) ,
105- AddTime : expect . any ( String ) ,
106- Layers : [ ] ,
107- DeadLetterConfig : { Type : '' , Name : '' , FilterType : '' } ,
108- OnsEnable : 'FALSE' ,
109- PublicNetConfig : {
110- PublicNetStatus : 'ENABLE' ,
111- EipConfig : { EipStatus : 'DISABLE' , EipAddress : expect . any ( Array ) } ,
112- } ,
113- Triggers : expect . any ( Array ) ,
114- ClsLogsetId : expect . any ( String ) ,
115- ClsTopicId : expect . any ( String ) ,
116- CodeInfo : '' ,
117- CodeResult : 'success' ,
118- CodeError : '' ,
119- ErrNo : 0 ,
120- Tags : [
121- {
122- Key : 'test' ,
123- Value : 'test' ,
124- } ,
125- ] ,
126- AccessInfo : { Host : '' , Vip : '' } ,
127- Type : 'Event' ,
128- CfsConfig : {
129- CfsInsList : [ ] ,
130- } ,
131- StatusReasons : [ ] ,
132- RequestId : expect . any ( String ) ,
133- } ) ;
72+ expect ( outputs . FunctionName ) . toBe ( inputs . name ) ;
73+ expect ( outputs . Qualifier ) . toBe ( '$LATEST' ) ;
74+ expect ( outputs . Description ) . toBe ( 'Created by Serverless' ) ;
75+ expect ( outputs . Timeout ) . toBe ( inputs . timeout ) ;
76+ expect ( outputs . MemorySize ) . toBe ( inputs . memorySize ) ;
77+ expect ( outputs . Runtime ) . toBe ( inputs . runtime ) ;
78+ expect ( outputs . InstallDependency ) . toBe ( 'TRUE' ) ;
79+ expect ( outputs . Role ) . toBe ( inputs . role ) ;
13480 } ) ;
13581 test ( 'should update SCF success' , async ( ) => {
13682 await sleep ( 3000 ) ;
13783 outputs = await scf . deploy ( inputs ) ;
138- expect ( outputs ) . toEqual ( {
139- Qualifier : '$LATEST' ,
140- Description : 'Created by Serverless Framework' ,
141- Timeout : inputs . timeout ,
142- InitTimeout : expect . any ( Number ) ,
143- MemorySize : inputs . memorySize ,
144- Runtime : inputs . runtime ,
145- VpcConfig : { VpcId : '' , SubnetId : '' } ,
146- Environment : {
147- Variables : [
148- {
149- Key : 'TEST' ,
150- Value : 'value' ,
151- } ,
152- ] ,
153- } ,
154- Handler : inputs . handler ,
155- AsyncRunEnable : 'FALSE' ,
156- LogType : expect . any ( String ) ,
157- TraceEnable : 'FALSE' ,
158- UseGpu : 'FALSE' ,
159- Role : inputs . role ,
160- CodeSize : 0 ,
161- FunctionVersion : '$LATEST' ,
162- FunctionName : inputs . name ,
163- Namespace : 'test' ,
164- InstallDependency : 'FALSE' ,
165- Status : 'Active' ,
166- AvailableStatus : 'Available' ,
167- StatusDesc : expect . any ( String ) ,
168- FunctionId : expect . stringContaining ( 'lam-' ) ,
169- L5Enable : 'FALSE' ,
170- EipConfig : { EipFixed : 'FALSE' , Eips : expect . any ( Array ) } ,
171- ModTime : expect . any ( String ) ,
172- AddTime : expect . any ( String ) ,
173- Layers : [ ] ,
174- DeadLetterConfig : { Type : '' , Name : '' , FilterType : '' } ,
175- OnsEnable : 'FALSE' ,
176- PublicNetConfig : {
177- PublicNetStatus : 'ENABLE' ,
178- EipConfig : { EipStatus : 'DISABLE' , EipAddress : expect . any ( Array ) } ,
179- } ,
180- Triggers : expect . any ( Array ) ,
181- ClsLogsetId : expect . any ( String ) ,
182- ClsTopicId : expect . any ( String ) ,
183- CodeInfo : '' ,
184- CodeResult : 'success' ,
185- CodeError : '' ,
186- ErrNo : 0 ,
187- Tags : [
188- {
189- Key : 'test' ,
190- Value : 'test' ,
191- } ,
192- ] ,
193- AccessInfo : { Host : '' , Vip : '' } ,
194- Type : 'Event' ,
195- CfsConfig : {
196- CfsInsList : [ ] ,
197- } ,
198- StatusReasons : [ ] ,
199- RequestId : expect . any ( String ) ,
200- } ) ;
84+ expect ( outputs . FunctionName ) . toBe ( inputs . name ) ;
85+ expect ( outputs . Qualifier ) . toBe ( '$LATEST' ) ;
86+ expect ( outputs . Description ) . toBe ( 'Created by Serverless' ) ;
87+ expect ( outputs . Timeout ) . toBe ( inputs . timeout ) ;
88+ expect ( outputs . MemorySize ) . toBe ( inputs . memorySize ) ;
89+ expect ( outputs . Runtime ) . toBe ( inputs . runtime ) ;
90+ expect ( outputs . InstallDependency ) . toBe ( 'TRUE' ) ;
91+ expect ( outputs . Role ) . toBe ( inputs . role ) ;
20192 } ) ;
20293 test ( 'should remove Scf success' , async ( ) => {
20394 const res = await scf . remove ( {
0 commit comments