Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 0 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,3 @@ jobs:
go-version: '1.22'
- name: Run tests
run: make e2e-test-nats
e2e-test-grpc:
name: GRPC Test End to End
runs-on: ubuntu-latest
needs: deps
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run tests
run: make e2e-test-grpc
30 changes: 11 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ifeq ($(OS), Windows_NT)
BIN := pitaya-cli.exe
XK6_BIN := k6.exe
MKFOLDER := if not exist "build" mkdir build
GREP_CMD := findstr /V
else
BIN := pitaya-cli
XK6_BIN := k6
MKFOLDER := mkdir -p build
GREP_CMD := grep -v
endif

TESTABLE_PACKAGES = `go list ./... | $(GREP_CMD) examples | $(GREP_CMD) constants | $(GREP_CMD) mocks | $(GREP_CMD) helpers | $(GREP_CMD) interfaces | $(GREP_CMD) protos | $(GREP_CMD) e2e | $(GREP_CMD) benchmark`

.PHONY: all build

setup: init-submodules
@go get ./...

build:
@$(MKFOLDER)
@mkdir -p build
@go build -o build/$(BIN) .
@echo "build pitaya-cli at ./build/$(BIN)"

Expand All @@ -34,7 +34,7 @@ setup-ci:

setup-protobuf-macos:
@brew install protobuf
@go install github.com/golang/protobuf/protoc-gen-go@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

run-jaeger-aio:
@docker-compose -f ./examples/testing/docker-compose-jaeger.yml up -d
Expand All @@ -53,20 +53,14 @@ run-cluster-example-frontend:
@PITAYA_METRICS_PROMETHEUS_PORT=9090 go run examples/demo/cluster/main.go

run-cluster-protobuf-frontend-example:
@cd examples/demo/cluster_protobuf && go run main.go
@cd examples/demo/cluster && go run main.go -serializer=protobuf

run-cluster-protobuf-backend-example:
@cd examples/demo/cluster_protobuf && go run main.go --port 3251 --type room --frontend=false
@cd examples/demo/cluster && go run main.go -serializer=protobuf --port 3251 --type room --frontend=false

run-cluster-example-backend:
@PITAYA_METRICS_PROMETHEUS_PORT=9091 go run examples/demo/cluster/main.go --port 3251 --type room --frontend=false

run-cluster-grpc-example-connector:
@cd examples/demo/cluster_grpc && go run main.go

run-cluster-grpc-example-room:
@cd examples/demo/cluster_grpc && go run main.go --port 3251 --rpcsvport 3435 --type room --frontend=false

run-cluster-worker-example-room:
@cd examples/demo/worker && go run main.go --type room --frontend=true

Expand All @@ -84,11 +78,13 @@ run-rate-limiting-example:

protos-compile-demo:
@protoc -I examples/demo/protos examples/demo/protos/*.proto --go_out=.
@protoc -I examples/demo/worker/protos examples/demo/worker/protos/*.proto --go_out=.
@protoc -I examples/testing/protos examples/testing/protos/*.proto --go_out=.

protos-compile:
@cd benchmark/testdata && ./gen_proto.sh
@protoc -I pitaya-protos/ pitaya-protos/*.proto --go_out=plugins=grpc:protos
@protoc -I pitaya-protos/test pitaya-protos/test/*.proto --go_out=protos/test
@protoc -I pitaya-protos/ pitaya-protos/*.proto --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./pkg/protos --go_out=paths=source_relative:./pkg/protos
@protoc -I pitaya-protos/test pitaya-protos/test/*.proto --go_out=paths=source_relative:./pkg/protos/test

rm-test-temp-files:
@rm -f cluster/127.0.0.1* 127.0.0.1*
Expand All @@ -109,16 +105,12 @@ kill-testing-deps:
kill-jaeger:
@docker-compose -f ./examples/testing/docker-compose-jaeger.yml down; true

e2e-test: e2e-test-nats e2e-test-grpc
e2e-test: e2e-test-nats

e2e-test-nats: ensure-testing-deps ensure-testing-bin
@echo "===============RUNNING E2E NATS TESTS==============="
@go test ./e2e/e2e_test.go -update

e2e-test-grpc: ensure-testing-deps ensure-testing-bin
@echo "===============RUNNING E2E GRPC TESTS==============="
@go test ./e2e/e2e_test.go -update -grpc

bench-nats-sv:
@PITAYA_METRICS_PROMETHEUS_PORT=9098 ./examples/testing/server -type game -frontend=false > /dev/null 2>&1 & echo $$! > back.PID
@PITAYA_METRICS_PROMETHEUS_PORT=9099 ./examples/testing/server -type connector -frontend=true > /dev/null 2>&1 & echo $$! > front.PID
Expand Down
2 changes: 1 addition & 1 deletion benchmark/testdata/gen_proto.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
protoc --go_out . *.proto
protoc --go_out=paths=source_relative:. *.proto
248 changes: 171 additions & 77 deletions benchmark/testdata/test.pb.go

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

Loading