Skip to content

Commit 4e8ac51

Browse files
committed
tests: updated test assertions
1 parent 74b1a68 commit 4e8ac51

File tree

4 files changed

+78
-78
lines changed

4 files changed

+78
-78
lines changed

dev-packages/e2e-tests/test-applications/nuxt-3/tests/storage-aliases.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
3131
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
34-
'nuxt.storage.op': 'setItem',
35-
'nuxt.storage.mount': 'test-storage:',
36-
'nuxt.storage.driver': 'memory',
34+
'db.operation.name': 'setItem',
35+
'db.collection.name': 'test-storage:',
36+
'db.system.name': 'memory',
3737
});
3838
expect(setSpan?.description).toBe(prefixKey('alias:user'));
3939

@@ -47,9 +47,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
4747
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
4848
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
4949
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
50-
'nuxt.storage.op': 'getItem',
51-
'nuxt.storage.mount': 'test-storage:',
52-
'nuxt.storage.driver': 'memory',
50+
'db.operation.name': 'getItem',
51+
'db.collection.name': 'test-storage:',
52+
'db.system.name': 'memory',
5353
});
5454
expect(getSpan?.description).toBe(prefixKey('alias:user'));
5555

@@ -63,9 +63,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
6363
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
6565
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
66-
'nuxt.storage.op': 'hasItem',
67-
'nuxt.storage.mount': 'test-storage:',
68-
'nuxt.storage.driver': 'memory',
66+
'db.operation.name': 'hasItem',
67+
'db.collection.name': 'test-storage:',
68+
'db.system.name': 'memory',
6969
});
7070

7171
// Test del and remove (both aliases for removeItem)
@@ -78,9 +78,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
7878
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
7979
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
8080
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp1'),
81-
'nuxt.storage.op': 'removeItem',
82-
'nuxt.storage.mount': 'test-storage:',
83-
'nuxt.storage.driver': 'memory',
81+
'db.operation.name': 'removeItem',
82+
'db.collection.name': 'test-storage:',
83+
'db.system.name': 'memory',
8484
});
8585
expect(delSpan?.description).toBe(prefixKey('alias:temp1'));
8686

@@ -90,9 +90,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
9090
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
9191
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
9292
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp2'),
93-
'nuxt.storage.op': 'removeItem',
94-
'nuxt.storage.mount': 'test-storage:',
95-
'nuxt.storage.driver': 'memory',
93+
'db.operation.name': 'removeItem',
94+
'db.collection.name': 'test-storage:',
95+
'db.system.name': 'memory',
9696
});
9797
expect(removeSpan?.description).toBe(prefixKey('alias:temp2'));
9898

dev-packages/e2e-tests/test-applications/nuxt-3/tests/storage.test.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ test.describe('Storage Instrumentation', () => {
3131
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
34-
'nuxt.storage.op': 'setItem',
35-
'nuxt.storage.mount': 'test-storage:',
36-
'nuxt.storage.driver': 'memory',
34+
'db.operation.name': 'setItem',
35+
'db.collection.name': 'test-storage:',
36+
'db.system.name': 'memory',
3737
});
3838
expect(setItemSpan?.description).toBe(prefixKey('user:123'));
3939

@@ -48,9 +48,9 @@ test.describe('Storage Instrumentation', () => {
4848
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item_raw',
4949
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
5050
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
51-
'nuxt.storage.op': 'setItemRaw',
52-
'nuxt.storage.mount': 'test-storage:',
53-
'nuxt.storage.driver': 'memory',
51+
'db.operation.name': 'setItemRaw',
52+
'db.collection.name': 'test-storage:',
53+
'db.system.name': 'memory',
5454
});
5555

5656
// Test hasItem spans - should have cache hit attribute
@@ -63,9 +63,9 @@ test.describe('Storage Instrumentation', () => {
6363
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
6565
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
66-
'nuxt.storage.op': 'hasItem',
67-
'nuxt.storage.mount': 'test-storage:',
68-
'nuxt.storage.driver': 'memory',
66+
'db.operation.name': 'hasItem',
67+
'db.collection.name': 'test-storage:',
68+
'db.system.name': 'memory',
6969
});
7070

7171
// Test getItem spans - should have cache hit attribute
@@ -78,9 +78,9 @@ test.describe('Storage Instrumentation', () => {
7878
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
7979
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
8080
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
81-
'nuxt.storage.op': 'getItem',
82-
'nuxt.storage.mount': 'test-storage:',
83-
'nuxt.storage.driver': 'memory',
81+
'db.operation.name': 'getItem',
82+
'db.collection.name': 'test-storage:',
83+
'db.system.name': 'memory',
8484
});
8585
expect(getItemSpan?.description).toBe(prefixKey('user:123'));
8686

