runIdeForUiTests doesn't start server (robot-server) when run inside docker container

Answered

I started a container.

Logged into it interactively, and attempted to start the runIdeForUiTests task. with xvfb:

xvfb-run ./gradlew :runIdeForUiTests --info

The process started fine but trying to connect to the container from a separated terminal and doing: curl http://127.0.0.1:8082 returns Connection Refused meaning the server isnt started.

Outside the container it works fine.

I'm talking about the https://github.com/JetBrains/intellij-ui-test-robot . I added the server to the build.gradle as per the docs.

0
7 comments

Hello Naveha, could you please check if making the port public as described in the Setup paragraph (the last code block before the next paragraph) helps? Also, please ensure your container's port mapping is set up correctly. 

0

Hello,

I tried setting the port public but no effect. I've started the container with -p 8082:8082 but still nothing, cant see the see in the host or inside the container itself.

I've managed to get around the error when using idea 2019 but disabling some of the default properties:

so it looks like this:

//    In case your Idea is launched on remote machine you can enable public port and enable encryption of JS calls
// systemProperty "robot-server.host.public", "true"
// systemProperty "robot.encryption.enabled", "true"
// systemProperty "robot.encryption.password", "my super secret"

systemProperty "robot-server.port", "8082"
// systemProperty "ide.mac.message.dialogs.as.sheets", "false"
// systemProperty "jb.privacy.policy.text", "<!--999.999-->"
// systemProperty "jb.consents.confirmation.enabled", "false"
// systemProperty "ide.mac.file.chooser.native", "false"
// systemProperty "jbScreenMenuBar.enabled", "false"
// systemProperty "apple.laf.useScreenMenuBar", "false"
// systemProperty "idea.trust.all.projects", "true"
// systemProperty "ide.show.tips.on.startup.default.value", "false"
// systemProperty "eap.require.license", "true"

 

like this I dont get ANY exceptions when running ./gradlew :runIdeForUiTests --info

but still i cant see the server with curl 127.0.0.1:8082 gives connection refused both inside and outside the container.

Running a test gives TimeoutException waiting for the ide to start.

Tried doing

export DISPLAY=:0

Xvfb -ac :0 &

and then the gradlew command from above.

I've also tried to increase the ram for the container using

docker run --shm-size=256m but still nothing.

0

I've managed to find the problem, it was that the ide started but got stuck at the "Evaluation/Register screen" where the user must either select to evaluate the copy or login/register (it's the ultimate edition that gets downloaded and tested on).

I started a vnc server in the container and then was able to see this screen, once I manually selected to evaluate the copy the ide got started and with it the robot-server is working.

So with community edition I got around that but we regularly test on the ultimate edition as well and I wonder if there's an option to set it to evaluate by default somehow? so we won't have to manually select the evaluate option (when the ide is started from the runIdeForUiTests)

Thank you.

0

Thank you for letting me know about the solution! Please, try to pass the license key to the IDE using the instruction provided by this link (the Pass ide license paragraph).

0

Thank you.

I wonder if there's a way to automatically start the IDE in evaluation mode? it's always a new copy of the ide (the whole container is new everytime) and we start the ide using the runIdeForUiTests and the robot-server isnt started until we either press the "evaluation" or put an ide license as you suggested.

0

By the evaluation, do you mean the trial? I'm afraid the only way to start the IDE without asking for a license/starting trial is by providing the license key as described in the instruction. 

0

I understand, thank you.

0

Please sign in to leave a comment.