@durable-streams/client-conformance-tests 0.1.6 → 0.1.7

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 (29) hide show
  1. package/dist/adapters/typescript-adapter.cjs +75 -3
  2. package/dist/adapters/typescript-adapter.js +76 -4
  3. package/dist/{benchmark-runner-D-YSAvRy.js → benchmark-runner-CrE6JkbX.js} +86 -8
  4. package/dist/{benchmark-runner-BlKqhoXE.cjs → benchmark-runner-Db4he452.cjs} +87 -8
  5. package/dist/cli.cjs +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.d.cts +106 -6
  9. package/dist/index.d.ts +106 -6
  10. package/dist/index.js +1 -1
  11. package/dist/{protocol-3cf94Xyb.d.cts → protocol-D37G3c4e.d.cts} +80 -4
  12. package/dist/{protocol-DyEvTHPF.d.ts → protocol-Mcbiq3nQ.d.ts} +80 -4
  13. package/dist/protocol.d.cts +2 -2
  14. package/dist/protocol.d.ts +2 -2
  15. package/package.json +3 -3
  16. package/src/adapters/typescript-adapter.ts +127 -6
  17. package/src/protocol.ts +85 -1
  18. package/src/runner.ts +178 -13
  19. package/src/test-cases.ts +110 -3
  20. package/test-cases/consumer/error-handling.yaml +42 -0
  21. package/test-cases/consumer/offset-handling.yaml +209 -0
  22. package/test-cases/producer/idempotent/autoclaim.yaml +214 -0
  23. package/test-cases/producer/idempotent/batching.yaml +98 -0
  24. package/test-cases/producer/idempotent/concurrent-requests.yaml +100 -0
  25. package/test-cases/producer/idempotent/epoch-management.yaml +333 -0
  26. package/test-cases/producer/idempotent/error-handling.yaml +194 -0
  27. package/test-cases/producer/idempotent/multi-producer.yaml +322 -0
  28. package/test-cases/producer/idempotent/sequence-validation.yaml +339 -0
  29. package/test-cases/producer/idempotent-json-batching.yaml +134 -0
@@ -0,0 +1,134 @@
1
+ id: idempotent-json-batching
2
+ name: Idempotent Producer JSON Batching
3
+ description: Tests for client-side JSON batching in IdempotentProducer
4
+ category: producer
5
+ tags:
6
+ - idempotent
7
+ - json
8
+ - batching
9
+
10
+ tests:
11
+ - id: json-batch-single-item
12
+ name: Single JSON item via IdempotentProducer
13
+ description: A single JSON value should be wrapped in array and stored correctly
14
+ setup:
15
+ - action: create
16
+ as: streamPath
17
+ contentType: application/json
18
+ operations:
19
+ - action: idempotent-append
20
+ path: ${streamPath}
21
+ producerId: test-producer
22
+ epoch: 0
23
+ data: '{"message": "hello"}'
24
+ expect:
25
+ status: 200
26
+ - action: read
27
+ path: ${streamPath}
28
+ expect:
29
+ # JSON streams return data as array
30
+ data: '[{"message":"hello"}]'
31
+ upToDate: true
32
+
33
+ - id: json-batch-multiple-items
34
+ name: Multiple JSON items batched via IdempotentProducer
35
+ description: Multiple JSON values should be batched into single request and stored as separate entries
36
+ setup:
37
+ - action: create
38
+ as: streamPath
39
+ contentType: application/json
40
+ operations:
41
+ - action: idempotent-append-batch
42
+ path: ${streamPath}
43
+ producerId: test-producer
44
+ epoch: 0
45
+ items:
46
+ - data: '{"id": 1}'
47
+ - data: '{"id": 2}'
48
+ - data: '{"id": 3}'
49
+ expect:
50
+ allSucceed: true
51
+ - action: read
52
+ path: ${streamPath}
53
+ expect:
54
+ # Each item should be stored separately, read back as JSON array
55
+ dataContainsAll:
56
+ - '"id":1'
57
+ - '"id":2'
58
+ - '"id":3'
59
+ upToDate: true
60
+
61
+ - id: json-batch-nested-arrays
62
+ name: JSON arrays batched correctly
63
+ description: Batched JSON arrays should each be stored as single entries, not flattened further
64
+ setup:
65
+ - action: create
66
+ as: streamPath
67
+ contentType: application/json
68
+ operations:
69
+ - action: idempotent-append-batch
70
+ path: ${streamPath}
71
+ producerId: test-producer
72
+ epoch: 0
73
+ items:
74
+ - data: "[1, 2, 3]"
75
+ - data: "[4, 5, 6]"
76
+ expect:
77
+ allSucceed: true
78
+ - action: read
79
+ path: ${streamPath}
80
+ expect:
81
+ # Each array should be stored as a single entry (JSON normalized without spaces)
82
+ dataContainsAll:
83
+ - "[1,2,3]"
84
+ - "[4,5,6]"
85
+ upToDate: true
86
+
87
+ - id: json-batch-mixed-types
88
+ name: Mixed JSON types batched correctly
89
+ description: Batched values of different JSON types should each be stored correctly
90
+ setup:
91
+ - action: create
92
+ as: streamPath
93
+ contentType: application/json
94
+ operations:
95
+ - action: idempotent-append-batch
96
+ path: ${streamPath}
97
+ producerId: test-producer
98
+ epoch: 0
99
+ items:
100
+ - data: "42"
101
+ - data: '"string"'
102
+ - data: "null"
103
+ - data: "true"
104
+ - data: '{"obj": 1}'
105
+ expect:
106
+ allSucceed: true
107
+ - action: read
108
+ path: ${streamPath}
109
+ expect:
110
+ upToDate: true
111
+
112
+ - id: bytes-batch-concatenates
113
+ name: Byte stream batching concatenates data
114
+ description: For non-JSON streams, batched items should be concatenated
115
+ setup:
116
+ - action: create
117
+ as: streamPath
118
+ contentType: text/plain
119
+ operations:
120
+ - action: idempotent-append-batch
121
+ path: ${streamPath}
122
+ producerId: test-producer
123
+ epoch: 0
124
+ items:
125
+ - data: "Hello"
126
+ - data: " "
127
+ - data: "World"
128
+ expect:
129
+ allSucceed: true
130
+ - action: read
131
+ path: ${streamPath}
132
+ expect:
133
+ data: "Hello World"
134
+ upToDate: true