forked from netobserv/netobserv-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.e2e
More file actions
61 lines (46 loc) · 1.68 KB
/
Copy pathDockerfile.e2e
File metadata and controls
61 lines (46 loc) · 1.68 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Dockerfile for running Cypress E2E tests in OpenShift CI
# This runs tests against a real OpenShift cluster
FROM cypress/included:15.15.0
# Install additional dependencies
USER root
RUN apt-get update && apt-get install -y \
curl \
jq \
apache2-utils \
&& rm -rf /var/lib/apt/lists/*
# Install oc CLI for OpenShift interactions
RUN curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz && \
tar -xzf openshift-client-linux.tar.gz && \
mv oc /usr/local/bin/ && \
mv kubectl /usr/local/bin/ && \
rm openshift-client-linux.tar.gz && \
chmod +x /usr/local/bin/oc /usr/local/bin/kubectl
WORKDIR /opt/app-root
# Copy scripts first
COPY scripts/run-e2e-tests.sh ./scripts/
RUN chmod +x ./scripts/run-e2e-tests.sh
# Copy web directory
WORKDIR /opt/app-root/web
# Copy package files first for better layer caching
COPY web/package.json web/package-lock.json ./
# Install npm dependencies
RUN npm --legacy-peer-deps ci
# Copy the rest of the web application
COPY web/ ./
# Create directories for test results and screenshots
RUN mkdir -p gui_test_screenshots/cypress/screenshots \
gui_test_screenshots/cypress/videos \
cypress/results/junit && \
chmod -R 777 gui_test_screenshots cypress/results
# Set environment variables
ENV HOME=/tmp
ENV NO_COLOR=1
ENV WEB_DIR=/opt/app-root/web
RUN mkdir -p /root/.cache/Cypress /tmp && \
chmod 1777 /tmp && \
chmod -R g+rwX /root/.cache/Cypress
# Make directories writable for OpenShift arbitrary UIDs (group 0)
RUN chmod -R g+rwX /opt/app-root
WORKDIR /opt/app-root
# Use the run-e2e-tests.sh script as the entrypoint
ENTRYPOINT ["/opt/app-root/scripts/run-e2e-tests.sh"]