adding first tests + small refactoring for tests

This commit is contained in:
Julien Neuhart
2018-04-04 15:17:04 +02:00
parent 4381504f95
commit 1564219f8b
14 changed files with 237 additions and 19 deletions

32
Dockerfile.tests Normal file
View File

@@ -0,0 +1,32 @@
FROM golang:1.10-stretch
LABEL authors="Julien Neuhart <j.neuhart@thecodingmachine.com>"
# |--------------------------------------------------------------------------
# | Libraries
# |--------------------------------------------------------------------------
# |
# | Installs all required libraries.
# |
RUN echo "deb http://httpredir.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list &&\
apt-get update &&\
apt-get install -y xvfb wkhtmltopdf pdftk unoconv ttf-mscorefonts-installer &&\
ln -s /usr/bin/xvfb-run /usr/local/bin/xvfb-run &&\
ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf &&\
ln -s /usr/bin/pdftk /usr/local/bin/pdftk &&\
ln -s /usr/bin/unoconv /usr/local/bin/unoconv
# |--------------------------------------------------------------------------
# | Gotenberg
# |--------------------------------------------------------------------------
# |
# | All Gotenberg related stuff.
# |
WORKDIR /go/src/github.com/gulien/gotenberg
COPY . .
RUN go get -d -v ./...
CMD ["go", "test", "-race", "-cover", "./..."]