@fluidframework/azure-end-to-end-tests 2.53.1 → 2.61.0-355054

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 (44) hide show
  1. package/.eslintrc.cjs +27 -0
  2. package/CHANGELOG.md +4 -0
  3. package/lib/test/AzureClientFactory.js +2 -2
  4. package/lib/test/AzureClientFactory.js.map +1 -1
  5. package/lib/test/AzureTokenFactory.js +2 -2
  6. package/lib/test/AzureTokenFactory.js.map +1 -1
  7. package/lib/test/TestDataObject.js +4 -2
  8. package/lib/test/TestDataObject.js.map +1 -1
  9. package/lib/test/audience.spec.js +1 -1
  10. package/lib/test/audience.spec.js.map +1 -1
  11. package/lib/test/containerCreate.spec.js +6 -4
  12. package/lib/test/containerCreate.spec.js.map +1 -1
  13. package/lib/test/ddsTests.spec.js +1 -1
  14. package/lib/test/ddsTests.spec.js.map +1 -1
  15. package/lib/test/multiprocess/childClient.tool.js +454 -0
  16. package/lib/test/multiprocess/childClient.tool.js.map +1 -0
  17. package/lib/test/multiprocess/messageTypes.js.map +1 -1
  18. package/lib/test/multiprocess/orchestratorUtils.js +381 -0
  19. package/lib/test/multiprocess/orchestratorUtils.js.map +1 -0
  20. package/lib/test/multiprocess/presenceTest.spec.js +306 -191
  21. package/lib/test/multiprocess/presenceTest.spec.js.map +1 -1
  22. package/lib/test/tree.spec.js +3 -2
  23. package/lib/test/tree.spec.js.map +1 -1
  24. package/lib/test/utils.js.map +1 -1
  25. package/lib/test/viewContainerVersion.spec.js +1 -1
  26. package/lib/test/viewContainerVersion.spec.js.map +1 -1
  27. package/package.json +29 -29
  28. package/src/test/.mocharc.cjs +0 -1
  29. package/src/test/AzureClientFactory.ts +6 -8
  30. package/src/test/AzureTokenFactory.ts +3 -2
  31. package/src/test/TestDataObject.ts +6 -5
  32. package/src/test/audience.spec.ts +1 -1
  33. package/src/test/containerCreate.spec.ts +6 -5
  34. package/src/test/ddsTests.spec.ts +1 -1
  35. package/src/test/multiprocess/childClient.tool.ts +575 -0
  36. package/src/test/multiprocess/messageTypes.ts +138 -4
  37. package/src/test/multiprocess/orchestratorUtils.ts +573 -0
  38. package/src/test/multiprocess/presenceTest.spec.ts +454 -270
  39. package/src/test/tree.spec.ts +4 -10
  40. package/src/test/utils.ts +1 -1
  41. package/src/test/viewContainerVersion.spec.ts +1 -1
  42. package/lib/test/multiprocess/childClient.js +0 -169
  43. package/lib/test/multiprocess/childClient.js.map +0 -1
  44. package/src/test/multiprocess/childClient.ts +0 -227
@@ -3,14 +3,28 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { AzureUser } from "@fluidframework/azure-client/internal";
7
6
  // eslint-disable-next-line import/no-internal-modules
7
+ import type { JsonSerializable } from "@fluidframework/core-interfaces/internal";
8
+ import type { ScopeType } from "@fluidframework/driver-definitions/legacy";
8
9
  import type { AttendeeId } from "@fluidframework/presence/beta";
9
10
 
11
+ export interface UserIdAndName {
12
+ id: string;
13
+ name: string;
14
+ }
15
+
10
16
  /**
11
17
  * Message types sent from the orchestrator to the child processes
12
18
  */
13
- export type MessageToChild = ConnectCommand | DisconnectSelfCommand | PingCommand;
19
+ export type MessageToChild =
20
+ | ConnectCommand
21
+ | DisconnectSelfCommand
22
+ | RegisterWorkspaceCommand
23
+ | GetLatestValueCommand
24
+ | GetLatestMapValueCommand
25
+ | SetLatestValueCommand
26
+ | SetLatestMapValueCommand
27
+ | PingCommand;
14
28
 
15
29
  /**
16
30
  * Can be sent to check child responsiveness.
@@ -26,7 +40,9 @@ interface PingCommand {
26
40
  */
