-
Notifications
You must be signed in to change notification settings - Fork 566
test: stream_routes in services #3113
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
test: stream_routes in services #3113
Conversation
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.
Pull Request Overview
This PR adds test coverage for stream routes under services and introduces related schema, UI, form, and API enhancements to support these tests.
- Stream route schema updates to make
conf
andlogger
optional - Integration of
produceRmUpstreamWhenHas
into add/edit form pipelines - Addition of
deleteAllStreamRoutes
helper and comprehensive E2E tests for listing and CRUD
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/types/schema/apisix/stream_routes.ts | Made conf and logger optional in StreamRouteProtocol schema |
src/routes/stream_routes/index.tsx | Updated list columns to display server_addr and server_port |
src/routes/stream_routes/detail.$id.tsx | Applied produceRmUpstreamWhenHas in update mutation pipeline |
src/routes/stream_routes/add.tsx | Applied produceRmUpstreamWhenHas in creation mutation pipeline |
src/components/form/JsonInput.tsx | Extended JSON input with objValue support and omitted prop |
src/components/form-slice/FormPartStreamRoute/index.tsx | Provided objValue to JSON inputs for protocol fields |
src/apis/stream_routes.ts | Added deleteAllStreamRoutes helper |
e2e/tests/services.stream_routes.list.spec.ts | E2E tests for service-scoped stream routes listing |
e2e/tests/services.stream_routes.crud.spec.ts | E2E tests for service-scoped stream routes CRUD |
e2e/pom/services.ts | POM updates for navigating and interacting with stream routes |
Comments suppressed due to low confidence (3)
src/routes/stream_routes/detail.$id.tsx:42
- [nitpick] The function name
produceRmUpstreamWhenHas
is cryptic; consider renaming to something more descriptive likeremoveUpstreamIfServiceIdPresent
for clarity.
import { produceRmUpstreamWhenHas } from '@/utils/form-producer';
src/apis/stream_routes.ts:67
- There aren't any unit tests covering
deleteAllStreamRoutes
; adding tests to confirm it correctly paginates and deletes all items would catch regressions early.
export const deleteAllStreamRoutes = async (req: AxiosInstance) => {
src/components/form/JsonInput.tsx:18
- [nitpick] Introducing a new dependency just for
omit
may increase bundle size and cognitive load; consider using built-in object destructuring or a shared utility (e.g.,lodash.omit
) to maintain consistency.
import { omit } from 'rambdax';
…_routes-in-services
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
Depend on apache/apisix#12291, #3111, #3112, #3117
Meanwhile, some essential code that needed fixing has been fixed.
Paths:
e2e/tests/services.stream_routes.list.spec.ts:
e2e/tests/services.stream_routes.crud.spec.ts:
stream_routes.crud-*.spec.ts
, the CRUD tests included in this PR reduce the repetition of existing paths.