Wire connection string login E2E tests to dedicated connstring accounts in CI

Add TestAuthType and fold connection-string account resolution into getAccountName; seed and target the dedicated *-connstring accounts in CI while falling back to the standard per-API account locally.
This commit is contained in:
Asier Isayas
2026-08-13 15:02:42 -04:00
parent 1ec46eade8
commit d92248024a
4 changed files with 87 additions and 43 deletions
+3 -10
View File
@@ -6,6 +6,7 @@ import {
DataExplorer,
ONE_MINUTE_MS,
TestAccount,
TestAuthType,
generateUniqueName,
getAccountName,
getAzureCLICredentials,
@@ -13,8 +14,6 @@ import {
subscriptionId,
} from "../fx";
const tableAccountRbacToken = process.env.TABLE_TESTACCOUNT_TOKEN ?? "";
// Tables API accounts store tables in a fixed "TablesDB" database, with each table as a container.
const databaseId = "TablesDB";
const tableId = generateUniqueName("table");
@@ -25,12 +24,9 @@ test.describe("Tables account using connection string login", () => {
let container: Container = null!;
test.beforeAll("Seed Test Table", async () => {
if (tableAccountRbacToken.length > 0) {
return;
}
const credentials = getAzureCLICredentials();
const armClient = new CosmosDBManagementClient(credentials, subscriptionId);
const accountName = getAccountName(TestAccount.Tables);
const accountName = getAccountName(TestAccount.Tables, TestAuthType.ConnectionString);
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
const keys = await armClient.databaseAccounts.listKeys(resourceGroupName, accountName);
@@ -52,12 +48,9 @@ test.describe("Tables account using connection string login", () => {
});
test("reads an entity after connection string login", async ({ page }) => {
// Connection string (account key) login is not supported when local auth is disabled for data plane RBAC.
test.skip(tableAccountRbacToken.length > 0);
const credentials = getAzureCLICredentials();
const armClient = new CosmosDBManagementClient(credentials, subscriptionId);
const accountName = getAccountName(TestAccount.Tables);
const accountName = getAccountName(TestAccount.Tables, TestAuthType.ConnectionString);
const { connectionStrings = [] } = await armClient.databaseAccounts.listConnectionStrings(
resourceGroupName,
accountName,