Files
openobserve/tests/test-data/sdr_test_data.json
T
Shrinath Rao f61b715a1e test: Cleanup Mechanism and ENV Runs for e2e tests (#8839)
### **PR Type**
Enhancement, Tests


___

### **Description**
- Add robust alerts cleanup utilities

- Improve UI flows and resiliency

- Support deployed env testing delays

- Add CI cleanup and health checks


___

### Diagram Walkthrough


```mermaid
flowchart LR
  UI["Playwright UI flows hardened"]
  API["APICleanup cascade (Alerts→Folders→Destinations→Templates)"]
  CI["CI workflow targets deployed env"]
  Delay["Configurable test step delay"]
  Data["Global ingestion more robust"]

  UI -- "uses" --> API
  CI -- "runs cleanup.spec" --> API
  CI -- "health checks + env vars" --> Data
  Delay -- "slows page ops" --> UI
  Data -- "ingest logs with parsing" --> UI
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>7
files</summary><table>
<tr>
<td><strong>alertDestinationsPage.js</strong><dd><code>Add search,
cascade-safe delete, bulk prefix cleanup</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-57e5c53b4ef998b3d8708149620ff94dcc46807927f1a3a9e9f28ed3ebe25b0a">+178/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>alertTemplatesPage.js</strong><dd><code>Add template search,
in-use handling, prefix cleanup</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-f4ebd248b2140051e74dbbbd1aabe344f01c80704ce5857e9c28a04350e018f3">+177/-2</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>alertsPage.js</strong><dd><code>Harden alert actions, bulk
deletion, search across folders</code></dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-79ee01d6d7f145f19207b93b87143b545a1188cfc6a82bc8c45fecfbf68f8a1d">+280/-9</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>apiCleanup.js</strong><dd><code>New API-based cascade
cleanup utility</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-537fe76c0d8e26e81c5f77c83bd0ee35daaa973822105c809bf83171a26b33c5">+399/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>page-manager.js</strong><dd><code>Wire APICleanup into
PageManager</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-565eab8b3c767ae50c9d05e591621d14f66b81af84d6b5ea6efe136c1c3933df">+4/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>baseFixtures.js</strong><dd><code>Add configurable test step
delay hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-c4c5ee7fbb248d1ab14d3d4e33ffb9626f9aab74c9e0207fcfc08051c8c3c7ee">+46/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>global-setup.js</strong><dd><code>Harden login and ingestion
with diagnostics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-06323dad7214f86b41b62e121e716eeea0054bc4d950c6bcf4a0efe53894acc8">+61/-22</a>&nbsp;
</td>

</tr>
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>1 files</summary><table>
<tr>
<td><strong>commonActions.js</strong><dd><code>Fix ingestion URLs to use
org variable</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-4d726dd2bdb34b2c90a31798ff49b6df5bc952bd049b7c38bebb18b6db0076e2">+4/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>4
files</summary><table>
<tr>
<td><strong>alerts-e2e-flow.spec.js</strong><dd><code>Pre-move folder
cleanup and stabilization</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-32972e38c1fe0e8bb887f9f254b3130916a36f96ea924f9987493d44efefeab9">+13/-3</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>alerts-import.spec.js</strong><dd><code>Use dedicated
invalid import test data</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-62b6ec4818685eacc0a934d68aaadfd73b512ef4f4be25fcd5135b97c2844912">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>cleanup.spec.js</strong><dd><code>New pre-test API cleanup
spec</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-c214275a512fa285a7e4f2ab61dfcb42d71a0436b0e4241f94d7b45693587983">+29/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>invalid-alert.json</strong><dd><code>Add invalid alert
sample for import tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-c695f71048e9393a45d3e3e3e415696559fecf3ba85712e7c3f366092f53f424">+24/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
<td><strong>playwright.yml</strong><dd><code>Target deployed env; add
cleanup job and health checks</code>&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8839/files#diff-7afcd2d8f7b49bda74843f209eefb7b2da45f7e7803bf2e4bd636699b76aa2d3">+123/-65</a></td>

</tr>
</table></details></td></tr></tr></tbody></table>

</details>

___
2025-11-04 23:54:54 +05:30

349 lines
10 KiB
JSON

{
"regexPatterns": [
{
"name": "email_format",
"description": "Email address validation pattern",
"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,}$",
"testField": "user_email",
"validData": "john.doe@example.com",
"invalidData": "notanemail"
},
{
"name": "email_format_redact",
"description": "Email address validation pattern (for redaction tests)",
"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,}$",
"testField": "user_email",
"validData": "john.doe@example.com",
"invalidData": "notanemail"
},
{
"name": "us_phone",
"description": "US phone number (10 digits)",
"pattern": "^\\d{10}$",
"testField": "phone",
"validData": "5551234567",
"invalidData": "123"
},
{
"name": "us_phone_redact",
"description": "US phone number (10 digits) (for redaction tests)",
"pattern": "^\\d{10}$",
"testField": "phone",
"validData": "5551234567",
"invalidData": "123"
},
{
"name": "url_format",
"description": "URL validation pattern",
"pattern": "^https?://[\\w.-]+\\.[\\w.-]+.*$",
"testField": "website_url",
"validData": "https://openobserve.ai/docs",
"invalidData": "not-a-url"
},
{
"name": "url_format_drop",
"description": "URL validation pattern (for drop tests)",
"pattern": "^https?://[\\w.-]+\\.[\\w.-]+.*$",
"testField": "website_url",
"validData": "https://openobserve.ai/docs",
"invalidData": "not-a-url"
},
{
"name": "strong_password",
"description": "Strong password pattern (8+ chars with mixed case, digit, special char)",
"pattern": "^[A-Za-z0-9@$!%*?&]{8,}$",
"testField": "user_password",
"validData": "Xyz@1234",
"invalidData": "weak"
},
{
"name": "strong_password_drop",
"description": "Strong password pattern (for drop tests)",
"pattern": "^[A-Za-z0-9@$!%*?&]{8,}$",
"testField": "user_password",
"validData": "Xyz@1234",
"invalidData": "weak"
},
{
"name": "hex_color",
"description": "Hexadecimal color code",
"pattern": "^#[0-9a-fA-F]{6}$",
"testField": "theme_color",
"validData": "#1A2b3C",
"invalidData": "#GGGGGG"
},
{
"name": "hex_color_drop",
"description": "Hexadecimal color code (for drop tests)",
"pattern": "^#[0-9a-fA-F]{6}$",
"testField": "theme_color",
"validData": "#1A2b3C",
"invalidData": "#GGGGGG"
},
{
"name": "ipv4_address",
"description": "IPv4 address format",
"pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$",
"testField": "server_ip",
"validData": "192.168.1.100",
"invalidData": "999.999.999.999"
},
{
"name": "ipv4_address_drop",
"description": "IPv4 address format (for drop tests)",
"pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$",
"testField": "server_ip",
"validData": "192.168.1.100",
"invalidData": "999.999.999.999"
},
{
"name": "date_yyyy_mm_dd",
"description": "Date in YYYY-MM-DD format",
"pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
"testField": "event_date",
"validData": "2025-07-08",
"invalidData": "2025-13-45"
},
{
"name": "credit_card",
"description": "Credit card number format",
"pattern": "^\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}$",
"testField": "cc_number",
"validData": "1234 5678 9012 3456",
"invalidData": "123"
},
{
"name": "credit_card_redact",
"description": "Credit card number format (for redaction tests)",
"pattern": "^\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}$",
"testField": "cc_number",
"validData": "1234 5678 9012 3456",
"invalidData": "123"
},
{
"name": "ssn",
"description": "US Social Security Number",
"pattern": "^\\d{3}-\\d{2}-\\d{4}$",
"testField": "ssn",
"validData": "123-45-6789",
"invalidData": "123"
},
{
"name": "ssn_redact",
"description": "US Social Security Number (for redaction tests)",
"pattern": "^\\d{3}-\\d{2}-\\d{4}$",
"testField": "ssn",
"validData": "123-45-6789",
"invalidData": "123"
},
{
"name": "pin_code",
"description": "Indian PIN code (6 digits)",
"pattern": "^\\d{6}$",
"testField": "postal_code",
"validData": "560001",
"invalidData": "12345"
},
{
"name": "phone_country_code",
"description": "Phone with country code +91",
"pattern": "^\\+91[-\\s]?[6-9]\\d{9}$",
"testField": "mobile_with_code",
"validData": "+91-9876543210",
"invalidData": "+91-1234567890"
},
{
"name": "percentage_format",
"description": "Percentage value",
"pattern": "\\b\\d{1,3}%\\b",
"testField": "cpu_usage",
"validData": "87%",
"invalidData": "1000%"
},
{
"name": "url_format_query_drop",
"description": "URL validation pattern (for query time drop tests)",
"pattern": "^https?://[\\w.-]+\\.[\\w.-]+.*$",
"testField": "website_url",
"validData": "https://openobserve.ai/docs",
"invalidData": "not-a-url"
},
{
"name": "strong_password_query_drop",
"description": "Strong password pattern (for query time drop tests)",
"pattern": "^[A-Za-z0-9@$!%*?&]{8,}$",
"testField": "user_password",
"validData": "Xyz@1234",
"invalidData": "weak"
},
{
"name": "ipv4_address_query_drop",
"description": "IPv4 address format (for query time drop tests)",
"pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$",
"testField": "server_ip",
"validData": "192.168.1.100",
"invalidData": "999.999.999.999"
},
{
"name": "hex_color_query_drop",
"description": "Hexadecimal color code (for query time drop tests)",
"pattern": "^#[0-9a-fA-F]{6}$",
"testField": "theme_color",
"validData": "#1A2b3C",
"invalidData": "#GGGGGG"
},
{
"name": "email_format_query_redact",
"description": "Email address validation pattern (for query time redaction tests)",
"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,}$",
"testField": "user_email",
"validData": "john.doe@example.com",
"invalidData": "notanemail"
},
{
"name": "us_phone_query_redact",
"description": "US phone number (10 digits) (for query time redaction tests)",
"pattern": "^\\d{10}$",
"testField": "phone",
"validData": "5551234567",
"invalidData": "123"
},
{
"name": "credit_card_query_redact",
"description": "Credit card number format (for query time redaction tests)",
"pattern": "^\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}$",
"testField": "cc_number",
"validData": "1234 5678 9012 3456",
"invalidData": "123"
},
{
"name": "ssn_query_redact",
"description": "US Social Security Number (for query time redaction tests)",
"pattern": "^\\d{3}-\\d{2}-\\d{4}$",
"testField": "ssn",
"validData": "123-45-6789",
"invalidData": "123"
},
{
"name": "url_format_hash",
"description": "URL validation pattern (for hash tests)",
"pattern": "^https?://[\\w.-]+\\.[\\w.-]+.*$",
"testField": "website_url",
"validData": "https://openobserve.ai/docs",
"invalidData": "not-a-url"
},
{
"name": "strong_password_hash",
"description": "Strong password pattern (for hash tests)",
"pattern": "^[A-Za-z0-9@$!%*?&]{8,}$",
"testField": "user_password",
"validData": "Xyz@1234",
"invalidData": "weak"
},
{
"name": "ipv4_address_hash",
"description": "IPv4 address format (for hash tests)",
"pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$",
"testField": "server_ip",
"validData": "192.168.1.100",
"invalidData": "999.999.999.999"
},
{
"name": "hex_color_hash",
"description": "Hexadecimal color code (for hash tests)",
"pattern": "^#[0-9a-fA-F]{6}$",
"testField": "theme_color",
"validData": "#1A2b3C",
"invalidData": "#GGGGGG"
},
{
"name": "email_format_query_hash",
"description": "Email address validation pattern (for query time hash tests)",
"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,}$",
"testField": "user_email",
"validData": "john.doe@example.com",
"invalidData": "notanemail"
},
{
"name": "us_phone_query_hash",
"description": "US phone number (10 digits) (for query time hash tests)",
"pattern": "^\\d{10}$",
"testField": "phone",
"validData": "5551234567",
"invalidData": "123"
},
{
"name": "credit_card_query_hash",
"description": "Credit card number format (for query time hash tests)",
"pattern": "^\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}$",
"testField": "cc_number",
"validData": "1234 5678 9012 3456",
"invalidData": "123"
},
{
"name": "ssn_query_hash",
"description": "US Social Security Number (for query time hash tests)",
"pattern": "^\\d{3}-\\d{2}-\\d{4}$",
"testField": "ssn",
"validData": "123-45-6789",
"invalidData": "123"
}
],
"ingestionData": {
"withSensitiveFields": [
{
"level": "info",
"user_email": "john.doe@example.com",
"phone": "9876543210",
"log": "User login successful"
},
{
"level": "info",
"website_url": "https://openobserve.ai/docs",
"user_password": "Xyz@1234",
"log": "Password reset initiated"
},
{
"level": "info",
"theme_color": "#1A2b3C",
"server_ip": "192.168.1.100",
"log": "Theme preferences updated"
},
{
"level": "info",
"event_date": "2025-07-08",
"cc_number": "1234 5678 9012 3456",
"log": "Payment processed"
},
{
"level": "info",
"pan": "ABCDE1234F",
"postal_code": "560001",
"log": "KYC verification completed"
},
{
"level": "info",
"mobile_with_code": "+91-9876543210",
"cpu_usage": "87%",
"log": "System metrics report"
}
],
"withoutSensitiveFields": [
{
"level": "info",
"username": "testuser",
"action": "login",
"log": "Regular log entry without sensitive data"
}
]
},
"queryTestData": {
"searchQueries": [
"user_email: *",
"phone: *",
"cc_number: *",
"pan: *"
]
}
}