Skip to content
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ enclave: $(godeps) $(image_eif) terminate
--enclave-name veil \
--eif-path $(image_eif) \
--cpu-count 2 \
--memory 3850
--memory 4096

$(image_test_tar): $(godeps) $(image_test_dockerfile)
$(image_test_tar): $(godeps) $(image_test_dockerfile) docker/run-unit-tests.sh
@echo "Building $(image_test_tar)..."
@docker run --volume $(PWD):/workspace \
gcr.io/kaniko-project/executor:v1.9.2 \
Expand All @@ -84,7 +84,7 @@ enclave-test: $(godeps) $(image_test_eif) terminate
--eif-path $(image_test_eif) \
--attach-console \
--cpu-count 2 \
--memory 3850
--memory 4096

.PHONY: terminate
terminate:
Expand Down
14 changes: 2 additions & 12 deletions docker/Dockerfile-unit-test
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@ COPY cmd/ ./cmd/
COPY internal/ ./internal/
COPY vendor/ ./vendor/
COPY Makefile go.mod go.sum ./
RUN cat > ./run-unit-tests.sh <<EOF
#!/usr/bin/env bash
cd /app
# Needed for Go's build cache.
export HOME=/app
# Needed because otherwise we're getting:
# fork/exec /tmp/go-build1885828642/b001/cmd.test: permission denied
mkdir -p /app/tmp
export TMPDIR=/app/tmp
echo "Running Go unit tests..."
$(which go) test -cover ./...
EOF
COPY docker/run-unit-tests.sh ./run-unit-tests.sh
RUN chmod +x ./run-unit-tests.sh

RUN go mod download

Expand Down
12 changes: 12 additions & 0 deletions docker/run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euxo pipefail

cd /app
# Needed for Go's build cache.
export HOME=/app
# Needed because otherwise we're getting:
# fork/exec /tmp/go-build1885828642/b001/cmd.test: permission denied
mkdir -p /app/tmp
export TMPDIR=/app/tmp
echo "Running Go unit tests..."
$(which go) test -cover ./...
Loading