Skip to content
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9fab87b
Updated workflow to show error on failing test
HarK-github Oct 17, 2025
19be303
Merge branch 'development' into development
Umang01-hash Oct 23, 2025
b881dc1
Merge branch 'gofr-dev:development' into development
HarK-github Oct 26, 2025
f9667c3
reworked failing tests
HarK-github Oct 27, 2025
7487123
Merge branch 'development' of https://github.com/HarK-github/gofr int…
HarK-github Oct 27, 2025
69a9fc2
Added retries
HarK-github Oct 27, 2025
8a2f6ba
Changes
HarK-github Oct 27, 2025
5f564cf
Added wait for services
HarK-github Oct 27, 2025
2db1241
Added ignore password error
HarK-github Oct 27, 2025
f0c5e5e
Added alternative to get services reade
HarK-github Oct 27, 2025
f66be96
Merge branch 'development' into development
Umang01-hash Oct 28, 2025
b268754
Merge branch 'development' into development
Umang01-hash Oct 28, 2025
a0136f8
Merge branch 'development' into development
HarK-github Oct 28, 2025
b52759d
Resolved issues
HarK-github Oct 29, 2025
b49c060
Reverted whitespaces and added healthchecks
HarK-github Oct 29, 2025
b9b7c10
Resolved remaining whitespace issues
HarK-github Oct 29, 2025
0772f3b
Pruning whitespaces
HarK-github Oct 29, 2025
8c4bb12
Resolved health checkup
HarK-github Oct 29, 2025
cf691bf
Changed to ping
HarK-github Oct 29, 2025
b5b886a
Added kafka checks
HarK-github Oct 29, 2025
b77170e
Changes
HarK-github Oct 29, 2025
043b7c8
Removed health check for kafka
HarK-github Oct 29, 2025
6199300
Changed continue on error
HarK-github Oct 29, 2025
85b50f6
repair
HarK-github Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,52 @@ jobs:

# Define service containers that tests depend on
services:
# Kafka service
# Kafka service — expose host port 1092 so tests using localhost:1092 connect to Kafka
kafka:
image: bitnamilegacy/kafka:3.4.1
ports:
- "9092:9092"
- "1092:9092"
env:
KAFKA_ENABLE_KRAFT: yes
KAFKA_CFG_PROCESS_ROLES: broker,controller
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
# advertise the host port that tests use
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:1092
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: true
KAFKA_BROKER_ID: 1
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_NODE_ID: 1

# Redis service
# Redis service — tests expect Redis at localhost:2001, so expose 2001
redis:
image: redis:7.0.5
ports:
- "2002:6379"
options: "--entrypoint redis-server"

# MySQL service
- "2001:6379"
options: >-
--entrypoint redis-server
--health-cmd="redis-cli ping"
--health-interval=5s
--health-timeout=5s
--health-retries=5
--health-start-period=5s

# MySQL service — move MySQL to a different host port to avoid conflict with Redis
mysql:
image: mysql:8.2.0
ports:
- "2001:3306"
- "2002:3306"
env:
MYSQL_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "test"
options: >-
--health-cmd="mysqladmin ping -h localhost -ppassword --silent"
--health-interval=5s
--health-timeout=5s
--health-retries=10
--health-start-period=5s

# Steps to execute for this job
steps:
Expand All @@ -96,15 +109,17 @@ jobs:
- name: Test with Retry Logic
id: test
uses: nick-fields/retry@v3
continue-on-error: false
with:
timeout_minutes: 5 # Maximum time for the tests to run
max_attempts: 2 # Retry up to 2 times if tests fail
command: |
set -e
export APP_ENV=test
# Run tests for the examples directory with coverage
go test ./examples/... -v -short -covermode=atomic -coverprofile packageWithpbgo.cov -coverpkg=./examples/...
# Filter out auto-generated files by protobuf and gofr framework from coverage report
grep -vE '(/client/|grpc-.+-client/main\.go|_client\.go|_gofr\.go|_grpc\.pb\.go|\.pb\.go|\.proto|health_.*\.go)' packageWithpbgo.cov > profile.cov
grep -vE '(/client/|grpc-.+-client/main\.go|_client\.go|_gofr\.go|_grpc\.pb\.go|\.pb\.go|\.proto|health_.*\.go)' packageWithpbgo.cov > profile.cov || true
# Display coverage statistics
go tool cover -func profile.cov

Expand Down Expand Up @@ -257,7 +272,7 @@ jobs:
# Find all directories containing a go.mod file within 'pkg'
SUBMODULES=$(find pkg -name "go.mod" -exec dirname {} \; | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "submodules=$SUBMODULES" >> $GITHUB_OUTPUT

# Test all submodules in parallel with retry logic
- name: Test Submodules with Retry and Parallelism
id: test_submodules
Expand Down