27
41
  export interface ConnectCommand {
28
42
  command: "connect";
29
- user: AzureUser;
43
+ user: UserIdAndName;
44
+ scopes: ScopeType[];
45
+ createScopes?: ScopeType[];
30
46
  /**
31
47
  * The ID of the Fluid container to connect to.
32
48
  * If not provided, a new Fluid container will be created.
@@ -42,6 +58,67 @@ interface DisconnectSelfCommand {
42
58
  command: "disconnectSelf";
43
59
  }
44
60
 
61
+ /**
62
+ * Instructs a child process to register for state objects in a workspace given a workspaceId
63
+ * A {@link WorkspaceRegisteredEvent} should be expected in response.
64
+ */
65
+ interface RegisterWorkspaceCommand {
66
+ command: "registerWorkspace";
67
+ workspaceId: string;
68
+ /**
69
+ * Register a Latest state for this workspace.
70
+ */
71
+ latest?: true;
72
+ /**
73
+ * Register a LatestMap state for this workspace.
74
+ */
75
+ latestMap?: true;
76
+ }
77
+
78
+ /**
79
+ * Instructs a child process to set the latest value.
80
+ * We then can wait for {@link LatestValueUpdatedEvent} from other clients to know when an update occurs that represents this change.
81
+ * Note: The client doesn't guarantee that the update message is directly related to this set command.
82
+ */
83
+ interface SetLatestValueCommand {
84
+ command: "setLatestValue";
85
+ workspaceId: string;
86
+ value: JsonSerializable<unknown>;
87
+ }
88
+
89
+ /**
90
+ * Instructs a child process to set the latest map value.
91
+ * We then can wait for {@link LatestMapValueUpdatedEvent} from other clients to know when an update occurs that represents this change.
92
+ * Note: The client doesn't guarantee that the update message is directly related to this set command.
93
+ */
94
+ interface SetLatestMapValueCommand {
95
+ command: "setLatestMapValue";
96
+ workspaceId: string;
97
+ key: string;
98
+ value: JsonSerializable<unknown>;
99
+ }
100
+
101
+ /**
102
+ * Instructs a child process to get the latest value.
103
+ * A {@link LatestValueGetResponseEvent} should be expected in response.
104
+ */
105
+ interface GetLatestValueCommand {
106
+ command: "getLatestValue";
107
+ workspaceId: string;
108
+ attendeeId?: AttendeeId;
109
+ }
110
+
111
+ /**
112
+ * Instructs a child process to get the latest map value.
113
+ * A {@link LatestMapValueGetResponseEvent} should be expected in response.
114
+ */
115
+ interface GetLatestMapValueCommand {
116
+ command: "getLatestMapValue";
117
+ workspaceId: string;
118
+ key: string;
119
+ attendeeId?: AttendeeId;
120
+ }
121
+
45
122
  /**
46
123
  * Message types sent from the child processes to the orchestrator
47
124
  */
@@ -51,7 +128,12 @@ export type MessageFromChild =
51
128
  | AttendeeDisconnectedEvent
52
129
  | ConnectedEvent
53
130
  | DisconnectedSelfEvent
54
- | ErrorEvent;
131
+ | ErrorEvent
132
+ | LatestMapValueGetResponseEvent
133
+ | LatestMapValueUpdatedEvent
134
+ | LatestValueGetResponseEvent
135
+ | LatestValueUpdatedEvent
136
+ | WorkspaceRegisteredEvent;
55
137
 
56
138
  /**
57
139
  * Sent from the child processes to the orchestrator in response to a {@link PingCommand}.
@@ -93,6 +175,58 @@ interface DisconnectedSelfEvent {
93
175
  attendeeId: AttendeeId;
94
176
  }
95
177
 
178
+ /**
179
+ * Sent from the child processes to the orchestrator in response to latest value update.
180
+ */
181
+ export interface LatestValueUpdatedEvent {
182
+ event: "latestValueUpdated";
183
+ workspaceId: string;
184
+ attendeeId: AttendeeId;
185
+ value: unknown;
186
+ }
187
+
188
+ /**
189
+ * Sent from the child processes to the orchestrator in response to latest map value update.
190
+ */
191
+ export interface LatestMapValueUpdatedEvent {
192
+ event: "latestMapValueUpdated";
193
+ workspaceId: string;
194
+ attendeeId: AttendeeId;
195
+ key: string;
196
+ value: unknown;
197
+ }
198
+
199
+ /**
200
+ * Sent from the child processes to the orchestrator in response to a {@link GetLatestValueCommand}.
201
+ */
202
+ export interface LatestValueGetResponseEvent {
203
+ event: "latestValueGetResponse";
204
+ workspaceId: string;
205
+ attendeeId: AttendeeId | undefined;
206
+ value: unknown;
207
+ }
208
+
209
+ /**
210
+ * Sent from the child processes to the orchestrator in response to a {@link GetLatestMapValueCommand}.
211
+ */
212
+ export interface LatestMapValueGetResponseEvent {
213
+ event: "latestMapValueGetResponse";
214
+ workspaceId: string;
215
+ attendeeId: AttendeeId | undefined;
216
+ key: string;
217
+ value: unknown;
218
+ }
219
+
220
+ /**
221
+ * Sent from the child process to acknowledge workspace registration.
222
+ */
223
+ interface WorkspaceRegisteredEvent {
224
+ event: "workspaceRegistered";
225
+ workspaceId: string;
226
+ latest?: boolean;
227
+ latestMap?: boolean;
228
+ }
229
+
96
230
  /**
97
231
  * Sent at any time to indicate an error.
98
232
  */