Skip to content

Commit ea6fff6

Browse files
authored
{Containerapp} Fix integration test (Azure#8395)
1 parent ff3cc7b commit ea6fff6

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,17 +1292,33 @@ def test_containerapp_managed_service_binding_e2e(self, resource_group):
12921292
mysqlserver = "mysqlflexsb"
12931293
postgresqlserver = "postgresqlflexsb"
12941294
postgresqldb = 'flexibleserverdb'
1295-
1296-
mysqlflex_json= self.cmd('mysql flexible-server create --resource-group {} --name {} --public-access {} -y'.format(resource_group, mysqlserver, "None"), expect_failure=False).output
1297-
postgresqlflex_json= self.cmd('postgres flexible-server create --resource-group {} --name {} --public-access {} -d {} -y'.format(resource_group, postgresqlserver, "None", postgresqldb), expect_failure=False).output
1298-
mysqlflex_dict = json.loads(mysqlflex_json)
1295+
mysqlflex_dict = {
1296+
"username": "username",
1297+
"password": "password",
1298+
"databaseName": "databaseName"
1299+
}
1300+
postgresqlflex_dict = {
1301+
"username": "username",
1302+
"password": "password"
1303+
}
1304+
# In this case, we need to create mysql and postgres.
1305+
# Their api-version is updated very frequently and we don't want this recording file fail due to the api-version update
1306+
try:
1307+
mysqlflex_json = self.cmd('mysql flexible-server create --resource-group {} --name {} --public-access {} -y'.format(resource_group, mysqlserver, "None"), expect_failure=False).output
1308+
postgresqlflex_json = self.cmd('postgres flexible-server create --resource-group {} --name {} --public-access {} -d {} -y'.format(resource_group, postgresqlserver, "None", postgresqldb), expect_failure=False).output
1309+
mysqlflex_dict = json.loads(mysqlflex_json)
1310+
postgresqlflex_dict = json.loads(postgresqlflex_json)
1311+
except AssertionError as e:
1312+
if str(e).__contains__("Can't overwrite existing cassette"):
1313+
pass
1314+
else:
1315+
raise e
12991316

13001317
mysqlusername = mysqlflex_dict['username']
13011318
mysqlpassword = mysqlflex_dict['password']
13021319

13031320
mysqldb = mysqlflex_dict['databaseName']
1304-
flex_binding="mysqlflex_binding"
1305-
postgresqlflex_dict = json.loads(postgresqlflex_json)
1321+
flex_binding ="mysqlflex_binding"
13061322
postgresqlusername = postgresqlflex_dict['username']
13071323
postgresqlpassword = postgresqlflex_dict['password']
13081324
create_containerapp_env(self, env_name, resource_group, location=location)

0 commit comments

Comments
 (0)