Make playwright test environment more dynamic (#2532)

* Update Az CLI to use new secrets.

* Add test step for Az login

* Remove test step. Fix up account names in test code.

* Fix the account prefix env. variable.

* Fix it in the CI config as well.

* Try to fix the CI config for some tests

* Clean up access tokens for NoSQL.

* Disable most tests while sorting out account setup. Add debug tracing.

* Comment out most tests.

* Set RG Name var in CI config.

* Fix up tenant id.

* Enable other API tests

* e-enable more tests.

* Re-enable remaining tests.

* Remove all of the test.skip() calls.

* Remove debug traces.

* Remove function to retrieve SQL RBAC token, this is handled by the CI config now.

* Fix rbac token detection for table and resource token tests.

* Minor cleanup and fixing the cleanup config.

* Preview site and storage changes. Cleanup script changes.

* Clean up before PR.

* Fix resource group name in test results email.
This commit is contained in:
jawelton74
2026-07-20 08:00:29 -07:00
committed by GitHub
parent cdc5569a34
commit e3b77ec1f2
10 changed files with 74 additions and 205 deletions
+4 -3
View File
@@ -3,7 +3,6 @@ import "../../less/hostedexplorer.less";
import { DataExplorerInputsFrame } from "../../src/Contracts/ViewModels";
import { updateUserContext } from "../../src/UserContext";
import { get, listKeys } from "../../src/Utils/arm/generatedClients/cosmos/databaseAccounts";
import { getNoSqlRbacToken } from "../NoSqlTestSetup";
const urlSearchParams = new URLSearchParams(window.location.search);
const resourceGroup = urlSearchParams.get("resourceGroup") || process.env.RESOURCE_GROUP || "";
@@ -16,7 +15,7 @@ const enablecontainercopy = urlSearchParams.get("enablecontainercopy");
const nosqlRbacToken =
urlSearchParams.get("nosqlRbacToken") ||
(enablecontainercopy ? process.env.NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN : getNoSqlRbacToken()) ||
(enablecontainercopy ? process.env.NOSQL_CONTAINERCOPY_TESTACCOUNT_TOKEN : process.env.NOSQL_TESTACCOUNT_TOKEN) ||
"";
const nosqlReadOnlyRbacToken =
@@ -30,6 +29,7 @@ const mongoRbacToken = urlSearchParams.get("mongoRbacToken") || process.env.MONG
const mongo32RbacToken = urlSearchParams.get("mongo32RbacToken") || process.env.MONGO32_TESTACCOUNT_TOKEN || "";
const mongoReadOnlyRbacToken =
urlSearchParams.get("mongoReadOnlyRbacToken") || process.env.MONGO_READONLY_TESTACCOUNT_TOKEN || "";
const tenantId = urlSearchParams.get("tenantId") || process.env.AZURE_TENANT_ID || "";
const initTestExplorer = async (): Promise<void> => {
updateUserContext({
@@ -51,7 +51,7 @@ const initTestExplorer = async (): Promise<void> => {
case "gremlin":
rbacToken = gremlinRbacToken;
break;
case "tables":
case "table":
rbacToken = tableRbacToken;
break;
case "cassandra":
@@ -90,6 +90,7 @@ const initTestExplorer = async (): Promise<void> => {
resourceGroup,
authorizationToken: `Bearer ${authToken}`,
aadToken: rbacToken,
tenantId,
features: {},
containerCopyEnabled: enablecontainercopy === "true",
hasWriteAccess: true,