Skip to content

test(e2e): people journeys (segments) - #1170

Open
mortondev wants to merge 2 commits into
mainfrom
test/product-e2e-people-segments
Open

mortondev wants to merge 2 commits into
mainfrom
test/product-e2e-people-segments

Conversation

@mortondev

Copy link
Copy Markdown
Member

End-to-end journeys for People: segments (PPL-G), part 2 of 3. Users and companies are in #1156. Team access and portal account pages follow in their own PR.

Covered

  • people/segments.spec.ts
    • @core: PPL-G-01, G-03, G-05, G-06, G-07, G-08, G-17, G-20, G-21, G-22, G-25, G-27, G-28, G-30, G-44
    • @nightly: PPL-G-02, G-09, G-11, G-12, G-13, G-19, G-23, G-31, G-45
  • people/segment-access.spec.ts: PPL-G-34 (@smoke), G-35, G-36 (@core), G-38 (@core @isolated, private portal with allowed segments)
  • people/segments.serial.spec.ts: PPL-G-50 (@nightly, quarantined)

Helpers: apps/web/e2e/product/people-segments.ts.

Harness change (small, additive)

  • The sweep runner (src/lib/server/e2e-harness/sweeps.ts) gains segment-evaluation: one pass of the queue, running every dynamic segment the scheduler would schedule now through the queue's own handler (runSegmentEvaluation). It returns { evaluated, failed }. There is a unit test in __tests__/sweeps.test.ts, and the SweepName union in e2e/support/sweeps.ts gains the name. PPL-G-12 uses it.

Lower rows

The existing unit tests already cover these, so no new test was added:

  • PPL-G-12: segment-scheduler.test.ts
  • PPL-G-24: segment-membership.test.ts (the priority matrix)
  • PPL-G-43: segment-gate.test.ts and access.test.ts (the empty list on either side)
  • PPL-G-49: segment-attribute-values.test.ts

Quarantined (product bugs, see e2e/QUARANTINE.md)

  • PPL-G-06 (new bug): vote_count and comment_count rules query the tables votes and comments, which do not exist (segment.evaluation.ts:154/156/275/281). Every such evaluation fails with a 500. The seeded "Active Users" segment can never be evaluated.
  • PPL-G-50: evaluateAllSegmentsFn returns a 500 in every seeded workspace. It stops at the first failing segment (segment.evaluation.ts:469), and the bug above makes "Active Users" fail.
  • PPL-G-28: REST DELETE members counts non-members in removed ($slug.members.ts:153).
  • PPL-G-30: a body that is not JSON returns 500 ($slug.members.ts:71, :124).
  • PPL-G-11: evaluation reports a matching api/widget member as added on every run (segment.evaluation.ts:431).
  • PPL-G-13: CRON_REGEX accepts patterns that parseCron rejects, so the segment never auto-evaluates (functions/admin.ts:1186).
  • PPL-G-15: updateSegment accepts rules: null on a dynamic segment, and the next evaluation empties it (segment.service.ts:217).

Skipped

  • Owner questions:
    • PPL-G-04 and G-10: evaluate on save.
    • PPL-G-14: rename changes the slug.
    • PPL-G-18: delete while content references the segment.
    • PPL-G-29: REST writes to dynamic segments.
    • PPL-G-46 and G-47: legacy admin gating versus segment.manage.
    • PPL-G-48: suggestions reveal emails to segment.view holders.
  • Not done:
    • PPL-G-16, G-26, G-32, G-33, G-37: nightly.
    • PPL-G-39 to G-42: cross-suite gates.

Local runs

On a fresh DB, --workers=2 --retries=0, three runs in a row:

  • segments.spec.ts + segment-access.spec.ts: 28 passed each time.
  • @isolated G-38, one worker: 3/3 passed.

Each passing test was broken once and went red.

@mortondev mortondev added the run-product-e2e Run the product e2e core suite on this PR label Nov 20, 2026
@mortondev
mortondev force-pushed the test/product-e2e-harness branch from b16d3d9 to aa14deb Compare November 20, 2026 10:20
@mortondev
mortondev changed the base branch from test/product-e2e-harness to main November 20, 2026 10:55
@mortondev
mortondev force-pushed the test/product-e2e-people-segments branch from b154441 to d2b8503 Compare November 20, 2026 10:55
@mortondev
mortondev force-pushed the test/product-e2e-people-segments branch from d2b8503 to ba33e6f Compare November 20, 2026 11:12
@mortondev
mortondev force-pushed the test/product-e2e-people-segments branch from ba33e6f to b727d93 Compare November 20, 2026 11:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-product-e2e Run the product e2e core suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant