Skip to content

ci: add pipeline for http-postgres#3913

Open
AkashKumar7902 wants to merge 3 commits intomainfrom
http-postgres-pipeline
Open

ci: add pipeline for http-postgres#3913
AkashKumar7902 wants to merge 3 commits intomainfrom
http-postgres-pipeline

Conversation

@AkashKumar7902
Copy link
Contributor

Describe the changes that are made

This pull request expands the automated testing workflow for Go applications by adding support for the http-postgres sample. 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 the http-postgres application.

Workflow configuration updates:

  • Added a new job entry for http-postgres in the jobs: matrix of .github/workflows/golang_docker.yml, enabling automated testing for this sample.
  • Updated the checkout step to use the http-postgres branch, ensuring the workflow tests the correct code version.

New test script for sample application:

  • Introduced golang-docker.sh for the http_postgres sample, 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]

  • NA (if very small change like typo, linting, etc.)

🔗 Related PRs

  • NA

🐞 Related Issues

  • NA

📄 Related Documents

  • NA

What type of PR is this? (check all applicable)

  • 📦 Chore
  • 🍕 Feature
  • 🐞 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🔁 CI
  • ⏩ Revert

Added e2e test pipeline?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added comments for hard-to-understand areas?

  • 👍 yes
  • 🙅 no, because the code is self-explanatory

Added to documentation?

  • 📜 README.md
  • 📓 Wiki
  • 🙅 no documentation needed

Are there any sample code or steps to test the changes?

  • 👍 yes, mentioned below
  • 🙅 no, because it is not needed

Self Review done?

  • ✅ yes
  • ❌ no, because I need help

Any relevant screenshots, recordings or logs?

  • NA

🧠 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:

  • PR Title: fix: patch MongoDB document update bug
  • Branch Name: feat/#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:

Copilot AI review requested due to automatic review settings March 11, 2026 13:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-postgres to the Go Docker workflow matrix.
  • Pinned the keploy/samples-go checkout to the http-postgres ref.
  • Added a dedicated golang-docker.sh workflow script for the http_postgres sample 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.

Comment on lines 58 to +61
with:
repository: keploy/samples-go
path: samples-go
ref: http-postgres
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +41
if [ "$app_started" = false ]; then
echo "Application did not become ready on :8080"
container_kill
return 1
fi
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.

2 participants