Skip to content

Commit

Permalink
improved docker test environment (#153)
Browse files Browse the repository at this point in the history
* Test environment enhancement - @osteensco
  • Loading branch information
osteensco authored Nov 26, 2024
1 parent 64ef34f commit 3b15061
Show file tree
Hide file tree
Showing 11 changed files with 9,813 additions and 9,368 deletions.
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.

0 comments on commit 3b15061

Please sign in to comment.