@fluidframework/azure-end-to-end-tests 2.101.1 → 2.103.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/eslint.config.mts +4 -0
  3. package/lib/packageVersion.js +9 -0
  4. package/lib/packageVersion.js.map +1 -0
  5. package/lib/test/AzureClientFactory.js.map +1 -1
  6. package/lib/test/audience.spec.js +16 -16
  7. package/lib/test/audience.spec.js.map +1 -1
  8. package/lib/test/containerCreate.spec.js +27 -24
  9. package/lib/test/containerCreate.spec.js.map +1 -1
  10. package/lib/test/ddsTests.spec.js +17 -17
  11. package/lib/test/ddsTests.spec.js.map +1 -1
  12. package/lib/test/multiprocess/childClient.tool.js +3 -2
  13. package/lib/test/multiprocess/childClient.tool.js.map +1 -1
  14. package/lib/test/signals.spec.js +4 -4
  15. package/lib/test/signals.spec.js.map +1 -1
  16. package/lib/test/tree.spec.js +8 -8
  17. package/lib/test/tree.spec.js.map +1 -1
  18. package/lib/test/utils.js +3 -0
  19. package/lib/test/utils.js.map +1 -1
  20. package/lib/test/viewContainerVersion.spec.js +9 -9
  21. package/lib/test/viewContainerVersion.spec.js.map +1 -1
  22. package/package.json +29 -27
  23. package/src/packageVersion.ts +9 -0
  24. package/src/test/.mocharc.js +15 -0
  25. package/src/test/AzureClientFactory.ts +4 -3
  26. package/src/test/audience.spec.ts +36 -16
  27. package/src/test/containerCreate.spec.ts +31 -24
  28. package/src/test/ddsTests.spec.ts +29 -17
  29. package/src/test/multiprocess/childClient.tool.ts +7 -2
  30. package/src/test/signals.spec.ts +12 -4
  31. package/src/test/tree.spec.ts +8 -8
  32. package/src/test/tsconfig.json +6 -3
  33. package/src/test/utils.ts +4 -0
  34. package/src/test/viewContainerVersion.spec.ts +9 -9
  35. package/src/test/.mocharc.cjs +0 -11
@@ -19,7 +19,7 @@ import {
19
19
  } from "./AzureClientFactory.js";
20
20
  import { CounterTestDataObject, TestDataObject } from "./TestDataObject.js";
21
21
  import * as ephemeralSummaryTrees from "./ephemeralSummaryTrees.js";
22
- import { getTestMatrix, mapWait } from "./utils.js";
22
+ import { getTestMatrix, mapWait, currentVersion } from "./utils.js";
23
23
 
24
24
  const testMatrix = getTestMatrix();
25
25
  for (const testOpts of testMatrix) {
@@ -54,9 +54,13 @@ for (const testOpts of testMatrix) {
54
54
  "test-user-name-1",
55
55
  );
56
56
  containerId = getContainerIdFromPayloadResponse(containerResponse);
57
- ({ container: newContainer } = await client.getContainer(containerId, schema, "2"));
57
+ ({ container: newContainer } = await client.getContainer(
58
+ containerId,
59
+ schema,
60
+ currentVersion,
61
+ ));
58
62
  } else {
59
- ({ container: newContainer } = await client.createContainer(schema, "2"));
63
+ ({ container: newContainer } = await client.createContainer(schema, currentVersion));
60
64
  containerId = await newContainer.attach();
61
65
  }
62
66
 
@@ -67,7 +71,7 @@ for (const testOpts of testMatrix) {
67
71
  });
68
72
  }
69
73
 
70
- const resources = client.getContainer(containerId, schema, "2");
74
+ const resources = client.getContainer(containerId, schema, currentVersion);
71
75
  await assert.doesNotReject(
72
76
  resources,
73
77
  () => true,
@@ -97,9 +101,9 @@ for (const testOpts of testMatrix) {
97
101
  "test-user-name-1",
98
102
  );
99
103
  containerId = getContainerIdFromPayloadResponse(containerResponse);
100
- ({ container } = await client.getContainer(containerId, schema, "2"));
104
+ ({ container } = await client.getContainer(containerId, schema, currentVersion));
101
105
  } else {
102
- ({ container } = await client.createContainer(schema, "2"));
106
+ ({ container } = await client.createContainer(schema, currentVersion));
103
107
  containerId = await container.attach();
104
108
  }
105
109
 
@@ -115,7 +119,11 @@ for (const testOpts of testMatrix) {
115
119
  map1Create.set("new-key", "new-value");
116
120
  const valueCreate: string | undefined = map1Create.get("new-key");
117
121
 
118
- const { container: containerGet } = await client.getContainer(containerId, schema, "2");
122
+ const { container: containerGet } = await client.getContainer(
123
+ containerId,
124
+ schema,
125
+ currentVersion,
126
+ );
119
127
  const map1Get = containerGet.initialObjects.map1;
120
128
  const valueGet: string | undefined = await mapWait(map1Get, "new-key");
121
129
  assert.strictEqual(valueGet, valueCreate, "container can't change initial objects");
@@ -142,9 +150,9 @@ for (const testOpts of testMatrix) {
142
150
  "test-user-name-1",
143
151
  );
144
152
  containerId = getContainerIdFromPayloadResponse(containerResponse);
145
- ({ container } = await client.getContainer(containerId, doSchema, "2"));
153
+ ({ container } = await client.getContainer(containerId, doSchema, currentVersion));
146
154
  } else {
147
- ({ container } = await client.createContainer(doSchema, "2"));
155
+ ({ container } = await client.createContainer(doSchema, currentVersion));
148
156
  containerId = await container.attach();
149
157
  }
150
158
 
@@ -168,7 +176,7 @@ for (const testOpts of testMatrix) {
168
176
  const { container: containerGet } = await client.getContainer(
169
177
  containerId,
170
178
  doSchema,
171
- "2",
179
+ currentVersion,
172
180
  );
173
181
  const initialObjectsGet = containerGet.initialObjects;
174
182
  assert(
@@ -205,9 +213,9 @@ for (const testOpts of testMatrix) {
205
213
  "test-user-name-1",
206
214
  );
207
215
  containerId = getContainerIdFromPayloadResponse(containerResponse);
208
- ({ container } = await client.getContainer(containerId, doSchema, "2"));
216
+ ({ container } = await client.getContainer(containerId, doSchema, currentVersion));
209
217
  } else {
210
- ({ container } = await client.createContainer(doSchema, "2"));
218
+ ({ container } = await client.createContainer(doSchema, currentVersion));
211
219
  containerId = await container.attach();
212
220
  }
213
221
 
@@ -235,7 +243,7 @@ for (const testOpts of testMatrix) {
235
243
  const { container: containerGet } = await client.getContainer(
236
244
  containerId,
237
245
  doSchema,
238
- "2",
246
+ currentVersion,
239
247
  );
240
248
  const initialObjectsGet = containerGet.initialObjects;
241
249
  assert(
@@ -274,7 +282,7 @@ for (const testOpts of testMatrix) {
274
282
  );
275
283
  containerId = getContainerIdFromPayloadResponse(containerResponse);
276
284
  } else {
277
- ({ container } = await client.createContainer(doSchema, "2"));
285
+ ({ container } = await client.createContainer(doSchema, currentVersion));
278
286
 
279
287
  const initialObjectsCreate = container.initialObjects;
280
288
  const mdo2 = initialObjectsCreate.mdo2 as CounterTestDataObject;
@@ -297,7 +305,7 @@ for (const testOpts of testMatrix) {
297
305
  const { container: containerGet } = await client.getContainer(
298
306
  containerId,
299
307
  doSchema,
300
- "2",
308
+ currentVersion,
301
309
  );
302
310
  const initialObjectsGet = containerGet.initialObjects;
303
311
  const mdo2get = initialObjectsGet.mdo2 as CounterTestDataObject;
@@ -333,9 +341,13 @@ for (const testOpts of testMatrix) {
333
341
  "test-user-name-1",
334
342
  );
335
343
  containerId = getContainerIdFromPayloadResponse(containerResponse);
336
- ({ container } = await client.getContainer(containerId, dynamicSchema, "2"));
344
+ ({ container } = await client.getContainer(
345
+ containerId,
346
+ dynamicSchema,
347
+ currentVersion,
348
+ ));
337
349
  } else {
338
- ({ container } = await client.createContainer(dynamicSchema, "2"));
350
+ ({ container } = await client.createContainer(dynamicSchema, currentVersion));
339
351
  containerId = await container.attach();
340
352
  }
341
353
 
@@ -31,6 +31,7 @@ import { timeoutPromise } from "@fluidframework/test-utils/internal";
31
31
 
32
32
  import { createAzureTokenProvider } from "../AzureTokenFactory.js";
33
33
  import { TestDataObject } from "../TestDataObject.js";
34
+ import { currentVersion } from "../utils.js";
34
35
 
35
36
  import type {
36
37
  MessageFromChild as MessageToParent,
@@ -145,10 +146,14 @@ const getOrCreateContainer = async (params: {
145
146
  });
146
147
  let services: AzureContainerServices;
147
148
  if (containerId === undefined) {
148
- ({ container, services } = await client.createContainer(containerSchema, "2"));
149
+ ({ container, services } = await client.createContainer(containerSchema, currentVersion));
149
150
  containerId = await container.attach();
150
151
  } else {
151
- ({ container, services } = await client.getContainer(containerId, containerSchema, "2"));
152
+ ({ container, services } = await client.getContainer(
153
+ containerId,
154
+ containerSchema,
155
+ currentVersion,
156
+ ));
152
157
  }
153
158
  container.on("disconnected", onDisconnected);
154
159
 
@@ -19,7 +19,7 @@ import {
19
19
  } from "./AzureClientFactory.js";
20
20
  import { SignalerTestDataObject } from "./TestDataObject.js";
21
21
  import * as ephemeralSummaryTrees from "./ephemeralSummaryTrees.js";
22
- import { configProvider, getTestMatrix } from "./utils.js";
22
+ import { configProvider, getTestMatrix, currentVersion } from "./utils.js";
23
23
 
24
24
  interface UserIdAndName {
25
25
  readonly id: string;
@@ -108,14 +108,22 @@ for (const testOpts of testMatrix) {
108
108
  "test-user-name-1",
109
109
  );
110
110
  containerId = getContainerIdFromPayloadResponse(containerResponse);
111
- ({ container, services } = await client.getContainer(containerId, schema, "2"));
111
+ ({ container, services } = await client.getContainer(
112
+ containerId,
113
+ schema,
114
+ currentVersion,
115
+ ));
112
116
  } else {
113
- ({ container, services } = await client.createContainer(schema, "2"));
117
+ ({ container, services } = await client.createContainer(schema, currentVersion));
114
118
  containerId = await container.attach();
115
119
  }
116
120
  } else {
117
121
  containerId = id;
118
- ({ container, services } = await client.getContainer(containerId, schema, "2"));
122
+ ({ container, services } = await client.getContainer(
123
+ containerId,
124
+ schema,
125
+ currentVersion,
126
+ ));
119
127
  }
120
128
 
121
129
  if (container.connectionState !== ConnectionState.Connected) {
@@ -20,7 +20,7 @@ import {
20
20
  getContainerIdFromPayloadResponse,
21
21
  } from "./AzureClientFactory.js";
22
22
  import * as ephemeralSummaryTrees from "./ephemeralSummaryTrees.js";
23
- import { getTestMatrix } from "./utils.js";
23
+ import { getTestMatrix, currentVersion } from "./utils.js";
24
24
 
25
25
  const sf = new SchemaFactory("d302b84c-75f6-4ecd-9663-524f467013e3");
26
26
 
@@ -87,7 +87,7 @@ for (const testOpts of testMatrix) {
87
87
  let treeData: TreeView<typeof StringArray>;
88
88
 
89
89
  if (summaryTree === undefined) {
90
- const { container } = await client.createContainer(schema, "2");
90
+ const { container } = await client.createContainer(schema, currentVersion);
91
91
  treeData = container.initialObjects.tree1.viewWith(treeConfiguration);
92
92
  treeData.initialize(new StringArray([]));
93
93
  containerId = await container.attach();
@@ -100,7 +100,7 @@ for (const testOpts of testMatrix) {
100
100
  );
101
101
 
102
102
  containerId = getContainerIdFromPayloadResponse(containerResponse);
103
- const { container } = await client.getContainer(containerId, schema, "2");
103
+ const { container } = await client.getContainer(containerId, schema, currentVersion);
104
104
  treeData = container.initialObjects.tree1.viewWith(treeConfiguration);
105
105
  await waitForConnection(container);
106
106
  }
@@ -137,7 +137,7 @@ for (const testOpts of testMatrix) {
137
137
 
138
138
  treeData.root.insertNew("test string 1");
139
139
 
140
- const resources = client.getContainer(containerId, schema, "2");
140
+ const resources = client.getContainer(containerId, schema, currentVersion);
141
141
  await assert.doesNotReject(
142
142
  resources,
143
143
  () => true,
@@ -172,7 +172,7 @@ for (const testOpts of testMatrix) {
172
172
  }) {}
173
173
 
174
174
  it("can read and edit data", async () => {
175
- const { container } = await client.createContainer(schema, "2");
175
+ const { container } = await client.createContainer(schema, currentVersion);
176
176
  await container.attach();
177
177
  const view = container.initialObjects.tree1.viewWith(
178
178
  new TreeViewConfiguration({ schema: User, enableSchemaValidation: true }),
@@ -213,7 +213,7 @@ for (const testOpts of testMatrix) {
213
213
  });
214
214
 
215
215
  it("can handle undo/redo and transactions", async () => {
216
- const { container } = await client.createContainer(schema, "2");
216
+ const { container } = await client.createContainer(schema, currentVersion);
217
217
  await container.attach();
218
218
  const view = asAlpha(
219
219
  container.initialObjects.tree1.viewWith(
@@ -262,7 +262,7 @@ for (const testOpts of testMatrix) {
262
262
  it("can use identifiers and the static Tree APIs", async () => {
263
263
  class Widget extends sf.object("Widget", { id: sf.identifier }) {}
264
264
 
265
- const { container } = await client.createContainer(schema, "2");
265
+ const { container } = await client.createContainer(schema, currentVersion);
266
266
  await container.attach();
267
267
  const view = container.initialObjects.tree1.viewWith(
268
268
  new TreeViewConfiguration({
@@ -297,7 +297,7 @@ for (const testOpts of testMatrix) {
297
297
  }) {}
298
298
  allowUnused<ValidateRecursiveSchema<typeof Doll>>();
299
299
 
300
- const { container } = await client.createContainer(schema, "2");
300
+ const { container } = await client.createContainer(schema, currentVersion);
301
301
  await container.attach();
302
302
  const view = container.initialObjects.tree1.viewWith(
303
303
  new TreeViewConfiguration({ schema: Doll, enableSchemaValidation: true }),
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "extends": "../../../../../../common/build/build-common/tsconfig.test.node16.json",
3
+ // This deviates from the standard test tsconfig pattern to accommodate `gen-version`, which emits
4
+ // `src/packageVersion.ts` one directory above the test sources. We widen `rootDir` (and adjust
5
+ // `outDir` to match) and explicitly include the generated file so it compiles alongside the tests.
3
6
  "compilerOptions": {
4
- "rootDir": "./",
5
- "outDir": "../../lib/test",
7
+ "rootDir": "../",
8
+ "outDir": "../../lib",
6
9
  "types": ["mocha", "node"],
7
10
  "noUncheckedIndexedAccess": false,
8
11
  "exactOptionalPropertyTypes": false,
9
12
  },
10
- "include": ["./**/*"],
13
+ "include": ["./**/*", "../packageVersion.ts"],
11
14
  }
package/src/test/utils.ts CHANGED
@@ -8,6 +8,10 @@ import type { ConfigTypes, IConfigProviderBase } from "@fluidframework/core-inte
8
8
  import type { IMember } from "@fluidframework/fluid-static";
9
9
  import type { ISharedMap, IValueChanged } from "@fluidframework/map/legacy";
10
10
 
11
+ // `pkgVersion` is this package's own version, which tracks the Fluid Framework release group; we use it as
12
+ // `minVersionForCollab` in tests so they exercise the latest defaults rather than a hardcoded version.
13
+ export { pkgVersion as currentVersion } from "../packageVersion.js";
14
+
11
15
  export const waitForMember = async (
12
16
  audience: IAzureAudience,
13
17
  id: string,
@@ -17,7 +17,7 @@ import {
17
17
  getContainerIdFromPayloadResponse,
18
18
  } from "./AzureClientFactory.js";
19
19
  import * as ephemeralSummaryTrees from "./ephemeralSummaryTrees.js";
20
- import { getTestMatrix } from "./utils.js";
20
+ import { getTestMatrix, currentVersion } from "./utils.js";
21
21
 
22
22
  const testMatrix = getTestMatrix();
23
23
  for (const testOpts of testMatrix) {
@@ -63,9 +63,9 @@ for (const testOpts of testMatrix) {
63
63
  "test-user-name-1",
64
64
  );
65
65
  containerId = getContainerIdFromPayloadResponse(containerResponse);
66
- ({ container } = await client.getContainer(containerId, schema, "2"));
66
+ ({ container } = await client.getContainer(containerId, schema, currentVersion));
67
67
  } else {
68
- ({ container } = await client.createContainer(schema, "2"));
68
+ ({ container } = await client.createContainer(schema, currentVersion));
69
69
  containerId = await container.attach();
70
70
  }
71
71
 
@@ -126,7 +126,7 @@ for (const testOpts of testMatrix) {
126
126
  );
127
127
  containerId = getContainerIdFromPayloadResponse(containerResponse);
128
128
  } else {
129
- ({ container } = await client.createContainer(schema, "2"));
129
+ ({ container } = await client.createContainer(schema, currentVersion));
130
130
  containerId = await container.attach();
131
131
 
132
132
  if (container.connectionState !== ConnectionState.Connected) {
@@ -143,7 +143,7 @@ for (const testOpts of testMatrix) {
143
143
  containerId,
144
144
  schema,
145
145
  versions[0],
146
- "2",
146
+ currentVersion,
147
147
  );
148
148
  await assert.doesNotReject(viewContainerVersionAttempt);
149
149
  const { container: containerView } = await viewContainerVersionAttempt;
@@ -169,10 +169,10 @@ for (const testOpts of testMatrix) {
169
169
  "test-user-name-1",
170
170
  );
171
171
  containerId = getContainerIdFromPayloadResponse(containerResponse);
172
- ({ container } = await client.getContainer(containerId, schema, "2"));
172
+ ({ container } = await client.getContainer(containerId, schema, currentVersion));
173
173
  map1 = container.initialObjects.map1 as SharedMap;
174
174
  } else {
175
- ({ container } = await client.createContainer(schema, "2"));
175
+ ({ container } = await client.createContainer(schema, currentVersion));
176
176
 
177
177
  map1 = container.initialObjects.map1 as SharedMap;
178
178
  map1.set(testKey, expectedValue);
@@ -197,7 +197,7 @@ for (const testOpts of testMatrix) {
197
197
  containerId,
198
198
  schema,
199
199
  versions[versions.length - 1],
200
- "2",
200
+ currentVersion,
201
201
  );
202
202
  await assert.doesNotReject(viewContainerVersionAttempt);
203
203
  const { container: containerView } = await viewContainerVersionAttempt;
@@ -216,7 +216,7 @@ for (const testOpts of testMatrix) {
216
216
  {
217
217
  id: "whatever",
218
218
  },
219
- "2",
219
+ currentVersion,
220
220
  );
221
221
  const errorFn = (error: Error): boolean => {
222
222
  assert.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- "use strict";
7
-
8
- const packageDir = `${__dirname}/../..`;
9
- const getFluidTestMochaConfig = require("@fluid-private/test-version-utils/mocharc-common");
10
- const config = getFluidTestMochaConfig(packageDir);
11
- module.exports = config;