mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 17:12:47 +01:00
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:
@@ -7,6 +7,7 @@ import {
|
||||
Editor,
|
||||
ONE_MINUTE_MS,
|
||||
TestAccount,
|
||||
TestAuthType,
|
||||
generateUniqueName,
|
||||
getAccountName,
|
||||
getAzureCLICredentials,
|
||||
@@ -14,7 +15,6 @@ import {
|
||||
subscriptionId,
|
||||
} from "../fx";
|
||||
|
||||
const gremlinAccountRbacToken = process.env.GREMLIN_TESTACCOUNT_TOKEN ?? "";
|
||||
const databaseId = generateUniqueName("db");
|
||||
const graphId = "testgraph";
|
||||
const vertexId = "testvertex";
|
||||
@@ -23,12 +23,9 @@ test.describe("Gremlin account using connection string login", () => {
|
||||
let database: Database = null!;
|
||||
|
||||
test.beforeAll("Seed Test Database", async () => {
|
||||
if (gremlinAccountRbacToken.length > 0) {
|
||||
return;
|
||||
}
|
||||
const credentials = getAzureCLICredentials();
|
||||
const armClient = new CosmosDBManagementClient(credentials, subscriptionId);
|
||||
const accountName = getAccountName(TestAccount.Gremlin);
|
||||
const accountName = getAccountName(TestAccount.Gremlin, TestAuthType.ConnectionString);
|
||||
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
|
||||
const keys = await armClient.databaseAccounts.listKeys(resourceGroupName, accountName);
|
||||
|
||||
@@ -47,12 +44,9 @@ test.describe("Gremlin account using connection string login", () => {
|
||||
});
|
||||
|
||||
test("reads a vertex 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(gremlinAccountRbacToken.length > 0);
|
||||
|
||||
const credentials = getAzureCLICredentials();
|
||||
const armClient = new CosmosDBManagementClient(credentials, subscriptionId);
|
||||
const accountName = getAccountName(TestAccount.Gremlin);
|
||||
const accountName = getAccountName(TestAccount.Gremlin, TestAuthType.ConnectionString);
|
||||
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
|
||||
const keys = await armClient.databaseAccounts.listKeys(resourceGroupName, accountName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user