From ce11d823c1c36ac3cce66925a4b013e700466b09 Mon Sep 17 00:00:00 2001 From: Abdulwahab Shahzad Date: Tue, 2 Jun 2026 23:53:23 -0700 Subject: [PATCH 1/3] feat: add NATS local server support to integration tests --- .github/workflows/integration-tests.yaml | 30 +++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index a7de555..c05173f 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -1,4 +1,4 @@ -name: Integration Tests +okname: Integration Tests on: workflow_call: @@ -32,6 +32,11 @@ on: required: false default: true type: boolean + use_nats: + description: 'Start a local NATS server instance' + required: false + default: false + type: boolean use_cloud_sql: description: 'Start Cloud SQL Proxy and connect to the DB' required: false @@ -163,6 +168,28 @@ jobs: if: ${{ inputs.use_redis }} run: redis-cli -h 127.0.0.1 -p 6379 -a "dummy_password_for_local_redis" PING + # --- Optional: NATS --- + - name: Start Local NATS Server + if: ${{ inputs.use_nats }} + run: | + NATS_VERSION="v2.10.18" + curl -sL \ + "https://github.com/nats-io/nats-server/releases/download/${NATS_VERSION}/nats-server-${NATS_VERSION}-linux-amd64.zip" \ + -o nats-server.zip + unzip -o nats-server.zip + chmod +x nats-server-${NATS_VERSION}-linux-amd64/nats-server + mv nats-server-${NATS_VERSION}-linux-amd64/nats-server /usr/local/bin/nats-server + nohup nats-server --port 4222 --http_port 8222 > nats-server.log 2>&1 & + echo "NATS_SERVER_PID=$!" >> $GITHUB_ENV + sleep 2 + echo "NATS_URL=nats://127.0.0.1:4222" >> $GITHUB_ENV + + - name: Ping Local NATS + if: ${{ inputs.use_nats }} + run: | + curl --fail --silent --retry 5 --retry-delay 1 \ + http://127.0.0.1:8222/healthz + # --- Go private module access --- - name: Set up Go environment for private repo access run: | @@ -475,6 +502,7 @@ jobs: run: | [ -n "$API_PID" ] && kill $API_PID || true [ -n "$CLOUD_SQL_PROXY_PID" ] && kill $CLOUD_SQL_PROXY_PID || true + [ -n "$NATS_SERVER_PID" ] && kill $NATS_SERVER_PID || true - name: Check for Failed Integration Tests run: | From 40667260c3ecade69d979a9b087116e157838891 Mon Sep 17 00:00:00 2001 From: Abdulwahab Shahzad Date: Tue, 2 Jun 2026 23:59:49 -0700 Subject: [PATCH 2/3] feat(TMF-2456): fix typo --- .github/workflows/integration-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index c05173f..9145b67 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -1,4 +1,4 @@ -okname: Integration Tests +name: Integration Tests on: workflow_call: From a9f236a1690ccbf62164dc5497cf42c493c8abea Mon Sep 17 00:00:00 2001 From: Abdulwahab Shahzad Date: Wed, 3 Jun 2026 00:02:42 -0700 Subject: [PATCH 3/3] feat(TMF-2456): AI comments --- .github/workflows/integration-tests.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 9145b67..e877206 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -173,12 +173,13 @@ jobs: if: ${{ inputs.use_nats }} run: | NATS_VERSION="v2.10.18" - curl -sL \ + sudo apt-get install -y unzip + curl -sSfL \ "https://github.com/nats-io/nats-server/releases/download/${NATS_VERSION}/nats-server-${NATS_VERSION}-linux-amd64.zip" \ -o nats-server.zip unzip -o nats-server.zip chmod +x nats-server-${NATS_VERSION}-linux-amd64/nats-server - mv nats-server-${NATS_VERSION}-linux-amd64/nats-server /usr/local/bin/nats-server + sudo mv nats-server-${NATS_VERSION}-linux-amd64/nats-server /usr/local/bin/nats-server nohup nats-server --port 4222 --http_port 8222 > nats-server.log 2>&1 & echo "NATS_SERVER_PID=$!" >> $GITHUB_ENV sleep 2