diff --git a/dockerfiles/e2e/Dockerfile b/dockerfiles/e2e/Dockerfile index 644d4f05d0..c0bcb3bd5c 100644 --- a/dockerfiles/e2e/Dockerfile +++ b/dockerfiles/e2e/Dockerfile @@ -1,12 +1,14 @@ FROM selenium/standalone-chrome:latest +ENV DISPLAY=':20' + USER root RUN apt-get update && apt-get install && \ apt-get install -y nodejs && \ apt-get install -y npm && \ npm install -g typescript && \ - apt-get install vnc4server -y + apt-get install x11vnc -y COPY e2e/package.json e2e/package-lock.json /tmp/e2e/ @@ -18,4 +20,6 @@ COPY entrypoint.sh /tmp/ WORKDIR /tmp/e2e +EXPOSE 5920 + ENTRYPOINT [ "/tmp/entrypoint.sh" ] diff --git a/dockerfiles/e2e/entrypoint.sh b/dockerfiles/e2e/entrypoint.sh index d84076d48a..88aaaa9429 100755 --- a/dockerfiles/e2e/entrypoint.sh +++ b/dockerfiles/e2e/entrypoint.sh @@ -12,6 +12,18 @@ if [ -z "$TEST_SUITE" ]; then TEST_SUITE=test-happy-path fi +# Launch display mode and VNC server +export DISPLAY=':20' +Xvfb :20 -screen 0 1920x1080x16 > /dev/null 2>&1 & +x11vnc -display :20 -N -forever > /dev/null 2>&1 & +echo '' +echo '#######################' +echo '' +echo 'For remote debug connect to the VNC server 0.0.0.0:5920' +echo '' +echo '#######################' +echo '' + # Launch selenium server /usr/bin/supervisord --configuration /etc/supervisord.conf & \ export TS_SELENIUM_REMOTE_DRIVER_URL=http://localhost:4444/wd/hub diff --git a/e2e/README.md b/e2e/README.md index 31fc9d6ee5..b6a0960d9c 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -36,9 +36,13 @@ - export the ```"TS_SELENIUM_BASE_URL"``` variable with "Che" url - run command ```"npm run test-docker-mount-e2e"``` +## Debug docker launch + +The ```'eclipse/che-e2e'``` docker image has VNC server instaled inside. For connecting use ```'0.0.0.0:5920'``` adress. + ## The "Happy Path" scenario launching -**The easiest way to do that is to perform steps which described in the "Docker launch" paragraph. +**The easiest way to do that is to perform steps which are described in the "Docker launch" paragraph. For running tests without docker, please perform next steps:** - Deploy Che on Kubernetes infrastructure by using 'Minikube' and 'Chectl' diff --git a/e2e/package.json b/e2e/package.json index e82b9973ca..a1064ea034 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -5,8 +5,8 @@ "main": "dist/index.js", "scripts": { "cleanup-docker": "if [ $(docker ps -a | grep -c selenium-e2e) -gt 0 ]; then docker rm -f $(docker ps --filter \"name=selenium-e2e\" -aq); fi;", - "test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly", - "test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly", + "test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly", + "test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly", "test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha.opts", "test-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-happy-path.opts", "test-che-install": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-che-operatorhub.opts",