-
Notifications
You must be signed in to change notification settings - Fork 12
improvement: add e2e test for relay and gateway #102
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
Merged
fangpenlin
merged 38 commits into
main
from
PLATFRM-128-more-tests-for-a-vertical-slice
Jan 16, 2026
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
e126849
More test cases
fangpenlin 2222055
Improve client code gen, use go:generate instead
fangpenlin 926cc13
Update readme
fangpenlin 0342234
Use new api endpoints
fangpenlin 30f7313
Use dotenv autoload
fangpenlin f48730f
Update .env tips
fangpenlin a4ecaf1
Add more asserts
fangpenlin 0a5f4b8
Collect stderr and stdout for e2e tests
fangpenlin 204b5c9
Better way to collect logs
fangpenlin 6b91a37
Redirect warn msg
fangpenlin 4e46df9
Redirect stdout as well
fangpenlin 4462730
Clear stderr and stdout for e2e tests after it's done
fangpenlin 87d1568
DRY
fangpenlin e00e8af
Try to fix exit code
fangpenlin 482be98
Fix new proxy cmd
fangpenlin e03b593
Fix is running flag
fangpenlin 65f7d61
Fix canceled ctx issue for children cmd
fangpenlin 33ab8ad
Speed up truncate tables
fangpenlin a2479ae
DRY and refine tests
fangpenlin 380e2a2
Refactor code
fangpenlin 2edc482
Refine
fangpenlin 5fc0b30
Improve WaitForStderr as well
fangpenlin c19ea29
Assert gateway heartbeat as well
fangpenlin e6ed179
More tests
fangpenlin 6a91019
Assert k8s hit
fangpenlin 557e733
Add more op id
fangpenlin f2abf7c
Add redis
fangpenlin 7854fbd
use redis container instead
fangpenlin f1f4aa0
Parallel not working, comment them out for now
fangpenlin fa8fcec
Fix parent exit too early bug
fangpenlin 2650320
Use clean up for all
fangpenlin 836c2e0
Add deps
fangpenlin 0eea052
Update make file
fangpenlin a55ad5e
Update readme
fangpenlin 3bec812
Update .env sample
fangpenlin 8480857
Add remove compose
fangpenlin 39f3b2a
Break the test into smaller units
fangpenlin f34770d
Rename tests
fangpenlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # E2E Test Configuration | ||
| # Copy this file to .env and update the values as needed. | ||
| # The .env file is automatically loaded when running e2e tests. | ||
|
|
||
| # ============================================================================= | ||
| # Required Configuration | ||
| # ============================================================================= | ||
|
|
||
| # Path to the Infisical backend directory | ||
| # This should point to the backend folder of the infisical repository | ||
| # Example: /Users/your-username/workspace/infisical/backend | ||
| INFISICAL_BACKEND_DIR=/path/to/infisical/backend | ||
|
|
||
| # ============================================================================= | ||
| # Optional Configuration | ||
| # ============================================================================= | ||
|
|
||
| # Dockerfile to use for building the backend service | ||
| # Defaults to "Dockerfile.dev.fips" if not set | ||
| # INFISICAL_BACKEND_DOCKERFILE=Dockerfile.dev.fips | ||
|
|
||
| # Path to the CLI executable to use for testing | ||
| # If not set, the test will look for ./infisical-merge in the e2e directory | ||
| # This is only needed when using the "subprocess" run method | ||
| # INFISICAL_CLI_EXECUTABLE=./infisical-merge | ||
|
|
||
| # Default run method for CLI commands in tests | ||
| # Valid values: "functionCall" (default) or "subprocess" | ||
| # - functionCall: Calls CLI functions directly (better for IDE debugging, can collect stdout/stderr) | ||
| # Note: Since all commands run in the same process, make sure to properly reset any global state between test cases | ||
| # - subprocess: Runs CLI as a separate process (simulates real user interaction, better isolation, can collect stdout/stderr) | ||
| # CLI_E2E_DEFAULT_RUN_METHOD=subprocess | ||
|
|
||
| # ============================================================================= | ||
| # Development & Debugging Options | ||
| # ============================================================================= | ||
|
|
||
| # Disable the compose container cache | ||
| # When enabled (default), tests will reuse existing containers to speed up development | ||
| # Set to "1" to disable caching and always start fresh containers | ||
| # CLI_E2E_DISABLE_COMPOSE_CACHE=1 | ||
|
|
||
| # Disable Ryuk container cleanup | ||
| # When enabled, testcontainers will keep containers running after tests complete | ||
| # This is useful for debugging backend issues | ||
| # Set to "true" to disable automatic container cleanup | ||
| # TESTCONTAINERS_RYUK_DISABLED=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,13 @@ | ||
| .PHONY: filter-api generate-client clean | ||
|
|
||
| # Variables | ||
| API_JSON := api.json | ||
| ALLOWED_ENDPOINTS := allowed-endpoints.json | ||
| FILTERED_API_JSON := api-filtered.json | ||
| OPENAPI_CFG := openapi-cfg.yaml | ||
|
|
||
| # Filter API JSON to only include allowed endpoints | ||
| filter-api: | ||
| @echo "Filtering API JSON using allowed endpoints..." | ||
| @jq --slurpfile allowed $(ALLOWED_ENDPOINTS) \ | ||
| '.paths |= with_entries(select(.key as $$k | $$allowed[0] | index($$k)))' \ | ||
| $(API_JSON) > $(FILTERED_API_JSON) | ||
| @echo "Filtered API JSON written to $(FILTERED_API_JSON)" | ||
| .PHONY: generate-code api.json | ||
|
|
||
| # Generate OpenAPI client using oapi-codegen | ||
| generate-client: filter-api | ||
| generate-code: | ||
| @echo "Generating OpenAPI client..." | ||
| @go tool oapi-codegen -config $(OPENAPI_CFG) $(FILTERED_API_JSON) | ||
| @go generate | ||
| @echo "Client generated successfully" | ||
|
|
||
| # Clean generated files | ||
| clean: | ||
| @echo "Cleaning generated files..." | ||
| @rm -f $(FILTERED_API_JSON) | ||
| @echo "Clean complete" | ||
| # Fetch API docs and format with jq | ||
| api.json: | ||
| @echo "Fetching API docs..." | ||
| @set -o pipefail && curl -f http://localhost:4000/api/docs/json | jq . > api.json.tmp && mv api.json.tmp api.json | ||
| @echo "API docs saved to api.json" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
generate-code seems a misleading - may be like
openapi-specThere 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.
could you elaborate a bit more why misleading? from the perspective of makefile the name is a "target". therefore
sounds right to me, as we are making for the target
generate-code.