openobserve/tests/api-testing/helpers
Shrinath Rao b0118090e1
test: api-testing follow-ups — pytest-xdist dep + standardize test user display name (#12393)
## Summary

Companion PR to o2-enterprise PR 1841 (api-testing follow-ups). All
ENT-side test/CI work lands there; this OSS PR carries the two changes
that must live on the OSS side because they touch shared code.

Both PRs live on the same-named branch (`test/api-test-followups`) so
ENT CI's cp-merge picks up this branch and sees both changes together.

## What's in this PR

### 1 — Add `pytest-xdist` dependency

Adds `pytest-xdist>=3.0` to `tests/api-testing/pyproject.toml`. Needed
by the ENT api-testing CI's `api_integration / ent_rbac` shard to run
RBAC tests in parallel (`-n 4`).

CI-verified speedup: **~70 s → 21.7 s (~69% reduction)** on the ENT RBAC
shard's 280+ tests, with zero failures.

Foundation only — no test code in this repo uses xdist yet. Available
for any future shard that wants it.

### 2 — Standardize automated-test user display name to "Automation
TestUser"

Two helper files in `tests/api-testing/helpers/workflow/pages/` had a
personal name (`"Shyam P"` / `"Shyam Panjiyar"`) hardcoded in their user
/ service-account create payloads. Those helpers are consumed by the
workflow chain (`helpers/workflow/create_objects.py` +
`edit_objects.py`), which doesn't reliably clean up its created users —
so the names persisted in the IAM users page and looked confusingly like
real teammates' accounts.

Files changed:
- `tests/api-testing/helpers/workflow/pages/user_page.py`
- `tests/api-testing/helpers/workflow/pages/serviceaccount_page.py`

Both now use:

```
first_name: "Automation"
last_name:  "TestUser"
```

Convention going forward: any account named `Automation TestUser` in the
IAM users page is automatically identifiable as test-created and safe to
clean up. Email addresses still use random suffixes
(`d4m21_{random_int}`) so uniqueness isn't affected — only the display
name standardizes.

## Test plan

- [ ] CI green on this branch
- [ ] Companion ENT PR 1841 (which depends on the `pytest-xdist` dep
added here) stays green

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 01:55:01 +00:00
..
workflow test: api-testing follow-ups — pytest-xdist dep + standardize test user display name (#12393) 2026-06-02 01:55:01 +00:00
__init__.py test: revamp api-testing suite (framework + 16 file rewrites + CI matrix) (#12372) 2026-06-01 07:19:48 +00:00
sourcemap_helpers.py test: revamp api-testing suite (framework + 16 file rewrites + CI matrix) (#12372) 2026-06-01 07:19:48 +00:00