summaryrefslogtreecommitdiff
path: root/ci/docker/go-test.docker
blob: 9e6ad3acdb746f7cfa946c4c0fbbd02cb17f94a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM golang:1.18

WORKDIR /eduvpn


# Selenium dependencies

# Firefox
RUN echo "deb http://deb.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list.d/debian.list
RUN apt-get update
RUN apt-get -y install openjdk-11-jre xvfb python3-selenium firefox python3-pyvirtualdisplay

# Install geckodriver and add to path
WORKDIR /eduvpn/go/vendor

RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz
RUN tar xzvf geckodriver-v0.30.0-linux64.tar.gz

ENV PATH="/eduvpn/go/vendor:$PATH"

WORKDIR /eduvpn/go

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY ./go.mod go.sum ./
RUN go mod download && go mod verify

WORKDIR /eduvpn/go

# Copy go source
COPY ./src ./src

# Copy selenium scripts
COPY ./selenium_eduvpn.py ./selenium_eduvpn.py

CMD ["go", "test", "-mod=readonly", "github.com/jwijenbergh/eduvpn-common/src", "-v"]