Conversation
Signed-off-by: Akash Kumar <[email protected]>
There was a problem hiding this comment.
Pull request overview
Expands the Go-on-Docker CI workflow to include automated record/replay testing for the http-postgres sample from keploy/samples-go.
Changes:
- Added
http-postgresto the Go Docker workflow matrix. - Pinned the
keploy/samples-gocheckout to thehttp-postgresref. - Added a dedicated
golang-docker.shworkflow script for thehttp_postgressample to drive record/replay, race detection, and report validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/test_workflow_scripts/golang/http_postgres/golang-docker.sh |
New CI script to record requests, replay tests, and validate Keploy reports for the http-postgres sample. |
.github/workflows/golang_docker.yml |
Adds http-postgres to the matrix and updates samples-go checkout behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with: | ||
| repository: keploy/samples-go | ||
| path: samples-go | ||
| ref: http-postgres |
There was a problem hiding this comment.
The samples-go checkout is pinned to ref: http-postgres for every matrix entry, which will also run gin-mongo and echo-sql against that branch. If that branch doesn’t contain those sample directories (or has different versions), the matrix jobs will fail or test the wrong code. Consider adding a per-app ref value in the matrix (defaulting to the samples-go default branch) and using ref: ${{ matrix.app.ref }} so only the http-postgres job is pinned.
| if [ "$app_started" = false ]; then | ||
| echo "Application did not become ready on :8080" | ||
| container_kill | ||
| return 1 | ||
| fi |
There was a problem hiding this comment.
send_request returns 1 when the app never becomes ready, but it’s started in the background (send_request &), so this failure won’t automatically fail the script. This can allow the workflow to continue and potentially pass despite the app not starting. Capture the background PID and wait on it (or otherwise propagate readiness failure) and exit non-zero if the readiness check fails.
Signed-off-by: Akash Kumar <[email protected]>
Describe the changes that are made
This pull request expands the automated testing workflow for Go applications by adding support for the
http-postgressample. The main improvements include updating the workflow configuration to handle this new sample, ensuring the correct branch is used, and introducing a robust test script for the new sample. These changes enhance test coverage and reliability for thehttp-postgresapplication.Workflow configuration updates:
http-postgresin thejobs:matrix of.github/workflows/golang_docker.yml, enabling automated testing for this sample.http-postgresbranch, ensuring the workflow tests the correct code version.New test script for sample application:
golang-docker.shfor thehttp_postgressample, which builds Docker images, manages test and mock data, runs tests, checks for errors and race conditions, and validates test results for reliability and correctness.Links & References
Closes: #[issue number that will be closed through this PR]
🔗 Related PRs
🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Self Review done?
Any relevant screenshots, recordings or logs?
🧠 Semantics for PR Title & Branch Name
Please ensure your PR title and branch name follow the Keploy semantics:
📌 PR Semantics Guide
📌 Branch Semantics Guide
Examples:
fix: patch MongoDB document update bugfeat/#1-login-flow(You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)Additional checklist: