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

improved docker test environment #153

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ test-race:
env RACE=true OUT=sugardb/testdata make build-modules-test && \
CGO_ENABLED=1 go test ./... --race

test-win:
docker-compose -f windows_test_env/docker-compose.yaml up
testenv-run:
docker-compose -f test_env/run/docker-compose.yaml build
docker-compose -f test_env/run/docker-compose.yaml run projenv

testenv-test:
docker-compose -f test_env/test/docker-compose.yaml up --build

testenv-test-race:
docker-compose -f test_env/test_race/docker-compose.yaml up --build

testenv-all:
docker-compose -f test_env/all/docker-compose.yaml up --build

cover:
go tool cover -html=./coverage/coverage.out
Expand Down
19,085 changes: 9,731 additions & 9,354 deletions coverage/coverage.out

Large diffs are not rendered by default.

File renamed without changes.
12 changes: 12 additions & 0 deletions test_env/all/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# run from root dir
services:
test:
build:
context: ../..
dockerfile: test_env/all/Dockerfile
container_name: sugardb_test_env_all
volumes:
- ../../coverage/coverage.out:/testspace/coverage/coverage.out
stdin_open: true
tty: true

8 changes: 8 additions & 0 deletions test_env/run/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# run docker-compose from root dir
FROM golang:latest

WORKDIR /testspace

COPY . ./

CMD ["/bin/bash"]
10 changes: 10 additions & 0 deletions test_env/run/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# run from root dir
services:
projenv:
build:
context: ../..
dockerfile: test_env/run/Dockerfile
container_name: sugardb_test_env_run
stdin_open: true
tty: true

8 changes: 8 additions & 0 deletions test_env/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# run docker-compose from root dir
FROM golang:latest

WORKDIR /testspace

COPY . ./

CMD make test;
12 changes: 12 additions & 0 deletions test_env/test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# run from root dir
services:
test:
build:
context: ../..
dockerfile: test_env/test/Dockerfile
container_name: sugardb_test_env_test
volumes:
- ../../coverage/coverage.out:/testspace/coverage/coverage.out
stdin_open: true
tty: true

8 changes: 8 additions & 0 deletions test_env/test_race/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# run docker-compose from root dir
FROM golang:latest

WORKDIR /testspace

COPY . ./

CMD make test-race;
12 changes: 12 additions & 0 deletions test_env/test_race/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# run from root dir
services:
test:
build:
context: ../..
dockerfile: test_env/test_race/Dockerfile
container_name: sugardb_test_env_test_race
volumes:
- ../../coverage/coverage.out:/testspace/coverage/coverage.out
stdin_open: true
tty: true

12 changes: 0 additions & 12 deletions windows_test_env/docker-compose.yaml

This file was deleted.

Loading