@@ -96,9 +96,9 @@ test.describe('Storage Instrumentation', () => {
9696
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
9797
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
9898
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
99-
'nuxt.storage.op': 'getItemRaw',
100-
'nuxt.storage.mount': 'test-storage:',
101-
'nuxt.storage.driver': 'memory',
99+
'db.operation.name': 'getItemRaw',
100+
'db.collection.name': 'test-storage:',
101+
'db.system.name': 'memory',
102102
});
103103

104104
// Test getKeys spans
@@ -107,9 +107,9 @@ test.describe('Storage Instrumentation', () => {
107107
expect(getKeysSpans[0]?.data).toMatchObject({
108108
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_keys',
109109
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
110-
'nuxt.storage.op': 'getKeys',
111-
'nuxt.storage.mount': 'test-storage:',
112-
'nuxt.storage.driver': 'memory',
110+
'db.operation.name': 'getKeys',
111+
'db.collection.name': 'test-storage:',
112+
'db.system.name': 'memory',
113113
});
114114

115115
// Test removeItem spans
@@ -123,9 +123,9 @@ test.describe('Storage Instrumentation', () => {
123123
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
124124
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
125125
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('batch:1'),
126-
'nuxt.storage.op': 'removeItem',
127-
'nuxt.storage.mount': 'test-storage:',
128-
'nuxt.storage.driver': 'memory',
126+
'db.operation.name': 'removeItem',
127+
'db.collection.name': 'test-storage:',
128+
'db.system.name': 'memory',
129129
});
130130

131131
// Test clear spans
@@ -134,9 +134,9 @@ test.describe('Storage Instrumentation', () => {
134134
expect(clearSpans[0]?.data).toMatchObject({
135135
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.clear',
136136
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
137-
'nuxt.storage.op': 'clear',
138-
'nuxt.storage.mount': 'test-storage:',
139-
'nuxt.storage.driver': 'memory',
137+
'db.operation.name': 'clear',
138+
'db.collection.name': 'test-storage:',
139+
'db.system.name': 'memory',
140140
});
141141

142142
// Verify all spans have OK status

dev-packages/e2e-tests/test-applications/nuxt-4/tests/storage-aliases.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
3131
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
34-
'nuxt.storage.op': 'setItem',
35-
'nuxt.storage.mount': 'test-storage:',
36-
'nuxt.storage.driver': 'memory',
34+
'db.operation.name': 'setItem',
35+
'db.collection.name': 'test-storage:',
36+
'db.system.name': 'memory',
3737
});
3838
expect(setSpan?.description).toBe(prefixKey('alias:user'));
3939

@@ -47,9 +47,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
4747
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
4848
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
4949
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
50-
'nuxt.storage.op': 'getItem',
51-
'nuxt.storage.mount': 'test-storage:',
52-
'nuxt.storage.driver': 'memory',
50+
'db.operation.name': 'getItem',
51+
'db.collection.name': 'test-storage:',
52+
'db.system.name': 'memory',
5353
});
5454
expect(getSpan?.description).toBe(prefixKey('alias:user'));
5555

@@ -63,9 +63,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
6363
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
6565
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
66-
'nuxt.storage.op': 'hasItem',
67-
'nuxt.storage.mount': 'test-storage:',
68-
'nuxt.storage.driver': 'memory',
66+
'db.operation.name': 'hasItem',
67+
'db.collection.name': 'test-storage:',
68+
'db.system.name': 'memory',
6969
});
7070

7171
// Test del and remove (both aliases for removeItem)
@@ -78,9 +78,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
7878
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
7979
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
8080
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp1'),
81-
'nuxt.storage.op': 'removeItem',
82-
'nuxt.storage.mount': 'test-storage:',
83-
'nuxt.storage.driver': 'memory',
81+
'db.operation.name': 'removeItem',
82+
'db.collection.name': 'test-storage:',
83+
'db.system.name': 'memory',
8484
});
8585
expect(delSpan?.description).toBe(prefixKey('alias:temp1'));
8686

@@ -90,9 +90,9 @@ test.describe('Storage Instrumentation - Aliases', () => {
9090
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
9191
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
9292
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp2'),
93-
'nuxt.storage.op': 'removeItem',
94-
'nuxt.storage.mount': 'test-storage:',
95-
'nuxt.storage.driver': 'memory',
93+
'db.operation.name': 'removeItem',
94+
'db.collection.name': 'test-storage:',
95+
'db.system.name': 'memory',
9696
});
9797
expect(removeSpan?.description).toBe(prefixKey('alias:temp2'));
9898

dev-packages/e2e-tests/test-applications/nuxt-4/tests/storage.test.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ test.describe('Storage Instrumentation', () => {
3131
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
34-
'nuxt.storage.op': 'setItem',
35-
'nuxt.storage.mount': 'test-storage:',
36-
'nuxt.storage.driver': 'memory',
34+
'db.operation.name': 'setItem',
35+
'db.collection.name': 'test-storage:',
36+
'db.system.name': 'memory',
3737
});
3838
expect(setItemSpan?.description).toBe(prefixKey('user:123'));
3939

@@ -48,9 +48,9 @@ test.describe('Storage Instrumentation', () => {
4848
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item_raw',
4949
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
5050
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
51-
'nuxt.storage.op': 'setItemRaw',
52-
'nuxt.storage.mount': 'test-storage:',
53-
'nuxt.storage.driver': 'memory',
51+
'db.operation.name': 'setItemRaw',
52+
'db.collection.name': 'test-storage:',
53+
'db.system.name': 'memory',
5454
});
5555

5656
// Test hasItem spans - should have cache hit attribute
@@ -63,9 +63,9 @@ test.describe('Storage Instrumentation', () => {
6363
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
6565
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
66-
'nuxt.storage.op': 'hasItem',
67-
'nuxt.storage.mount': 'test-storage:',
68-
'nuxt.storage.driver': 'memory',
66+
'db.operation.name': 'hasItem',
67+
'db.collection.name': 'test-storage:',
68+
'db.system.name': 'memory',
6969
});
7070

7171
// Test getItem spans - should have cache hit attribute
@@ -78,9 +78,9 @@ test.describe('Storage Instrumentation', () => {
7878
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
7979
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
8080
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
81-
'nuxt.storage.op': 'getItem',
82-
'nuxt.storage.mount': 'test-storage:',
83-
'nuxt.storage.driver': 'memory',
81+
'db.operation.name': 'getItem',
82+
'db.collection.name': 'test-storage:',
83+
'db.system.name': 'memory',
8484
});
8585
expect(getItemSpan?.description).toBe(prefixKey('user:123'));
8686

@@ -96,9 +96,9 @@ test.describe('Storage Instrumentation', () => {
9696
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
9797
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
9898
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
99-
'nuxt.storage.op': 'getItemRaw',
100-
'nuxt.storage.mount': 'test-storage:',
101-
'nuxt.storage.driver': 'memory',
99+
'db.operation.name': 'getItemRaw',
100+
'db.collection.name': 'test-storage:',
101+
'db.system.name': 'memory',
102102
});
103103

104104
// Test getKeys spans
@@ -107,9 +107,9 @@ test.describe('Storage Instrumentation', () => {
107107
expect(getKeysSpans[0]?.data).toMatchObject({
108108
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_keys',
109109
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
110-
'nuxt.storage.op': 'getKeys',
111-
'nuxt.storage.mount': 'test-storage:',
112-
'nuxt.storage.driver': 'memory',
110+
'db.operation.name': 'getKeys',
111+
'db.collection.name': 'test-storage:',
112+
'db.system.name': 'memory',
113113
});
114114

115115
// Test removeItem spans
@@ -123,9 +123,9 @@ test.describe('Storage Instrumentation', () => {
123123
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
124124
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
125125
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('batch:1'),
126-
'nuxt.storage.op': 'removeItem',
127-
'nuxt.storage.mount': 'test-storage:',
128-
'nuxt.storage.driver': 'memory',
126+
'db.operation.name': 'removeItem',
127+
'db.collection.name': 'test-storage:',
128+
'db.system.name': 'memory',
129129
});
130130

131131
// Test clear spans
@@ -134,9 +134,9 @@ test.describe('Storage Instrumentation', () => {
134134
expect(clearSpans[0]?.data).toMatchObject({
135135
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.clear',
136136
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
137-
'nuxt.storage.op': 'clear',
138-
'nuxt.storage.mount': 'test-storage:',
139-
'nuxt.storage.driver': 'memory',
137+
'db.operation.name': 'clear',
138+
'db.collection.name': 'test-storage:',
139+
'db.system.name': 'memory',
140140
});
141141

142142
// Verify all spans have OK status

0 commit comments

Comments
 (0)