summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-05-10 13:18:14 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-05-10 13:18:14 +0200
commitcd5019305db965b4e3acb028ec1f1524d0199917 (patch)
tree798318aee35661a8e3d07da5e3b4e8a992d32052 /ci
parent9e3e7f22892c3504e6de9827af0fabd9b4b098ea (diff)
Python: Add config retrieval test
Diffstat (limited to 'ci')
-rw-r--r--ci/docker/go-test.docker44
1 files changed, 25 insertions, 19 deletions
diff --git a/ci/docker/go-test.docker b/ci/docker/go-test.docker
index 04b6a99..7636cae 100644
--- a/ci/docker/go-test.docker
+++ b/ci/docker/go-test.docker
@@ -8,35 +8,41 @@ WORKDIR /eduvpn
# 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
+RUN apt-get -y install openjdk-11-jre xvfb python3-selenium firefox python3-pyvirtualdisplay python3-pip
# Install geckodriver and add to path
-WORKDIR /eduvpn/go/vendor
-
+WORKDIR /eduvpn/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"
+ENV PATH="/eduvpn/vendor:$PATH"
+
+# Update certificates
+COPY ./ci/docker/selfsigned/eduvpnserver.crt /usr/local/share/ca-certificates/eduvpnserver.crt
+RUN update-ca-certificates
-# Set up file tree
-WORKDIR /eduvpn/go
+# Run tests as a new user for pip
+RUN useradd --create-home test
+USER test
-# Taken from golang docker example
-# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
-COPY ./go.mod go.sum ./
+WORKDIR /home/test
+
+# Copy sources with correct permissions
+COPY --chown=test:test . ./
+
+# Download and verify go dependencies
RUN go mod download && go mod verify
-WORKDIR /eduvpn/go
+# Clean because there might be previous builds copied over
+RUN make clean
-# Copy go source
-COPY *.go ./
-COPY ./internal ./internal
+# Build go
+RUN make build
-# Copy selenium scripts
-COPY ./selenium_eduvpn.py ./selenium_eduvpn.py
+# Make python lib
+RUN make -C wrappers/python
-# Update certificates
-COPY ./ci/docker/selfsigned/eduvpnserver.crt /usr/local/share/ca-certificates/eduvpnserver.crt
-RUN update-ca-certificates
+# Install python lib
+RUN pip3 install wrappers/python/dist/*.whl
# Run the tests
-CMD ["go", "test", "-mod=readonly", "./...", "-v"]
+CMD ["make", "test"] \ No newline at end of file