Skip to content

Commit

Permalink
Add the Discovery Endpoint to Fluid Framework (FF) E2E Tests (#10332)
Browse files Browse the repository at this point in the history
* Add the routing endpoint to e2e test

* Add the discovery endpoint

* Remove extra stages

* Add the new line

* Add the comments
  • Loading branch information
tianzhu007 authored May 22, 2022
1 parent 7d6569a commit e88b3c8
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions packages/test/test-drivers/src/routerliciousTestDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,28 @@ const dockerConfig = (driverPolicies?: IRouterliciousDriverPolicies) => ({
});

function getConfig(
discoveryEndpoint?: string,
fluidHost?: string,
tenantId?: string,
tenantSecret?: string,
driverPolicies?: IRouterliciousDriverPolicies) {
assert(fluidHost, "Missing Fluid host");
assert(tenantId, "Missing tenantId");
assert(tenantSecret, "Missing tenant secret");
if (discoveryEndpoint !== undefined) {
// The hostUrl and deltaStorageUrl will be replaced by the URLs of the discovery result.
// The deltaStorageUrl is firstly set to https://dummy-historian to make the workflow successful.
return {
serviceEndpoint: {
hostUrl: "",
ordererUrl: discoveryEndpoint,
deltaStorageUrl: "https://dummy-historian",
},
tenantId,
tenantSecret,
driverPolicies,
};
}
assert(fluidHost, "Missing Fluid host");
return {
serviceEndpoint: {
hostUrl: fluidHost,
Expand All @@ -51,10 +66,11 @@ function getConfig(
}

function getLegacyConfigFromEnv() {
const discoveryEndpoint = process.env.fluid__webpack__discoveryEndpoint;
const fluidHost = process.env.fluid__webpack__fluidHost;
const tenantSecret = process.env.fluid__webpack__tenantSecret;
const tenantId = process.env.fluid__webpack__tenantId ?? "fluid";
return getConfig(fluidHost, tenantId, tenantSecret);
return getConfig(discoveryEndpoint, fluidHost, tenantId, tenantSecret);
}

function getEndpointConfigFromEnv(r11sEndpointName: RouterliciousEndpoint) {
Expand All @@ -69,7 +85,12 @@ function getEndpointConfigFromEnv(r11sEndpointName: RouterliciousEndpoint) {
}
assert(configStr, `Missing config for ${r11sEndpointName}`);
const config = JSON.parse(configStr);
return getConfig(config.host, config.tenantId, config.tenantSecret, config.driverPolicies);
return getConfig(
config.discoveryEndpoint,
config.host,
config.tenantId,
config.tenantSecret,
config.driverPolicies);
}

function getConfigFromEnv(r11sEndpointName?: RouterliciousEndpoint) {
Expand Down

0 comments on commit e88b3c8

Please sign in to comment.