Skip to content
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

Release/v1.30.0 #1378

Merged
merged 24 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
47363be
load system env's overriding others
Umang01-hash Dec 26, 2024
c678ac6
add test for new code
Umang01-hash Dec 26, 2024
ffb2372
Fix : Server shouldn't start if HTTP_PORT is blocked (#1319)
coolwednesday Dec 27, 2024
7002192
Merge branch 'development' of github.com:gofr-dev/gofr into en/system…
Umang01-hash Dec 30, 2024
3332d22
use strings.Cut instead of strings.SplitN to get the configs
Umang01-hash Dec 30, 2024
649783a
remove unused constant
Umang01-hash Dec 30, 2024
0ea63d3
Bump google.golang.org/grpc from 1.69.0 to 1.69.2
dependabot[bot] Dec 30, 2024
2ab14e3
Merge pull request #1354 from gofr-dev/dependabot/go_modules/google.g…
Umang01-hash Dec 31, 2024
b341297
Merge branch 'development' into en/system_env_overrides_others
Umang01-hash Jan 2, 2025
a3c7dde
add error log on migrations failure (#1356)
Umang01-hash Jan 3, 2025
f7bedb6
Fix : Incorrect Logs Displayed for Redis Database Connection Status (…
coolwednesday Jan 3, 2025
1314152
Merge branch 'development' into en/system_env_overrides_others
Umang01-hash Jan 6, 2025
30116f0
Merge pull request #1342 from gofr-dev/en/system_env_overrides_others
Umang01-hash Jan 6, 2025
69b9cee
Bump golang.org/x/term from 0.27.0 to 0.28.0
dependabot[bot] Jan 6, 2025
8fb1d59
Merge pull request #1365 from gofr-dev/dependabot/go_modules/golang.o…
Umang01-hash Jan 7, 2025
099379c
Bump golang.org/x/oauth2 from 0.24.0 to 0.25.0
dependabot[bot] Jan 7, 2025
3bc9ab4
Merge pull request #1366 from gofr-dev/dependabot/go_modules/golang.o…
Umang01-hash Jan 7, 2025
44e3eeb
Fix: BUG: Refactor ExpectSelect in SQL mocks to return desired entity…
coolwednesday Jan 7, 2025
27414cf
Merge branch 'main' of github.com:gofr-dev/gofr into release/v1.30.0
Umang01-hash Jan 8, 2025
726118b
update version to v1.30.0
Umang01-hash Jan 8, 2025
bd11406
Fix : Incorrect MongoDB Connection Logs (#1355)
coolwednesday Jan 8, 2025
c745f6f
Update golang/crypto versions in in SFTP (#1376)
coolwednesday Jan 8, 2025
4222651
Fix/golang.org/x/net update (#1381)
Umang01-hash Jan 9, 2025
f982983
Merge branch 'development' of github.com:gofr-dev/gofr into release/v…
Umang01-hash Jan 9, 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
10 changes: 9 additions & 1 deletion examples/grpc-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"context"
"fmt"
"strconv"
"testing"
"time"

Expand All @@ -11,10 +13,16 @@ import (
"google.golang.org/grpc/credentials/insecure"

grpcExample "gofr.dev/examples/grpc-server/grpc"
"gofr.dev/pkg/gofr/testutil"
)

func TestGRPCServer(t *testing.T) {
const host = "localhost:10000"
gRPCPort := testutil.GetFreePort(t)
t.Setenv("GRPC_PORT", strconv.Itoa(gRPCPort))
host := fmt.Sprint("localhost:", gRPCPort)

port := testutil.GetFreePort(t)
t.Setenv("METRICS_PORT", strconv.Itoa(port))

go main()
time.Sleep(100 * time.Millisecond)
Expand Down
26 changes: 23 additions & 3 deletions examples/http-server-using-redis/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package main
import (
"bytes"
"context"
"fmt"
"net/http"
"strconv"
"testing"
"time"

Expand All @@ -21,7 +23,13 @@ import (
)

func TestHTTPServerUsingRedis(t *testing.T) {
const host = "http://localhost:8000"
httpPort := testutil.GetFreePort(t)
t.Setenv("HTTP_PORT", strconv.Itoa(httpPort))
host := fmt.Sprint("http://localhost:", httpPort)

port := testutil.GetFreePort(t)
t.Setenv("METRICS_PORT", strconv.Itoa(port))

go main()
time.Sleep(100 * time.Millisecond) // Giving some time to start the server

Expand Down Expand Up @@ -55,6 +63,12 @@ func TestHTTPServerUsingRedis(t *testing.T) {
}

func TestRedisSetHandler(t *testing.T) {
metricsPort := testutil.GetFreePort(t)
httpPort := testutil.GetFreePort(t)

t.Setenv("METRICS_PORT", strconv.Itoa(metricsPort))
t.Setenv("HTTP_PORT", strconv.Itoa(httpPort))

a := gofr.New()
logger := logging.NewLogger(logging.DEBUG)
redisClient, mock := redismock.NewClientMock()
Expand All @@ -64,7 +78,7 @@ func TestRedisSetHandler(t *testing.T) {

mock.ExpectSet("key", "value", 5*time.Minute).SetErr(testutil.CustomError{ErrorMessage: "redis get error"})

req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://localhost:5000/handle", bytes.NewBuffer([]byte(`{"key":"value"}`)))
req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, fmt.Sprintf("http://localhost:%d/handle", httpPort), bytes.NewBuffer([]byte(`{"key":"value"}`)))
req.Header.Set("content-type", "application/json")
gofrReq := gofrHTTP.NewRequest(req)

Expand All @@ -78,6 +92,12 @@ func TestRedisSetHandler(t *testing.T) {
}

func TestRedisPipelineHandler(t *testing.T) {
metricsPort := testutil.GetFreePort(t)
httpPort := testutil.GetFreePort(t)

t.Setenv("METRICS_PORT", strconv.Itoa(metricsPort))
t.Setenv("HTTP_PORT", strconv.Itoa(httpPort))

a := gofr.New()
logger := logging.NewLogger(logging.DEBUG)
redisClient, mock := redismock.NewClientMock()
Expand All @@ -88,7 +108,7 @@ func TestRedisPipelineHandler(t *testing.T) {
mock.ExpectSet("testKey1", "testValue1", time.Minute*5).SetErr(testutil.CustomError{ErrorMessage: "redis get error"})
mock.ClearExpect()

req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://localhost:5000/handle", bytes.NewBuffer([]byte(`{"key":"value"}`)))
req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, fmt.Sprint("http://localhost:", httpPort, "/handle"), bytes.NewBuffer([]byte(`{"key":"value"}`)))
req.Header.Set("content-type", "application/json")

gofrReq := gofrHTTP.NewRequest(req)
Expand Down
18 changes: 16 additions & 2 deletions examples/http-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"io"
"net/http"
"strconv"
"testing"
"time"

Expand All @@ -20,9 +21,12 @@ import (
"gofr.dev/pkg/gofr/testutil"
)

const host = "http://localhost:9000"

func TestIntegration_SimpleAPIServer(t *testing.T) {
host := "http://localhost:9000"

port := testutil.GetFreePort(t)
t.Setenv("METRICS_PORT", strconv.Itoa(port))

go main()
time.Sleep(100 * time.Millisecond) // Giving some time to start the server

Expand Down Expand Up @@ -66,6 +70,8 @@ func TestIntegration_SimpleAPIServer(t *testing.T) {
}

func TestIntegration_SimpleAPIServer_Errors(t *testing.T) {
host := "http://localhost:9000"

tests := []struct {
desc string
path string
Expand Down Expand Up @@ -120,6 +126,8 @@ func TestIntegration_SimpleAPIServer_Errors(t *testing.T) {
}

func TestIntegration_SimpleAPIServer_Health(t *testing.T) {
host := "http://localhost:9000"

tests := []struct {
desc string
path string
Expand All @@ -143,6 +151,12 @@ func TestIntegration_SimpleAPIServer_Health(t *testing.T) {
}

func TestRedisHandler(t *testing.T) {
metricsPort := testutil.GetFreePort(t)
httpPort := testutil.GetFreePort(t)

t.Setenv("METRICS_PORT", strconv.Itoa(metricsPort))
t.Setenv("HTTP_PORT", strconv.Itoa(httpPort))

a := gofr.New()
logger := logging.NewLogger(logging.DEBUG)
redisClient, mock := redismock.NewClientMock()
Expand Down
96 changes: 49 additions & 47 deletions examples/using-add-filestore/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ go 1.23.2
require (
github.com/stretchr/testify v1.10.0
go.uber.org/mock v0.5.0
gofr.dev v1.28.0
gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0
gofr.dev v1.29.0
gofr.dev/pkg/gofr/datasource/file/ftp v0.2.0
)

require (
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.10.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.2.2 // indirect
cloud.google.com/go/pubsub v1.45.1 // indirect
cloud.google.com/go v0.118.0 // indirect
cloud.google.com/go/auth v0.14.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/iam v1.3.1 // indirect
cloud.google.com/go/pubsub v1.45.3 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
github.com/XSAM/otelsql v0.34.0 // indirect
github.com/XSAM/otelsql v0.36.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand All @@ -32,72 +32,74 @@ require (
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/jlaffaye/ftp v0.2.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0 // indirect
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0 // indirect
github.com/redis/go-redis/v9 v9.7.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/segmentio/kafka-go v0.4.47 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.58.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.55.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/api v0.209.0 // indirect
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.2 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/api v0.215.0 // indirect
google.golang.org/genproto v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.55.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/sqlite v1.34.1 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6 // indirect
modernc.org/libc v1.61.7 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.8.1 // indirect
modernc.org/sqlite v1.34.4 // indirect
modernc.org/strutil v1.2.1 // indirect
modernc.org/token v1.1.0 // indirect
)
Loading
Loading