-
Notifications
You must be signed in to change notification settings - Fork 579
test: add stream route E2E tests with detail page flows #3255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Fixed e2e flakiness: added retry to src/apis/upstreams.ts::deleteAllUpstreams and increased timeouts in stream_routes.ts. I ran CI=true pnpm e2e locally all 27 tests passed. |
- Add stream_routes.crud-required-fields.spec.ts for minimal CRUD - Add stream_routes.crud-all-fields.spec.ts for extended CRUD with optional fields - Add stream_routes.list.spec.ts for pagination testing - Create e2e/utils/ui/stream_routes.ts helper for form interactions - Update stream_routes POM with isIndexPage, isAddPage, isDetailPage assertions All CRUD operations now use detail page for edit/delete workflows instead of relying on non-existent list-page Edit buttons. Tests verify creation lands on detail page, editing works via detail toolbar, and deletion happens through detail dialog with proper list verification. Fixes apache#3085
fb21719 to
5cfc5c2
Compare
|
Also pls fix tests |
Removed pnpm configuration for onlyBuiltDependencies.
- Explains why retry is needed (transient 500 errors in E2E tests) - Documents PAGE_SIZE_MIN usage for efficient total count fetching - Clarifies batch deletion strategy - Documents 404 handling for idempotency in parallel test execution
|
The CI is fixed; all tests are passing locally. |
- Increase uiHasToastMsg timeout to 30s for all toast message assertions - Increase stream routes navigation timeouts to 30s - Increase stream routes list cell visibility timeouts to 30s - Add waitForLoadState after page reload in SSL test - Increase pagination test timeout to 10s - Add toast message wait in stream routes CRUD tests These changes ensure tests pass reliably in slower CI environments while maintaining the principle that API calls are only used for setup/teardown. All 76 E2E tests pass successfully with these changes.
…mprove `clearAll` error handling for stream routes
src/apis/stream_routes.ts
Outdated
| res.list.map((d) => req.delete(`${API_STREAM_ROUTES}/${d.value.id}`)) | ||
| res.list.map((d) => | ||
| req.delete(`${API_STREAM_ROUTES}/${d.value.id}`).catch((err) => { | ||
| // Ignore 404 errors - resource already deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures the test cleanup is robust against race conditions or inconsistent states. If a resource is deleted by another process (or a previous test step) between the time we list the resources and the time we try to delete them, the server returns a 404. Ignoring 404s prevents the deleteAllStreamRoutes helper from crashing the test suite when the resource is already gone, which is the desired state anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good approach. Resources created by each test should be independent; different tests shouldn't use the same resources.
When cleaning up resources, each test should only clean up the resources created by that specific test, not all resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right I've removed the global cleanup approach: reverted the .catch() error suppression in
deleteAllStreamRoutes, eliminated beforeAll cleanup from CRUD tests (they now create unique resources with
randomId() and delete only their own via UI), and ensured each test is fully isolated.
…ents from APISIX configuration.
…unique data and refining cleanup logic.
Why submit this pull request?
What changes will this PR take into?
This PR adds comprehensive E2E test coverage for Stream Routes, which was previously missing from the test suite.
Changes:
stream_routes.crud-required-fields.spec.tsfor minimal CRUD operations testingstream_routes.crud-all-fields.spec.tsfor extended CRUD with optional fields (server_addr, remote_addr, SNI, labels)stream_routes.list.spec.tsfor pagination testinge2e/utils/ui/stream_routes.tshelper module for stream route form interactionsisIndexPage,isAddPage,isDetailPageassertions and navigation helpersTest Flow:
All CRUD operations now use the detail page for edit/delete workflows instead of relying on non-existent list-page Edit buttons. Tests verify:
Related issues
fix #3084
Checklist: