@fluid-experimental/odsp-end-to-end-tests 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluid-experimental/odsp-end-to-end-tests
2
2
 
3
+ ## 2.11.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.10.0
4
8
 
5
9
  Dependency updates only.
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { OdspClient } from "@fluidframework/odsp-client/internal";
6
- import { createMultiSinkLogger } from "@fluidframework/telemetry-utils/internal";
6
+ import { createChildLogger, createMultiSinkLogger, } from "@fluidframework/telemetry-utils/internal";
7
7
  import { OdspTestTokenProvider } from "./OdspTokenFactory.js";
8
8
  /**
9
9
  * Get set of credential to use from env variable.
@@ -64,6 +64,12 @@ export function createOdspClient(creds, logger, configProvider) {
64
64
  if (clientId === "" || clientId === undefined) {
65
65
  throw new Error("client id is missing");
66
66
  }
67
+ const args = process.argv.slice(2);
68
+ const driverIndex = args.indexOf("--driver");
69
+ const odspEndpointNameIndex = args.indexOf("--odspEndpointName");
70
+ // Get values associated with the flags
71
+ const driverType = driverIndex === -1 ? undefined : args[driverIndex + 1];
72
+ const driverEndpointName = odspEndpointNameIndex === -1 ? undefined : args[odspEndpointNameIndex + 1];
67
73
  const credentials = {
68
74
  clientId,
69
75
  ...creds,
@@ -84,9 +90,18 @@ export function createOdspClient(creds, logger, configProvider) {
84
90
  }
85
91
  return logger ?? testLogger;
86
92
  };
93
+ const createLogger = createChildLogger({
94
+ logger: getLogger(),
95
+ properties: {
96
+ all: {
97
+ driverType,
98
+ driverEndpointName,
99
+ },
100
+ },
101
+ });
87
102
  return new OdspClient({
88
103
  connection: connectionProps,
89
- logger: getLogger(),
104
+ logger: createLogger,
90
105
  configProvider,
91
106
  });
92
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OdspCl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AE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,WAAW,GAAqB;QACrC,QAAQ;QACR,GAAG,KAAK;KACR,CAAC;IAEF,MAAM,eAAe,GAAyB;QAC7C,OAAO;QACP,aAAa,EAAE,IAAI,qBAAqB,CAAC,WAAW,CAAC;QACrD,OAAO;QACP,QAAQ,EAAE,EAAE;KACZ,CAAC;IACF,MAAM,SAAS,GAAG,GAAqC,EAAE;QACxD,MAAM,UAAU,GAAG,aAAa,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;YAC1B,OAAO,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,IAAI,UAAU,CAAC;IAC7B,CAAC,CAAC;IACF,OAAO,IAAI,UAAU,CAAC;QACrB,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,SAAS,EAAE;QACnB,cAAc;KACd,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIConfigProviderBase,\n\ttype ITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { OdspClient, OdspConnectionConfig } from \"@fluidframework/odsp-client/internal\";\nimport { MockLogger, createMultiSinkLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { OdspTestTokenProvider } from \"./OdspTokenFactory.js\";\n\n/**\n * Interface representing the range of login credentials for a tenant.\n */\ninterface LoginTenantRange {\n\tprefix: string;\n\tstart: number;\n\tcount: number;\n\tpassword: string;\n}\n\n/**\n * Interface representing a collection of tenants with their respective login ranges.\n * @example\n * ```string\n * {\"tenantName\":{\"range\":{\"prefix\":\"prefixName\",\"password\":\"XYZ\",\"start\":0,\"count\":2}}}\n * ```\n */\nexport interface LoginTenants {\n\t[tenant: string]: {\n\t\trange: LoginTenantRange;\n\t};\n}\n\n/**\n * Interface representing the odsp-client login account credentials.\n */\nexport interface IOdspLoginCredentials {\n\temail: string;\n\tpassword: string;\n}\n\n/**\n * Interface representing extended credentials for odsp-client, including AAD information.\n * Extends the basic login credentials with client ID and client secret.\n */\nexport interface IOdspCredentials extends IOdspLoginCredentials {\n\tclientId: string;\n}\n\n/**\n * Get set of credential to use from env variable.\n */\nexport function getCredentials(): IOdspLoginCredentials[] {\n\tconst creds: IOdspLoginCredentials[] = [];\n\tconst loginTenants = process.env.login__odspclient__spe__test__tenants as string;\n\n\tif (loginTenants === \"\" || loginTenants === undefined) {\n\t\tthrow new Error(\"Login tenant is missing\");\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\tconst tenants: LoginTenants = JSON.parse(loginTenants);\n\tconst tenantKey = Object.keys(tenants);\n\tconst tenantName = tenantKey[0];\n\tif (tenantName === undefined) {\n\t\tthrow new Error(\"Tenant is undefined\");\n\t}\n\tconst tenantInfo = tenants[tenantName];\n\n\tif (tenantInfo === undefined) {\n\t\tthrow new Error(\"Tenant info is undefined\");\n\t}\n\n\tconst range = tenantInfo.range;\n\n\tif (range === undefined) {\n\t\tthrow new Error(\"range is undefined\");\n\t}\n\n\tfor (let i = 0; i < range.count; i++) {\n\t\tcreds.push({\n\t\t\temail: `${range.prefix}${range.start + i}@${tenantName}`,\n\t\t\tpassword: range.password,\n\t\t});\n\t}\n\n\tconst [client1Creds, client2Creds] = creds;\n\n\tif (client1Creds === undefined || client2Creds === undefined || creds.length < 2) {\n\t\tthrow new Error(\"Insufficient number of login credentials\");\n\t}\n\n\tif (\n\t\tclient1Creds.email === undefined ||\n\t\tclient1Creds.password === undefined ||\n\t\tclient2Creds.email === undefined ||\n\t\tclient2Creds.password === undefined\n\t) {\n\t\tthrow new Error(\"Email or password is missing for login account\");\n\t}\n\n\treturn creds;\n}\n\n/**\n * This function will determine if local or remote mode is required (based on FLUID_CLIENT), and return a new\n * {@link OdspClient} instance based on the mode by setting the Connection config accordingly.\n */\nexport function createOdspClient(\n\tcreds: IOdspLoginCredentials,\n\tlogger?: MockLogger,\n\tconfigProvider?: IConfigProviderBase,\n): OdspClient {\n\tconst siteUrl = process.env.odsp__client__siteUrl as string;\n\tconst driveId = process.env.odsp__client__driveId as string;\n\tconst clientId = process.env.odsp__client__clientId as string;\n\tif (siteUrl === \"\" || siteUrl === undefined) {\n\t\tthrow new Error(\"site url is missing\");\n\t}\n\tif (driveId === \"\" || driveId === undefined) {\n\t\tthrow new Error(\"SharePoint Embedded container id is missing\");\n\t}\n\n\tif (clientId === \"\" || clientId === undefined) {\n\t\tthrow new Error(\"client id is missing\");\n\t}\n\n\tconst credentials: IOdspCredentials = {\n\t\tclientId,\n\t\t...creds,\n\t};\n\n\tconst connectionProps: OdspConnectionConfig = {\n\t\tsiteUrl,\n\t\ttokenProvider: new OdspTestTokenProvider(credentials),\n\t\tdriveId,\n\t\tfilePath: \"\",\n\t};\n\tconst getLogger = (): ITelemetryBaseLogger | undefined => {\n\t\tconst testLogger = getTestLogger?.();\n\t\tif (!logger && !testLogger) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (logger && testLogger) {\n\t\t\treturn createMultiSinkLogger({ loggers: [logger, testLogger] });\n\t\t}\n\t\treturn logger ?? testLogger;\n\t};\n\treturn new OdspClient({\n\t\tconnection: connectionProps,\n\t\tlogger: getLogger(),\n\t\tconfigProvider,\n\t});\n}\n"]}
1
+ {"version":3,"file":"OdspClientFactory.js","sourceRoot":"","sources":["../../src/test/OdspClientFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,UAAU,EAAwB,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAEN,iBAAiB,EACjB,qBAAqB,GAC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AU,EAAE,eAAe;QAC3B,MAAM,EAAE,YAAY;QACpB,cAAc;KACd,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIConfigProviderBase,\n\ttype ITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { OdspClient, OdspConnectionConfig } from \"@fluidframework/odsp-client/internal\";\nimport {\n\tMockLogger,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { OdspTestTokenProvider } from \"./OdspTokenFactory.js\";\n\n/**\n * Interface representing the range of login credentials for a tenant.\n */\ninterface LoginTenantRange {\n\tprefix: string;\n\tstart: number;\n\tcount: number;\n\tpassword: string;\n}\n\n/**\n * Interface representing a collection of tenants with their respective login ranges.\n * @example\n * ```string\n * {\"tenantName\":{\"range\":{\"prefix\":\"prefixName\",\"password\":\"XYZ\",\"start\":0,\"count\":2}}}\n * ```\n */\nexport interface LoginTenants {\n\t[tenant: string]: {\n\t\trange: LoginTenantRange;\n\t};\n}\n\n/**\n * Interface representing the odsp-client login account credentials.\n */\nexport interface IOdspLoginCredentials {\n\temail: string;\n\tpassword: string;\n}\n\n/**\n * Interface representing extended credentials for odsp-client, including AAD information.\n * Extends the basic login credentials with client ID and client secret.\n */\nexport interface IOdspCredentials extends IOdspLoginCredentials {\n\tclientId: string;\n}\n\n/**\n * Get set of credential to use from env variable.\n */\nexport function getCredentials(): IOdspLoginCredentials[] {\n\tconst creds: IOdspLoginCredentials[] = [];\n\tconst loginTenants = process.env.login__odspclient__spe__test__tenants as string;\n\n\tif (loginTenants === \"\" || loginTenants === undefined) {\n\t\tthrow new Error(\"Login tenant is missing\");\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\tconst tenants: LoginTenants = JSON.parse(loginTenants);\n\tconst tenantKey = Object.keys(tenants);\n\tconst tenantName = tenantKey[0];\n\tif (tenantName === undefined) {\n\t\tthrow new Error(\"Tenant is undefined\");\n\t}\n\tconst tenantInfo = tenants[tenantName];\n\n\tif (tenantInfo === undefined) {\n\t\tthrow new Error(\"Tenant info is undefined\");\n\t}\n\n\tconst range = tenantInfo.range;\n\n\tif (range === undefined) {\n\t\tthrow new Error(\"range is undefined\");\n\t}\n\n\tfor (let i = 0; i < range.count; i++) {\n\t\tcreds.push({\n\t\t\temail: `${range.prefix}${range.start + i}@${tenantName}`,\n\t\t\tpassword: range.password,\n\t\t});\n\t}\n\n\tconst [client1Creds, client2Creds] = creds;\n\n\tif (client1Creds === undefined || client2Creds === undefined || creds.length < 2) {\n\t\tthrow new Error(\"Insufficient number of login credentials\");\n\t}\n\n\tif (\n\t\tclient1Creds.email === undefined ||\n\t\tclient1Creds.password === undefined ||\n\t\tclient2Creds.email === undefined ||\n\t\tclient2Creds.password === undefined\n\t) {\n\t\tthrow new Error(\"Email or password is missing for login account\");\n\t}\n\n\treturn creds;\n}\n\n/**\n * This function will determine if local or remote mode is required (based on FLUID_CLIENT), and return a new\n * {@link OdspClient} instance based on the mode by setting the Connection config accordingly.\n */\nexport function createOdspClient(\n\tcreds: IOdspLoginCredentials,\n\tlogger?: MockLogger,\n\tconfigProvider?: IConfigProviderBase,\n): OdspClient {\n\tconst siteUrl = process.env.odsp__client__siteUrl as string;\n\tconst driveId = process.env.odsp__client__driveId as string;\n\tconst clientId = process.env.odsp__client__clientId as string;\n\tif (siteUrl === \"\" || siteUrl === undefined) {\n\t\tthrow new Error(\"site url is missing\");\n\t}\n\tif (driveId === \"\" || driveId === undefined) {\n\t\tthrow new Error(\"SharePoint Embedded container id is missing\");\n\t}\n\n\tif (clientId === \"\" || clientId === undefined) {\n\t\tthrow new Error(\"client id is missing\");\n\t}\n\n\tconst args = process.argv.slice(2);\n\n\tconst driverIndex = args.indexOf(\"--driver\");\n\tconst odspEndpointNameIndex = args.indexOf(\"--odspEndpointName\");\n\n\t// Get values associated with the flags\n\tconst driverType = driverIndex === -1 ? undefined : args[driverIndex + 1];\n\tconst driverEndpointName =\n\t\todspEndpointNameIndex === -1 ? undefined : args[odspEndpointNameIndex + 1];\n\n\tconst credentials: IOdspCredentials = {\n\t\tclientId,\n\t\t...creds,\n\t};\n\n\tconst connectionProps: OdspConnectionConfig = {\n\t\tsiteUrl,\n\t\ttokenProvider: new OdspTestTokenProvider(credentials),\n\t\tdriveId,\n\t\tfilePath: \"\",\n\t};\n\n\tconst getLogger = (): ITelemetryBaseLogger | undefined => {\n\t\tconst testLogger = getTestLogger?.();\n\t\tif (!logger && !testLogger) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (logger && testLogger) {\n\t\t\treturn createMultiSinkLogger({ loggers: [logger, testLogger] });\n\t\t}\n\t\treturn logger ?? testLogger;\n\t};\n\n\tconst createLogger = createChildLogger({\n\t\tlogger: getLogger(),\n\t\tproperties: {\n\t\t\tall: {\n\t\t\t\tdriverType,\n\t\t\t\tdriverEndpointName,\n\t\t\t},\n\t\t},\n\t});\n\n\treturn new OdspClient({\n\t\tconnection: connectionProps,\n\t\tlogger: createLogger,\n\t\tconfigProvider,\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/odsp-end-to-end-tests",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Odsp client end to end tests",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -33,21 +33,22 @@
33
33
  "temp-directory": "nyc/.nyc_output"
34
34
  },
35
35
  "dependencies": {
36
- "@fluid-internal/mocha-test-setup": "~2.10.0",
37
- "@fluidframework/aqueduct": "~2.10.0",
38
- "@fluidframework/container-definitions": "~2.10.0",
39
- "@fluidframework/container-loader": "~2.10.0",
40
- "@fluidframework/core-interfaces": "~2.10.0",
41
- "@fluidframework/counter": "~2.10.0",
42
- "@fluidframework/fluid-static": "~2.10.0",
43
- "@fluidframework/map": "~2.10.0",
44
- "@fluidframework/matrix": "~2.10.0",
45
- "@fluidframework/odsp-client": "~2.10.0",
46
- "@fluidframework/odsp-doclib-utils": "~2.10.0",
47
- "@fluidframework/odsp-driver-definitions": "~2.10.0",
48
- "@fluidframework/sequence": "~2.10.0",
49
- "@fluidframework/telemetry-utils": "~2.10.0",
50
- "@fluidframework/test-utils": "~2.10.0",
36
+ "@fluid-internal/mocha-test-setup": "~2.11.0",
37
+ "@fluid-private/test-version-utils": "~2.11.0",
38
+ "@fluidframework/aqueduct": "~2.11.0",
39
+ "@fluidframework/container-definitions": "~2.11.0",
40
+ "@fluidframework/container-loader": "~2.11.0",
41
+ "@fluidframework/core-interfaces": "~2.11.0",
42
+ "@fluidframework/counter": "~2.11.0",
43
+ "@fluidframework/fluid-static": "~2.11.0",
44
+ "@fluidframework/map": "~2.11.0",
45
+ "@fluidframework/matrix": "~2.11.0",
46
+ "@fluidframework/odsp-client": "~2.11.0",
47
+ "@fluidframework/odsp-doclib-utils": "~2.11.0",
48
+ "@fluidframework/odsp-driver-definitions": "~2.11.0",
49
+ "@fluidframework/sequence": "~2.11.0",
50
+ "@fluidframework/telemetry-utils": "~2.11.0",
51
+ "@fluidframework/test-utils": "~2.11.0",
51
52
  "@types/sinon": "^17.0.3",
52
53
  "mocha": "^10.2.0",
53
54
  "mocha-multi-reporters": "^1.5.1",
@@ -59,7 +60,7 @@
59
60
  "@biomejs/biome": "~1.9.3",
60
61
  "@fluidframework/build-common": "^2.0.3",
61
62
  "@fluidframework/build-tools": "^0.51.0",
62
- "@fluidframework/eslint-config-fluid": "^5.4.0",
63
+ "@fluidframework/eslint-config-fluid": "^5.6.0",
63
64
  "@types/mocha": "^9.1.1",
64
65
  "@types/nock": "^9.3.0",
65
66
  "@types/node": "^18.19.0",
@@ -103,8 +104,8 @@
103
104
  "lint:fix": "fluid-build . --task eslint:fix --task format",
104
105
  "test": "npm run test:realsvc:odsp:run",
105
106
  "test:coverage": "c8 npm test",
106
- "test:realsvc:odsp": "cross-env npm run test:realsvc:odsp:run",
107
- "test:realsvc:odsp:run": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit --timeout 20000",
107
+ "test:realsvc:odsp": "cross-env npm run test:realsvc:odsp:run -- --driver=odsp --odspEndpointName=odsp",
108
+ "test:realsvc:odsp:run": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit --timeout 20000 --config src/test/.mocharc.cjs",
108
109
  "test:realsvc:run": "mocha --recursive \"lib/test/**/*.spec.*js\"",
109
110
  "test:realsvc:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:realsvc"
110
111
  }
@@ -5,8 +5,8 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
9
-
10
- const packageDir = __dirname;
8
+ const packageDir = `${__dirname}/../..`;
9
+ const getFluidTestMochaConfig = require("@fluid-private/test-version-utils/mocharc-common");
11
10
  const config = getFluidTestMochaConfig(packageDir);
11
+
12
12
  module.exports = config;
@@ -8,7 +8,11 @@ import {
8
8
  type ITelemetryBaseLogger,
9
9
  } from "@fluidframework/core-interfaces";
10
10
  import { OdspClient, OdspConnectionConfig } from "@fluidframework/odsp-client/internal";
11
- import { MockLogger, createMultiSinkLogger } from "@fluidframework/telemetry-utils/internal";
11
+ import {
12
+ MockLogger,
13
+ createChildLogger,
14
+ createMultiSinkLogger,
15
+ } from "@fluidframework/telemetry-utils/internal";
12
16
 
13
17
  import { OdspTestTokenProvider } from "./OdspTokenFactory.js";
14
18
 
@@ -128,6 +132,16 @@ export function createOdspClient(
128
132
  throw new Error("client id is missing");
129
133
  }
130
134
 
135
+ const args = process.argv.slice(2);
136
+
137
+ const driverIndex = args.indexOf("--driver");
138
+ const odspEndpointNameIndex = args.indexOf("--odspEndpointName");
139
+
140
+ // Get values associated with the flags
141
+ const driverType = driverIndex === -1 ? undefined : args[driverIndex + 1];
142
+ const driverEndpointName =
143
+ odspEndpointNameIndex === -1 ? undefined : args[odspEndpointNameIndex + 1];
144
+
131
145
  const credentials: IOdspCredentials = {
132
146
  clientId,
133
147
  ...creds,
@@ -139,6 +153,7 @@ export function createOdspClient(
139
153
  driveId,
140
154
  filePath: "",
141
155
  };
156
+
142
157
  const getLogger = (): ITelemetryBaseLogger | undefined => {
143
158
  const testLogger = getTestLogger?.();
144
159
  if (!logger && !testLogger) {
@@ -149,9 +164,20 @@ export function createOdspClient(
149
164
  }
150
165
  return logger ?? testLogger;
151
166
  };
167
+
168
+ const createLogger = createChildLogger({
169
+ logger: getLogger(),
170
+ properties: {
171
+ all: {
172
+ driverType,
173
+ driverEndpointName,
174
+ },
175
+ },
176
+ });
177
+
152
178
  return new OdspClient({
153
179
  connection: connectionProps,
154
- logger: getLogger(),
180
+ logger: createLogger,
155
181
  configProvider,
156
182
  });
157
183
  }