Skip to content

Commit d23f41e

Browse files
authored
Merge pull request #60 from KnightHacks/development
Development
2 parents 0f69d31 + 75a4315 commit d23f41e

20 files changed

+2003
-241
lines changed

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# we will put our integration testing in this path
2+
INTEGRATION_TEST_PATH?=./integration_tests
3+
4+
# set of env variables that you need for testing
5+
POSTGRES_URI=postgresql://postgres:test@localhost:5432/postgres
6+
7+
# this command will start a docker components that we set in docker-compose.yml
8+
docker.start.components:
9+
docker-compose -f docker-compose-test.yaml up -d --remove-orphans postgres;
10+
11+
# shutting down docker components
12+
docker.stop:
13+
docker-compose -f docker-compose-test.yaml down -v
14+
15+
# this command will trigger integration test
16+
# INTEGRATION_TEST_SUITE_PATH is used for run specific test in Golang, if it's not specified
17+
# it will run all tests under ./integration_tests directory
18+
test.integration:
19+
$(MAKE) docker.start.components
20+
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI)
21+
$(MAKE) docker.stop
22+
23+
# this command will trigger integration test with verbose mode
24+
test.integration.debug:
25+
$(MAKE) docker.start.components
26+
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -v -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI)
27+
$(MAKE) docker.stop

docker-compose-test.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
postgres:
3+
image: "postgres:15-alpine"
4+
restart: always
5+
command: [ "postgres", "-c", "log_statement=all" ]
6+
environment:
7+
POSTGRES_PASSWORD: test
8+
ports:
9+
- "5432:5432"
10+
volumes:
11+
- ./integration_tests/init.sql:/docker-entrypoint-initdb.d/db.sql

go.mod

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ go 1.19
44

55
require (
66
github.com/99designs/gqlgen v0.17.13
7-
github.com/KnightHacks/knighthacks_shared v0.0.0-20221121010043-cf2a1397df2e
7+
github.com/KnightHacks/knighthacks_shared v0.0.0-20221122100922-bb5380fde900
88
github.com/gin-gonic/gin v1.8.1
9-
github.com/jackc/pgx/v4 v4.16.1
9+
github.com/jackc/pgx/v5 v5.1.1
1010
github.com/vektah/gqlparser/v2 v2.4.7
1111
)
1212

@@ -24,33 +24,29 @@ require (
2424
github.com/google/go-querystring v1.1.0 // indirect
2525
github.com/gorilla/websocket v1.5.0 // indirect
2626
github.com/hashicorp/golang-lru v0.5.4 // indirect
27-
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
28-
github.com/jackc/pgconn v1.12.1 // indirect
29-
github.com/jackc/pgio v1.0.0 // indirect
3027
github.com/jackc/pgpassfile v1.0.0 // indirect
31-
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
3228
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
33-
github.com/jackc/pgtype v1.11.0 // indirect
34-
github.com/jackc/puddle v1.2.1 // indirect
29+
github.com/jackc/puddle/v2 v2.1.2 // indirect
3530
github.com/json-iterator/go v1.1.12 // indirect
3631
github.com/leodido/go-urn v1.2.1 // indirect
3732
github.com/mattn/go-isatty v0.0.14 // indirect
3833
github.com/mitchellh/mapstructure v1.5.0 // indirect
3934
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4035
github.com/modern-go/reflect2 v1.0.2 // indirect
4136
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
42-
github.com/pkg/errors v0.9.1 // indirect
4337
github.com/russross/blackfriday/v2 v2.1.0 // indirect
4438
github.com/ugorji/go/codec v1.2.7 // indirect
4539
github.com/urfave/cli/v2 v2.11.1 // indirect
4640
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
47-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
48-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
49-
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect
41+
go.uber.org/atomic v1.10.0 // indirect
42+
golang.org/x/crypto v0.3.0 // indirect
43+
golang.org/x/mod v0.7.0 // indirect
44+
golang.org/x/net v0.2.0 // indirect
5045
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
51-
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
52-
golang.org/x/text v0.3.7 // indirect
53-
golang.org/x/tools v0.1.12 // indirect
46+
golang.org/x/sync v0.1.0 // indirect
47+
golang.org/x/sys v0.2.0 // indirect
48+
golang.org/x/text v0.4.0 // indirect
49+
golang.org/x/tools v0.3.0 // indirect
5450
google.golang.org/appengine v1.6.7 // indirect
5551
google.golang.org/protobuf v1.28.1 // indirect
5652
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 25 additions & 144 deletions
Large diffs are not rendered by default.

graph/entity.resolvers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ package graph
55

66
import (
77
"context"
8-
98
"github.com/KnightHacks/knighthacks_shared/models"
109
"github.com/KnightHacks/knighthacks_users/graph/generated"
1110
"github.com/KnightHacks/knighthacks_users/graph/model"
1211
)
1312

13+
// FindHackathonApplicationByID is the resolver for the findHackathonApplicationByID field.
14+
func (r *entityResolver) FindHackathonApplicationByID(ctx context.Context, id string) (*model.HackathonApplication, error) {
15+
return &model.HackathonApplication{ID: id}, nil
16+
}
17+
1418
// FindUserByID is the resolver for the findUserByID field.
1519
func (r *entityResolver) FindUserByID(ctx context.Context, id string) (*model.User, error) {
1620
user, err := r.Resolver.Repository.GetUserByID(ctx, id)

graph/generated/federation.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)