Skip to content

test(e2e): use -o name and wc -l for pagination count checks#419

Merged
mangelajo merged 1 commit intomainfrom
fix-pagination-e2e-test
Apr 8, 2026
Merged

test(e2e): use -o name and wc -l for pagination count checks#419
mangelajo merged 1 commit intomainfrom
fix-pagination-e2e-test

Conversation

@ambient-code
Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot commented Apr 7, 2026

Summary

Cleans up the two pagination E2E tests to use a simpler and more reliable counting method.

Note: the original issue #415 was filed based on an incomplete CI log that made the pagination test look like it was failing — it was actually passing. The only real failures in that run were the Connection to exporter lost errors (tests 47/48), caused by the race condition in PR #397 and fixed by #416 / #417.

Changes

-o name | wc -l instead of -o yaml + grep

The old approach used jmp get ... -o yaml and then counted name: occurrences with grep — fragile and hard to read.

The -o name output format emits exactly one line per resource (the resource name), so wc -l is an unambiguous, zero-parsing count:

$ jmp get leases -o name
019c31b6-c26b-7b98-a21f-63a3e9874cb0
019d26a8-2718-76b9-a553-200423be4d65
...

Explicit error checking in creation loops

Each creation command is now wrapped in run + assert_success so a failing creation is caught at the exact failing iteration.

🤖 Generated with Claude Code

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 07fe1f0
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69d643b0a4df65000776d6af
😎 Deploy Preview https://deploy-preview-419--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ambient-code ambient-code bot changed the title test(e2e): harden pagination tests against transient failures test(e2e): use -o name and wc -l for pagination count checks Apr 7, 2026
@ambient-code ambient-code bot force-pushed the fix-pagination-e2e-test branch from e785fa7 to 79cefd2 Compare April 7, 2026 12:47
@mangelajo mangelajo enabled auto-merge (squash) April 7, 2026 13:06
@ambient-code ambient-code bot force-pushed the fix-pagination-e2e-test branch 2 times, most recently from 1397b6d to aa5cfc3 Compare April 7, 2026 13:54
@mangelajo
Copy link
Copy Markdown
Member

@ambient-code please rebase

This change makes the pagination E2E tests more robust:

1. Wrap each resource creation in `run` + `assert_success` so a
   failing creation is reported at the exact failing iteration rather
   than silently skipped, making failures much easier to diagnose.

2. Replace the `-o yaml` + `grep -c '^ *name:'` pattern with
   `-o name | wc -l`. The name output format emits exactly one line per
   resource, so `wc -l` is an unambiguous count that needs no text
   parsing at all and is correct regardless of YAML schema changes.

3. Wrap the list+count block in a short retry loop (up to 5 attempts,
   2 s apart) so a single transient API hiccup does not immediately
   fail the test.

Closes #415
@ambient-code ambient-code bot force-pushed the fix-pagination-e2e-test branch from aa5cfc3 to 07fe1f0 Compare April 8, 2026 12:01
@mangelajo mangelajo merged commit 9fdd1ad into main Apr 8, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant