@@ -164,29 +164,74 @@ public async Task BeanstalkArmDeployment()
164164
165165 // Verify stack exists in list of deployments
166166 var listStdOut = _interactiveService . StdOutReader . ReadAllLines ( ) . Select ( x => x . Split ( ) [ 0 ] ) . ToList ( ) ;
167- Assert . Contains ( listStdOut , ( deployment ) => _stackName . Equals ( deployment ) ) ;
168-
167+ Assert . Contains ( listStdOut , ( deployment ) => _stackName . Equals ( deployment ) ) ;
168+
169169 // Try switching from ARM to X86_64 on redeployment
170170 await _interactiveService . StdInWriter . WriteLineAsync ( "3" ) ; // Select "Environment Architecture"
171- await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "X86_64"
171+ await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "X86_64"
172172 await _interactiveService . StdInWriter . WriteAsync ( Environment . NewLine ) ; // Confirm selection and deploy
173173 await _interactiveService . StdInWriter . WriteLineAsync ( "more" ) ; // Select "Environment Architecture"
174174 await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "EC2 Instance Type"
175175 await _interactiveService . StdInWriter . WriteLineAsync ( "y" ) ; // Select "Free tier"
176176 await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "x86_64"
177177 await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "CPU Cores"
178178 await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "Instance Memory"
179- await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "Instance Type"
179+ await _interactiveService . StdInWriter . WriteLineAsync ( "1" ) ; // Select "Instance Type"
180180 await _interactiveService . StdInWriter . WriteAsync ( Environment . NewLine ) ; // Confirm selection and deploy
181181 await _interactiveService . StdInWriter . FlushAsync ( ) ;
182182
183183 // Perform re-deployment
184184 deployArgs = new [ ] { "deploy" , "--project-path" , projectPath , "--application-name" , _stackName , "--diagnostics" } ;
185185 Assert . Equal ( CommandReturnCodes . SUCCESS , await _app . Run ( deployArgs ) ) ;
186- Assert . Equal ( StackStatus . UPDATE_COMPLETE , await _cloudFormationHelper . GetStackStatus ( _stackName ) ) ;
186+ Assert . Equal ( StackStatus . UPDATE_COMPLETE , await _cloudFormationHelper . GetStackStatus ( _stackName ) ) ;
187187
188188 deployStdOut = _interactiveService . StdOutReader . ReadAllLines ( ) ;
189- Assert . Contains ( deployStdOut , x => x . Contains ( "Please select an Instance Type that supports the currently selected Environment Architecture." ) ) ;
189+ Assert . Contains ( deployStdOut , x => x . Contains ( "Please select an Instance Type that supports the currently selected Environment Architecture." ) ) ;
190+
191+ // Arrange input for delete
192+ // Use --silent flag to delete without user prompts
193+ var deleteArgs = new [ ] { "delete-deployment" , _stackName , "--diagnostics" , "--silent" } ;
194+
195+ // Delete
196+ Assert . Equal ( CommandReturnCodes . SUCCESS , await _app . Run ( deleteArgs ) ) ; ;
197+
198+ // Verify application is deleted
199+ Assert . True ( await _cloudFormationHelper . IsStackDeleted ( _stackName ) , $ "{ _stackName } still exists.") ;
200+ }
201+
202+ [ Fact ]
203+ public async Task DeployRetiredDotnetVersion ( )
204+ {
205+ _stackName = $ "RetiredDotnetBeanstalk{ Guid . NewGuid ( ) . ToString ( ) . Split ( '-' ) . Last ( ) } ";
206+
207+ var projectPath = _testAppManager . GetProjectPath ( Path . Combine ( "testapps" , "WebApiNET6" , "WebApiNET6.csproj" ) ) ;
208+ var deployArgs = new [ ] { "deploy" , "--project-path" , projectPath , "--application-name" , _stackName , "--diagnostics" , "--silent" , "--apply" , "ElasticBeanStalkConfigFile.json" } ;
209+ Assert . Equal ( CommandReturnCodes . SUCCESS , await _app . Run ( deployArgs ) ) ;
210+
211+ // Verify application is deployed and running
212+ Assert . Equal ( StackStatus . CREATE_COMPLETE , await _cloudFormationHelper . GetStackStatus ( _stackName ) ) ;
213+
214+ var deployStdOut = _interactiveService . StdOutReader . ReadAllLines ( ) ;
215+
216+ var tempCdkProjectLine = deployStdOut . First ( line => line . StartsWith ( "Saving AWS CDK deployment project to: " ) ) ;
217+ var tempCdkProject = tempCdkProjectLine . Split ( ": " ) [ 1 ] . Trim ( ) ;
218+ Assert . False ( Directory . Exists ( tempCdkProject ) , $ "{ tempCdkProject } must not exist.") ;
219+
220+ // Example: Endpoint: http://52.36.216.238/
221+ var endpointLine = deployStdOut . First ( line => line . Trim ( ) . StartsWith ( $ "Endpoint") ) ;
222+ var applicationUrl = endpointLine . Substring ( endpointLine . IndexOf ( ":" , StringComparison . Ordinal ) + 1 ) . Trim ( ) ;
223+ Assert . True ( Uri . IsWellFormedUriString ( applicationUrl , UriKind . Absolute ) ) ;
224+
225+ // URL could take few more minutes to come live, therefore, we want to wait and keep trying for a specified timeout
226+ await _httpHelper . WaitUntilSuccessStatusCode ( applicationUrl , TimeSpan . FromSeconds ( 5 ) , TimeSpan . FromMinutes ( 5 ) ) ;
227+
228+ // list
229+ var listArgs = new [ ] { "list-deployments" , "--diagnostics" } ;
230+ Assert . Equal ( CommandReturnCodes . SUCCESS , await _app . Run ( listArgs ) ) ; ;
231+
232+ // Verify stack exists in list of deployments
233+ var listStdOut = _interactiveService . StdOutReader . ReadAllLines ( ) . Select ( x => x . Split ( ) [ 0 ] ) . ToList ( ) ;
234+ Assert . Contains ( listStdOut , ( deployment ) => _stackName . Equals ( deployment ) ) ;
190235
191236 // Arrange input for delete
192237 // Use --silent flag to delete without user prompts
0 commit comments