Skip to content

Commit

Permalink
Merge pull request #60 from KnightHacks/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
LockedThread committed Dec 3, 2022
2 parents 0f69d31 + 75a4315 commit d23f41e
Show file tree
Hide file tree
Showing 20 changed files with 2,003 additions and 241 deletions.
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# we will put our integration testing in this path
INTEGRATION_TEST_PATH?=./integration_tests

# set of env variables that you need for testing
POSTGRES_URI=postgresql://postgres:test@localhost:5432/postgres

# this command will start a docker components that we set in docker-compose.yml
docker.start.components:
docker-compose -f docker-compose-test.yaml up -d --remove-orphans postgres;

# shutting down docker components
docker.stop:
docker-compose -f docker-compose-test.yaml down -v

# this command will trigger integration test
# INTEGRATION_TEST_SUITE_PATH is used for run specific test in Golang, if it's not specified
# it will run all tests under ./integration_tests directory
test.integration:
$(MAKE) docker.start.components
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI)
$(MAKE) docker.stop

# this command will trigger integration test with verbose mode
test.integration.debug:
$(MAKE) docker.start.components
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -v -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI)
$(MAKE) docker.stop
11 changes: 11 additions & 0 deletions docker-compose-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
postgres:
image: "postgres:15-alpine"
restart: always
command: [ "postgres", "-c", "log_statement=all" ]
environment:
POSTGRES_PASSWORD: test
ports:
- "5432:5432"
volumes:
- ./integration_tests/init.sql:/docker-entrypoint-initdb.d/db.sql
26 changes: 11 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.19

require (
github.com/99designs/gqlgen v0.17.13
github.com/KnightHacks/knighthacks_shared v0.0.0-20221121010043-cf2a1397df2e
github.com/KnightHacks/knighthacks_shared v0.0.0-20221122100922-bb5380fde900
github.com/gin-gonic/gin v1.8.1
github.com/jackc/pgx/v4 v4.16.1
github.com/jackc/pgx/v5 v5.1.1
github.com/vektah/gqlparser/v2 v2.4.7
)

Expand All @@ -24,33 +24,29 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.12.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.11.0 // indirect
github.com/jackc/puddle v1.2.1 // indirect
github.com/jackc/puddle/v2 v2.1.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/tools v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
169 changes: 25 additions & 144 deletions go.sum

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion graph/entity.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ package graph

import (
"context"

"github.com/KnightHacks/knighthacks_shared/models"
"github.com/KnightHacks/knighthacks_users/graph/generated"
"github.com/KnightHacks/knighthacks_users/graph/model"
)

// FindHackathonApplicationByID is the resolver for the findHackathonApplicationByID field.
func (r *entityResolver) FindHackathonApplicationByID(ctx context.Context, id string) (*model.HackathonApplication, error) {
return &model.HackathonApplication{ID: id}, nil
}

// FindUserByID is the resolver for the findUserByID field.
func (r *entityResolver) FindUserByID(ctx context.Context, id string) (*model.User, error) {
user, err := r.Resolver.Repository.GetUserByID(ctx, id)
Expand Down
37 changes: 37 additions & 0 deletions graph/generated/federation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d23f41e

Please sign in to comment.