mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-03 16:10:21 +00:00
## Summary - Add comprehensive E2E test coverage for RUM sourcemap functionality (26 total tests) - API tests: 20 pytest tests (upload/list/delete/resolve operations + RBAC) - UI tests: 6 Playwright tests for error tracking UI - Helper scripts for RUM data ingestion ## Implementation Details ### API Tests (pytest) - **test_sourcemap_api.py**: 15 tests covering: - Sourcemap upload (multipart/form-data) - List sourcemaps - Delete sourcemaps - Stacktrace resolution with sourcemaps - **test_sourcemap_rbac.py**: 5 tests for role-based access control - **ingest_rum_errors.py**: Helper to inject synthetic RUM error data for UI tests - **ingest_rum_performance.py**: Helper to enable RUM feature in UI ### UI Tests (Playwright) - **sourcemap-ui.spec.js**: 6 tests validating: - Error tracking page loads - Query execution - Error list display - Error detail navigation - Metadata display - Stack trace display - **rumPage.js**: Updated page object with API response interception - Workaround for Vue 3 @click handlers not responding to Playwright clicks - Navigate via URL using error IDs extracted from API responses - Tests run in **parallel mode** with proper assertions (no graceful skips) ## Test Execution ```bash # API tests (pytest) cd tests/api-testing pytest tests/test_sourcemap_api.py -v # 15 tests pytest tests/test_sourcemap_rbac.py -v # 5 tests # UI tests (Playwright) cd tests/ui-testing npx playwright test playwright-tests/RUM/sourcemap-ui.spec.js --workers=3 # 6 tests ``` ## Technical Notes - Vue 3 production builds don't respond to Playwright's synthetic click events on @click handlers - Solution: Intercept API responses to extract error IDs, then navigate directly via URL - All tests use hard assertions - tests fail if data doesn't exist (no graceful skips) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Shrinath Rao <undefined@users.noreply.github.com>
93 lines
2.2 KiB
JSON
93 lines
2.2 KiB
JSON
{
|
|
"typeError": {
|
|
"description": "Access property on undefined",
|
|
"expected": {
|
|
"original_file": "src/errors/sync-errors.js",
|
|
"original_line": 10,
|
|
"original_column": 15,
|
|
"original_function_name": "profile",
|
|
"source_content_contains": "return user.profile.name"
|
|
}
|
|
},
|
|
"referenceError": {
|
|
"description": "Use undeclared variable",
|
|
"expected": {
|
|
"original_file": "src/errors/sync-errors.js",
|
|
"original_line": 16,
|
|
"source_content_contains": "undeclaredVariableThatDoesNotExist"
|
|
}
|
|
},
|
|
"rangeError": {
|
|
"description": "Invalid array length",
|
|
"expected": {
|
|
"original_file": "src/errors/sync-errors.js",
|
|
"original_line": 22,
|
|
"source_content_contains": "new Array(-1)"
|
|
}
|
|
},
|
|
"customError": {
|
|
"description": "Custom PaymentError class",
|
|
"expected": {
|
|
"original_file": "src/errors/sync-errors.js",
|
|
"original_line": 36,
|
|
"source_content_contains": "PaymentError"
|
|
}
|
|
},
|
|
"nestedError": {
|
|
"description": "5-deep call stack",
|
|
"expected": {
|
|
"frames": [
|
|
{
|
|
"file": "src/errors/nested-errors.js",
|
|
"line": 40,
|
|
"function": "validatePaymentAmount"
|
|
},
|
|
{
|
|
"file": "src/errors/nested-errors.js",
|
|
"line": 35,
|
|
"function": "processPayment"
|
|
},
|
|
{
|
|
"file": "src/errors/nested-errors.js",
|
|
"line": 26,
|
|
"function": "submitOrder"
|
|
},
|
|
{
|
|
"file": "src/errors/nested-errors.js",
|
|
"line": 22,
|
|
"function": "handleCheckout"
|
|
},
|
|
{
|
|
"file": "src/errors/nested-errors.js",
|
|
"line": 16,
|
|
"function": "triggerNestedError"
|
|
},
|
|
{
|
|
"file": "src/index.js",
|
|
"line": 142
|
|
},
|
|
{
|
|
"file": "src/index.js",
|
|
"line": 102
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"crossChunk": {
|
|
"description": "Cross-chunk error in lazy-loaded module",
|
|
"expected": {
|
|
"frames": [
|
|
{
|
|
"file": "src/errors/lazy-module.js",
|
|
"line": 20,
|
|
"function": "triggerLazyModuleError"
|
|
},
|
|
{
|
|
"file": "src/index.js",
|
|
"line": 157
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|