@salto-io/persistent-pool 0.3.40-main.5ef2e84db → 0.3.40-publishOnlyDist.57b77fb79

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 (59) hide show
  1. package/package.json +7 -8
  2. package/dist/test/lib/dynamodb/dynamodb_repo.e2e.test.d.ts +0 -2
  3. package/dist/test/lib/dynamodb/dynamodb_repo.e2e.test.d.ts.map +0 -1
  4. package/dist/test/lib/dynamodb/dynamodb_repo.e2e.test.js +0 -98
  5. package/dist/test/lib/dynamodb/dynamodb_repo.e2e.test.js.map +0 -1
  6. package/dist/test/lib/dynamodb/dynamodb_repo.test.d.ts +0 -2
  7. package/dist/test/lib/dynamodb/dynamodb_repo.test.d.ts.map +0 -1
  8. package/dist/test/lib/dynamodb/dynamodb_repo.test.js +0 -533
  9. package/dist/test/lib/dynamodb/dynamodb_repo.test.js.map +0 -1
  10. package/dist/test/lib/dynamodb/environment/index.d.ts +0 -9
  11. package/dist/test/lib/dynamodb/environment/index.d.ts.map +0 -1
  12. package/dist/test/lib/dynamodb/environment/index.js +0 -70
  13. package/dist/test/lib/dynamodb/environment/index.js.map +0 -1
  14. package/dist/test/lib/dynamodb/environment/types.d.ts +0 -7
  15. package/dist/test/lib/dynamodb/environment/types.d.ts.map +0 -1
  16. package/dist/test/lib/dynamodb/environment/types.js +0 -3
  17. package/dist/test/lib/dynamodb/environment/types.js.map +0 -1
  18. package/dist/test/lib/dynamodb/utils.d.ts +0 -12
  19. package/dist/test/lib/dynamodb/utils.d.ts.map +0 -1
  20. package/dist/test/lib/dynamodb/utils.js +0 -53
  21. package/dist/test/lib/dynamodb/utils.js.map +0 -1
  22. package/dist/test/lib/renewed_lease.test.d.ts +0 -2
  23. package/dist/test/lib/renewed_lease.test.d.ts.map +0 -1
  24. package/dist/test/lib/renewed_lease.test.js +0 -134
  25. package/dist/test/lib/renewed_lease.test.js.map +0 -1
  26. package/dist/test/mock_repo.d.ts +0 -8
  27. package/dist/test/mock_repo.d.ts.map +0 -1
  28. package/dist/test/mock_repo.js +0 -22
  29. package/dist/test/mock_repo.js.map +0 -1
  30. package/dist/test/types.d.ts +0 -7
  31. package/dist/test/types.d.ts.map +0 -1
  32. package/dist/test/types.js +0 -9
  33. package/dist/test/types.js.map +0 -1
  34. package/dist/test/utils/async_to_array.d.ts +0 -3
  35. package/dist/test/utils/async_to_array.d.ts.map +0 -1
  36. package/dist/test/utils/async_to_array.js +0 -32
  37. package/dist/test/utils/async_to_array.js.map +0 -1
  38. package/dist/test/utils/promise_series.d.ts +0 -3
  39. package/dist/test/utils/promise_series.d.ts.map +0 -1
  40. package/dist/test/utils/promise_series.js +0 -28
  41. package/dist/test/utils/promise_series.js.map +0 -1
  42. package/dist/test/utils/random_string.d.ts +0 -6
  43. package/dist/test/utils/random_string.d.ts.map +0 -1
  44. package/dist/test/utils/random_string.js +0 -22
  45. package/dist/test/utils/random_string.js.map +0 -1
  46. package/dist/test/utils/repeat.d.ts +0 -3
  47. package/dist/test/utils/repeat.d.ts.map +0 -1
  48. package/dist/test/utils/repeat.js +0 -20
  49. package/dist/test/utils/repeat.js.map +0 -1
  50. package/dist/test/utils/timing.d.ts +0 -10
  51. package/dist/test/utils/timing.d.ts.map +0 -1
  52. package/dist/test/utils/timing.js +0 -39
  53. package/dist/test/utils/timing.js.map +0 -1
  54. package/dist/tsconfig.tsbuildinfo +0 -14427
  55. package/src/index.ts +0 -21
  56. package/src/lib/dynamodb/dynamodb_repo.ts +0 -487
  57. package/src/lib/dynamodb/utils.ts +0 -168
  58. package/src/lib/renewed_lease.ts +0 -83
  59. package/src/types.ts +0 -106
@@ -1,533 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /*
7
- * Copyright 2023 Salto Labs Ltd.
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with
11
- * the License. You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
22
- const lowerdash_1 = require("@salto-io/lowerdash");
23
- const dynamodb_repo_1 = require("../../../src/lib/dynamodb/dynamodb_repo");
24
- const types_1 = require("../../../src/types");
25
- const utils_1 = require("./utils");
26
- const types_2 = require("../../types");
27
- const promise_series_1 = __importDefault(require("../../utils/promise_series"));
28
- const repeat_1 = __importDefault(require("../../utils/repeat"));
29
- const async_to_array_1 = __importDefault(require("../../utils/async_to_array"));
30
- const { retryStrategies } = lowerdash_1.retry;
31
- describe('dynamoDB repo', () => {
32
- const CLIENT_ID = 'myClient';
33
- let dynamo;
34
- let tableName;
35
- let dbUtils;
36
- beforeEach(async () => {
37
- ({ dynamo, tableName } = global.dynamoEnv.dynalite);
38
- dbUtils = utils_1.testDbUtils(dynamo.db);
39
- await dbUtils.deleteTable(tableName);
40
- });
41
- const repoOpts = () => ({
42
- clientId: CLIENT_ID,
43
- optimisticLockMaxRetries: 1,
44
- query: { strategy: retryStrategies.intervals({ interval: 1, maxRetries: 1 }) },
45
- batchDelete: {
46
- strategy: retryStrategies.intervals({ interval: 1, maxRetries: 1 }),
47
- },
48
- ...dynamo,
49
- });
50
- const timeout = 1000 * 60;
51
- const suspensionReason = 'it was not being very nice';
52
- describe('repo', () => {
53
- let repo;
54
- beforeEach(async () => {
55
- repo = await dynamodb_repo_1.repo(repoOpts());
56
- });
57
- it('should create the table', async () => {
58
- await dynamo.db.send(new client_dynamodb_1.ListTablesCommand({}));
59
- expect(await dbUtils.tableExists(tableName)).toBeTruthy();
60
- });
61
- it('should return a repo', () => {
62
- expect(typeof repo.pool).toBe('function');
63
- });
64
- describe('when called again', () => {
65
- it('should not throw', async () => {
66
- await dynamodb_repo_1.repo(repoOpts());
67
- });
68
- it('should return a repo', () => {
69
- expect(typeof repo.pool).toBe('function');
70
- });
71
- });
72
- describe('initialization with serviceOpts', () => {
73
- let pool;
74
- beforeEach(async () => {
75
- const { serviceOpts } = global.dynamoEnv.dynalite;
76
- const repo2 = await dynamodb_repo_1.repo({ ...repoOpts(), serviceOpts });
77
- const pool2 = await repo2.pool(types_2.myTypeName);
78
- await pool2.register(types_2.myVal, 'myid');
79
- pool = await repo.pool(types_2.myTypeName);
80
- });
81
- it('should point to the same specified DynamoDB instance', async () => {
82
- expect((await pool.lease(timeout)).id).toEqual('myid');
83
- });
84
- });
85
- });
86
- describe('pool', () => {
87
- let repo;
88
- let pool;
89
- beforeEach(async () => {
90
- repo = await dynamodb_repo_1.repo(repoOpts());
91
- pool = await repo.pool(types_2.myTypeName);
92
- });
93
- describe('register', () => {
94
- let id;
95
- describe('when an id is not specified', () => {
96
- beforeEach(async () => {
97
- id = await pool.register(types_2.myVal);
98
- });
99
- it('should return a new id', () => {
100
- expect(typeof id).toBe('string');
101
- });
102
- describe('when called again', () => {
103
- let id2;
104
- beforeEach(async () => {
105
- id2 = await pool.register(types_2.myVal);
106
- });
107
- it('should return a different id', () => {
108
- expect(id2).not.toEqual(id);
109
- });
110
- });
111
- });
112
- describe('when an id is specified', () => {
113
- const specifiedId = 'id1';
114
- beforeEach(async () => {
115
- id = await pool.register(types_2.myVal, specifiedId);
116
- });
117
- it('should return a the same id', () => {
118
- expect(id).toEqual(specifiedId);
119
- });
120
- describe('when called again with the same id', () => {
121
- let result;
122
- beforeEach(() => {
123
- result = pool.register(types_2.myVal, specifiedId);
124
- });
125
- it('should throw an InstanceIdAlreadyRegistered error', () => expect(result).rejects.toThrow(types_1.InstanceIdAlreadyRegistered));
126
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
127
- id: specifiedId,
128
- typeName: types_2.myTypeName,
129
- }));
130
- });
131
- });
132
- });
133
- describe('unregister', () => {
134
- describe('when the instance is not registered', () => {
135
- const id = 'not-registered';
136
- let result;
137
- beforeEach(() => {
138
- result = pool.unregister(id);
139
- });
140
- it('should throw', () => expect(result).rejects.toThrow(types_1.InstanceNotFoundError));
141
- });
142
- describe('when the instance is registered', () => {
143
- let id;
144
- beforeEach(async () => {
145
- id = await pool.register(types_2.myVal);
146
- await pool.unregister(id);
147
- });
148
- it('should not be available for lease', async () => {
149
- expect(await pool.lease(timeout)).toBeNull();
150
- });
151
- });
152
- });
153
- describe('lease', () => {
154
- const registeredId = 'id1';
155
- describe('when there are no available instances', () => {
156
- describe('when no retryStrategy is specified', () => {
157
- it('should return null', async () => {
158
- expect(await pool.lease(timeout)).toBeNull();
159
- });
160
- });
161
- });
162
- describe('when there is a registered instance', () => {
163
- let lease;
164
- let leaseTime;
165
- beforeEach(async () => {
166
- await pool.register(types_2.myVal, registeredId);
167
- leaseTime = Date.now();
168
- lease = await pool.lease(timeout);
169
- });
170
- it('should return a lease', () => {
171
- expect(lease).not.toBeNull();
172
- expect(lease).toMatchObject({ id: registeredId, value: types_2.myVal });
173
- });
174
- describe('when another lease is attempted', () => {
175
- describe('before the lease times out', () => {
176
- it('should return null', async () => {
177
- expect(await pool.lease(timeout)).toBeNull();
178
- });
179
- });
180
- describe('after the lease times out', () => {
181
- beforeEach(async () => {
182
- jest.spyOn(Date, 'now').mockImplementationOnce(() => leaseTime + timeout);
183
- lease = await pool.lease(timeout);
184
- });
185
- it('should return null', async () => {
186
- expect(await pool.lease(timeout)).toBeNull();
187
- });
188
- });
189
- });
190
- });
191
- });
192
- describe('return', () => {
193
- describe('when the specified id does not exist', () => {
194
- const id = 'nosuchid';
195
- let result;
196
- beforeEach(() => {
197
- result = pool.return(id);
198
- });
199
- it('should throw a InstanceNotFoundError error', () => expect(result).rejects.toThrow(types_1.InstanceNotFoundError));
200
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not found`)));
201
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
202
- id: 'nosuchid',
203
- typeName: types_2.myTypeName,
204
- }));
205
- });
206
- describe('when the instance exists', () => {
207
- let id;
208
- beforeEach(async () => {
209
- id = await pool.register(types_2.myVal);
210
- });
211
- describe('when the instance is not leased', () => {
212
- let result;
213
- beforeEach(() => {
214
- result = pool.return(id);
215
- });
216
- it('should throw a InstanceNotLeasedError error', () => expect(result).rejects.toThrow(types_1.InstanceNotLeasedError));
217
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not leased by client "${CLIENT_ID}"`)));
218
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
219
- id,
220
- typeName: types_2.myTypeName,
221
- clientId: CLIENT_ID,
222
- }));
223
- });
224
- describe('when the instance is leased by the another client', () => {
225
- let result;
226
- const CLIENT_ID2 = 'otherClient';
227
- let pool2;
228
- beforeEach(async () => {
229
- const lease = await pool.lease(timeout);
230
- expect(lease).not.toBeNull();
231
- expect(lease === null || lease === void 0 ? void 0 : lease.id).toEqual(id);
232
- const repo2 = await dynamodb_repo_1.repo({ ...repoOpts(), clientId: CLIENT_ID2 });
233
- pool2 = await repo2.pool(types_2.myTypeName);
234
- });
235
- describe('when validateClientId is the default true', () => {
236
- beforeEach(() => {
237
- result = pool2.return(id);
238
- });
239
- it('should throw a InstanceNotLeasedError error', () => expect(result).rejects.toThrow(types_1.InstanceNotLeasedError));
240
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not leased by client "${CLIENT_ID2}"`)));
241
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
242
- id,
243
- typeName: types_2.myTypeName,
244
- clientId: CLIENT_ID2,
245
- }));
246
- });
247
- describe('when validateClientId is false', () => {
248
- beforeEach(async () => {
249
- await pool2.return(id, { validateClientId: false });
250
- });
251
- it('should make the instance available for leasing again', async () => {
252
- const lease = await pool.lease(timeout);
253
- expect(lease).not.toBeNull();
254
- expect(lease.id).toEqual(id);
255
- });
256
- });
257
- });
258
- describe('when the instance is leased', () => {
259
- beforeEach(async () => {
260
- await pool.lease(timeout);
261
- await pool.return(id);
262
- });
263
- it('should make the instance available for leasing again', async () => {
264
- const lease = await pool.lease(timeout);
265
- expect(lease).not.toBeNull();
266
- expect(lease.id).toEqual(id);
267
- });
268
- });
269
- });
270
- });
271
- describe('updateTimeout', () => {
272
- describe('when the specified id does not exist', () => {
273
- const id = 'nosuchid';
274
- let result;
275
- beforeEach(() => {
276
- result = pool.updateTimeout(id, timeout);
277
- });
278
- it('should throw a InstanceNotFoundError error', () => expect(result).rejects.toThrow(types_1.InstanceNotFoundError));
279
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not found`)));
280
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
281
- id: 'nosuchid',
282
- typeName: types_2.myTypeName,
283
- }));
284
- });
285
- describe('when the instance exists', () => {
286
- let id;
287
- beforeEach(async () => {
288
- id = await pool.register(types_2.myVal);
289
- });
290
- describe('when the instance is not leased', () => {
291
- let result;
292
- beforeEach(() => {
293
- result = pool.updateTimeout(id, timeout);
294
- });
295
- it('should throw a InstanceNotLeasedError error', () => expect(result).rejects.toThrow(types_1.InstanceNotLeasedError));
296
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not leased by client "${CLIENT_ID}"`)));
297
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
298
- id,
299
- typeName: types_2.myTypeName,
300
- clientId: CLIENT_ID,
301
- }));
302
- });
303
- describe('when the instance is leased by another client', () => {
304
- let result;
305
- const CLIENT_ID2 = 'otherClient';
306
- let pool2;
307
- beforeEach(async () => {
308
- const lease = await pool.lease(0);
309
- expect(lease).not.toBeNull();
310
- expect(lease === null || lease === void 0 ? void 0 : lease.id).toEqual(id);
311
- const repo2 = await dynamodb_repo_1.repo({ ...repoOpts(), clientId: CLIENT_ID2 });
312
- pool2 = await repo2.pool(types_2.myTypeName);
313
- });
314
- describe('when validateClientId is the default true', () => {
315
- beforeEach(() => {
316
- result = pool2.updateTimeout(id, timeout);
317
- });
318
- it('should throw a InstanceNotLeasedError error', () => expect(result).rejects.toThrow(types_1.InstanceNotLeasedError));
319
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not leased by client "${CLIENT_ID2}"`)));
320
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
321
- id,
322
- typeName: types_2.myTypeName,
323
- clientId: CLIENT_ID2,
324
- }));
325
- });
326
- describe('when validateClientId is false', () => {
327
- beforeEach(async () => {
328
- await pool2.updateTimeout(id, timeout, { validateClientId: false });
329
- });
330
- it('should make the instance leased again', async () => {
331
- const lease = await pool.lease(timeout);
332
- expect(lease).toBeNull();
333
- });
334
- });
335
- });
336
- describe('when the instance is leased', () => {
337
- beforeEach(async () => {
338
- await pool.lease(0);
339
- await pool.updateTimeout(id, timeout);
340
- });
341
- it('should make the instance leased again', async () => {
342
- const lease = await pool.lease(timeout);
343
- expect(lease).toBeNull();
344
- });
345
- });
346
- });
347
- });
348
- describe('suspend', () => {
349
- describe('when the specified id does not exist', () => {
350
- const id = 'nosuchid';
351
- let result;
352
- beforeEach(() => {
353
- result = pool.suspend(id, suspensionReason, timeout);
354
- });
355
- it('should throw a InstanceNotFoundError error', () => expect(result).rejects.toThrow(types_1.InstanceNotFoundError));
356
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not found`)));
357
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
358
- id: 'nosuchid',
359
- typeName: types_2.myTypeName,
360
- }));
361
- });
362
- describe('when the instance exists', () => {
363
- let id;
364
- beforeEach(async () => {
365
- id = await pool.register(types_2.myVal);
366
- });
367
- describe('when the instance is not leased', () => {
368
- beforeEach(async () => {
369
- await pool.suspend(id, suspensionReason, timeout, { validateClientId: false });
370
- });
371
- it('should make the instance suspended', async () => {
372
- const lease = await pool.lease(timeout);
373
- expect(lease).toBeNull();
374
- });
375
- });
376
- describe('when the instance is leased by another client', () => {
377
- let result;
378
- const CLIENT_ID2 = 'otherClient';
379
- let pool2;
380
- beforeEach(async () => {
381
- const lease = await pool.lease(0);
382
- expect(lease).not.toBeNull();
383
- expect(lease === null || lease === void 0 ? void 0 : lease.id).toEqual(id);
384
- const repo2 = await dynamodb_repo_1.repo({ ...repoOpts(), clientId: CLIENT_ID2 });
385
- pool2 = await repo2.pool(types_2.myTypeName);
386
- });
387
- describe('when validateClientId is the default true', () => {
388
- beforeEach(() => {
389
- result = pool2.suspend(id, suspensionReason, timeout);
390
- });
391
- it('should throw a InstanceNotLeasedError error', () => expect(result).rejects.toThrow(types_1.InstanceNotLeasedError));
392
- it('should throw an error with the correct message', () => expect(result).rejects.toThrow(new RegExp(`Instance "${id}" of type "${types_2.myTypeName}": not leased by client "${CLIENT_ID2}"`)));
393
- it('should throw an error with the specified id and typeName', () => expect(result).rejects.toMatchObject({
394
- id,
395
- typeName: types_2.myTypeName,
396
- clientId: CLIENT_ID2,
397
- }));
398
- });
399
- describe('when validateClientId is false', () => {
400
- beforeEach(async () => {
401
- await pool2.suspend(id, suspensionReason, timeout, { validateClientId: false });
402
- });
403
- it('should make the instance suspended', async () => {
404
- const lease = await pool.lease(timeout);
405
- expect(lease).toBeNull();
406
- });
407
- });
408
- });
409
- describe('when the instance is leased', () => {
410
- beforeEach(async () => {
411
- await pool.lease(timeout);
412
- await pool.suspend(id, suspensionReason, timeout);
413
- });
414
- it('should make the instance suspended', async () => {
415
- const lease = await pool.lease(timeout);
416
- expect(lease).toBeNull();
417
- });
418
- });
419
- });
420
- });
421
- describe('iteration', () => {
422
- let listResult;
423
- describe('when there are no instances', () => {
424
- beforeEach(async () => {
425
- listResult = await async_to_array_1.default(pool);
426
- });
427
- it('should return an empty iterator', () => {
428
- expect(listResult).toHaveLength(0);
429
- });
430
- });
431
- describe('when there is an available instance', () => {
432
- let id;
433
- let details;
434
- beforeEach(async () => {
435
- id = await pool.register(types_2.myVal);
436
- listResult = await async_to_array_1.default(pool);
437
- [details] = listResult;
438
- });
439
- it('should return the instance details', () => {
440
- expect(details).toMatchObject({
441
- status: 'available',
442
- id,
443
- value: types_2.myVal,
444
- });
445
- });
446
- });
447
- describe('when there is a leased instance', () => {
448
- let id;
449
- let details;
450
- const now = Date.now();
451
- beforeEach(async () => {
452
- id = await pool.register(types_2.myVal);
453
- jest.spyOn(Date, 'now').mockImplementation(() => now);
454
- expect(await pool.lease(timeout)).not.toBeNull();
455
- listResult = await async_to_array_1.default(pool);
456
- [details] = listResult;
457
- });
458
- it('should return the instance details', () => {
459
- expect(details).toMatchObject({
460
- status: 'leased',
461
- id,
462
- value: types_2.myVal,
463
- clientId: CLIENT_ID,
464
- leaseExpiresBy: new Date(now + timeout),
465
- });
466
- });
467
- });
468
- describe('when there is a suspended instance', () => {
469
- let id;
470
- let details;
471
- const now = Date.now();
472
- beforeEach(async () => {
473
- id = await pool.register(types_2.myVal);
474
- jest.spyOn(Date, 'now').mockImplementation(() => now);
475
- expect(await pool.lease(timeout)).not.toBeNull();
476
- await pool.suspend(id, suspensionReason, timeout);
477
- listResult = await async_to_array_1.default(pool);
478
- [details] = listResult;
479
- });
480
- it('should return the instance details', () => {
481
- expect(details).toMatchObject({
482
- status: 'suspended',
483
- id,
484
- value: types_2.myVal,
485
- clientId: CLIENT_ID,
486
- suspensionReason,
487
- leaseExpiresBy: new Date(now + timeout),
488
- });
489
- });
490
- });
491
- describe('query paging', () => {
492
- const listBatchSize = 2;
493
- const numInstances = listBatchSize * 2 + 1;
494
- const numLeased = Math.floor(numInstances / 2);
495
- beforeEach(async () => {
496
- const repo2 = await dynamodb_repo_1.repo({ ...repoOpts(), listBatchSize });
497
- pool = await repo2.pool(types_2.myTypeName);
498
- await promise_series_1.default(() => pool.register(types_2.myVal), numInstances);
499
- await promise_series_1.default(() => pool.lease(timeout), numLeased);
500
- listResult = await async_to_array_1.default(pool);
501
- });
502
- it('should return all instances', () => {
503
- expect(listResult).toHaveLength(numInstances);
504
- expect(listResult.filter(r => r.status === 'leased')).toHaveLength(numLeased);
505
- });
506
- });
507
- });
508
- describe('clear', () => {
509
- const NUM_ENTRIES_OF_THIS_TYPE = 30;
510
- beforeEach(async () => {
511
- await Promise.all(repeat_1.default(NUM_ENTRIES_OF_THIS_TYPE, () => pool.register(types_2.myVal)));
512
- expect(await async_to_array_1.default(pool)).toHaveLength(30);
513
- });
514
- describe('when there are other typeNames in the table', () => {
515
- const NUM_ENTRIES_OF_OTHER_TYPE = 10;
516
- let pool2;
517
- const typeName2 = 'myOtherType';
518
- beforeEach(async () => {
519
- pool2 = await repo.pool(typeName2);
520
- await Promise.all(repeat_1.default(NUM_ENTRIES_OF_OTHER_TYPE, () => pool2.register({})));
521
- await pool.clear();
522
- });
523
- it('deletes all entries for the type associated with the pool', async () => {
524
- expect(await async_to_array_1.default(pool)).toHaveLength(0);
525
- });
526
- it('does not delete entries for the type associated with the pool', async () => {
527
- expect(await async_to_array_1.default(pool2)).toHaveLength(NUM_ENTRIES_OF_OTHER_TYPE);
528
- });
529
- });
530
- });
531
- });
532
- });
533
- //# sourceMappingURL=dynamodb_repo.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dynamodb_repo.test.js","sourceRoot":"","sources":["../../../../test/lib/dynamodb/dynamodb_repo.test.ts"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;EAcE;AACF,8DAEiC;AACjC,mDAA2C;AAC3C,2EAGgD;AAChD,8CAG2B;AAC3B,mCAAwD;AACxD,uCAAuD;AACvD,gFAAsD;AACtD,gEAAuC;AACvC,gFAAqD;AAErD,MAAM,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CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;oBAC7E,MAAM,CAAC,MAAM,wBAAY,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAA;gBAC3E,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,9 +0,0 @@
1
- import BaseDynaliteEnvironment from 'jest-dynalite/dist/environment';
2
- import { DynamoEnvironment } from './types';
3
- export default class Environment extends BaseDynaliteEnvironment {
4
- static dynaliteEnv(): DynamoEnvironment;
5
- static realDynamoEnv(): DynamoEnvironment;
6
- setup(): Promise<void>;
7
- teardown(): Promise<void>;
8
- }
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../test/lib/dynamodb/environment/index.ts"],"names":[],"mappings":"AAgBA,OAAO,uBAAuB,MAAM,gCAAgC,CAAA;AAMpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,uBAAuB;IAC9D,MAAM,CAAC,WAAW,IAAI,iBAAiB;IAcvC,MAAM,CAAC,aAAa,IAAI,iBAAiB;IAanC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAWhC"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /*
7
- * Copyright 2023 Salto Labs Ltd.
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with
11
- * the License. You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- // eslint-disable-next-line no-restricted-imports
22
- const environment_1 = __importDefault(require("jest-dynalite/dist/environment"));
23
- const dynamodb_repo_1 = require("../../../../src/lib/dynamodb/dynamodb_repo");
24
- const random_string_1 = __importDefault(require("../../../utils/random_string"));
25
- const utils_1 = require("../utils");
26
- class Environment extends environment_1.default {
27
- static dynaliteEnv() {
28
- const serviceOpts = {
29
- endpoint: process.env.MOCK_DYNAMODB_ENDPOINT,
30
- sslEnabled: false,
31
- region: 'local',
32
- };
33
- return {
34
- tableName: dynamodb_repo_1.repo.DEFAULT_OPTS.tableName,
35
- dynamo: dynamodb_repo_1.dynamoDbInstances({ serviceOpts }),
36
- serviceOpts,
37
- };
38
- }
39
- static realDynamoEnv() {
40
- const workerId = process.env.JEST_WORKER_ID;
41
- const serviceOpts = {
42
- region: process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || 'eu-west-1',
43
- };
44
- return {
45
- tableName: `test_${dynamodb_repo_1.repo.DEFAULT_OPTS.tableName}_${workerId}_${random_string_1.default()}`,
46
- dynamo: dynamodb_repo_1.dynamoDbInstances({ serviceOpts }),
47
- serviceOpts,
48
- };
49
- }
50
- async setup() {
51
- await super.setup();
52
- this.global.dynamoEnv = {
53
- real: process.env.REAL_DYNAMODB ? Environment.realDynamoEnv() : undefined,
54
- dynalite: Environment.dynaliteEnv(),
55
- };
56
- }
57
- async teardown() {
58
- await super.teardown();
59
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
60
- // @ts-ignore
61
- const realEnv = this.global.dynamoEnv.real;
62
- if (realEnv) {
63
- const { dynamo, tableName } = realEnv;
64
- await utils_1.testDbUtils(dynamo.db).deleteTable(tableName);
65
- }
66
- delete this.global.dynamoEnv;
67
- }
68
- }
69
- exports.default = Environment;
70
- //# sourceMappingURL=index.js.map