This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,23 @@ FROM ${BUILD_ORGANIZATION}/${BUILD_PARENT_IMAGE}:${BUILD_TAG} as theia
10
10
FROM cypress/browsers:chrome67
11
11
12
12
USER root
13
- ENV HOME=/root
14
13
ENV NOCDN=true
15
14
16
15
RUN printf "deb http://archive.debian.org/debian/ jessie main\n deb-src http://archive.debian.org/debian/ jessie main\n deb http://security.debian.org jessie/updates main\n deb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
17
16
RUN apt-get update && \
18
17
apt-get install -y libx11-dev libxkbfile-dev sudo iproute2
19
- CMD /root/docker-run.sh
20
18
RUN yarn global add typescript@2.9.2 node-gyp && node-gyp install
21
19
22
20
# Add cypress scripts and grab dependencies
23
- COPY src /root /
24
- RUN cd /root && yarn
21
+ COPY src /projects /
22
+ RUN cd /projects && yarn
25
23
26
24
# Add tests
27
- ADD cypress /root /cypress/
25
+ ADD cypress /projects /cypress/
28
26
29
27
COPY --from=theia /home/theia /home/theia
30
28
COPY --from=theia /entrypoint.sh /entrypoint.sh
31
29
RUN find /home/theia/ -name "binding.gyp" | xargs -i sh -c 'cd $(dirname {}) && node-gyp rebuild --ensure'
30
+
31
+ USER theia
32
+ CMD /projects/docker-run.sh
Original file line number Diff line number Diff line change 10
10
: " ${WAIT_COUNT:= 30} "
11
11
12
12
echo " Starting Theia..."
13
- rm -rf /root /logs/*
14
- HOME=/home/theia /entrypoint.sh > /root /logs/theia.log 2> /root /logs/theia-error.log&
13
+ rm -rf /projects /logs/*
14
+ HOME=/home/theia /entrypoint.sh > /projects /logs/theia.log 2> /projects /logs/theia-error.log&
15
15
16
16
echo " Cleaning videos folder..."
17
17
# Cleanup previous videos
18
- rm -rf /root /cypress/videos/*
18
+ rm -rf /projects /cypress/videos/*
19
19
20
20
# Find TCP 0.0.0.0:3100 that will be opened by Theia.
21
21
sleep 5s
35
35
36
36
# Run tests
37
37
echo " Run the tests"
38
- cd /root && unset LD_LIBRARY_PATH && /root /node_modules/.bin/cypress run -c trashAssetsBeforeRuns=false --browser chrome
38
+ cd /projects && unset LD_LIBRARY_PATH && /projects /node_modules/.bin/cypress run -c trashAssetsBeforeRuns=false --browser chrome
Original file line number Diff line number Diff line change 19
19
20
20
# Runs E2E tests in a docker container.
21
21
run_test_in_docker_container () {
22
+ mkdir -p ${base_dir} /$1
22
23
docker_exec run --rm ${DOCKER_RUN_OPTIONS} \
23
- -v " ${base_dir} /videos" :/root/cypress/videos \
24
- -v " ${base_dir} /logs" :/root/logs \
24
+ --user $1 \
25
+ -v " ${base_dir} /$1 /videos" :/projects/cypress/videos \
26
+ -v " ${base_dir} /$1 /logs" :/projects/logs \
25
27
-v /var/run/docker.sock:/var/run/docker.sock \
26
28
$IMAGE_NAME
27
29
}
28
30
29
- run_test_in_docker_container
31
+ run_test_in_docker_container ' 0:0'
32
+ run_test_in_docker_container ' 1234:5678'
You can’t perform that action at this time.
0 commit comments