Q: KatalonStudio docker On Openshift?


#1

Hello Everyone,

I’m trying to run a pipeline where the katalonstudio must run a test a token should be copied, but I see that it does not want to start the katalonstudio in container on openshift, it mostly throws a Null error, so I’d like to know if openshift supports KatalonStudio in its dockerized version v 5.10.1

In console:

  • echo ‘Starting GDM Katalon Studio’
    Starting GDM Katalon Studio
    ++ pwd
  • current_dir=/katalon/katalon/source/GDM
  • tmp_dir=/katalon/katalon/tmp
  • project_dir=/katalon/katalon/project
  • cp -r /katalon/katalon/source/. /katalon/katalon/project
  • touch /katalon/katalon/project/.classpath
  • report_dir=/katalon/katalon/report
  • BASE_URL_SONAR=
  • BASE_URL_JENKINS=
    ++ find /katalon/katalon/project -maxdepth 1 -type f -name ‘*.prj’
  • project_file=/katalon/katalon/project/GDM.prj
  • cmd=’/opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/GDM.prj -browserType=’’‘Chrome (headless)’’’ -retry=2 -retryFailedTestCases=true -statusDelay=15 -testSuitePath=’’‘Test Suites/TS_GDM’’’’
  • /katalon/base/scripts/xvfb.sh start
  • XVFB=/usr/bin/Xvfb
  • XVFBARGS=’:99 -screen 0 1024x768x24 -fbdir /var/run -ac’
  • PIDFILE=/var/run/xvfb.pid
  • case “$1” in
  • echo -n ‘Starting virtual X frame buffer :99 1024x768x24’
  • start-stop-daemon --start --quiet --pidfile /var/run/xvfb.pid --make-pidfile --background --exec /usr/bin/Xvfb – :99 -screen 0 1024x768x24 -fbdir /var/run -ac
  • echo .
  • exit 0
    Starting virtual X frame buffer :99 1024x768x24.
  • cd /katalon/katalon/tmp
  • eval ‘/opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/GDM.prj -browserType=’’‘Chrome (headless)’’’ -retry=2 -retryFailedTestCases=true -statusDelay=15 -testSuitePath=’’‘Test Suites/TS_GDM’’’’
    ++ /opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/GDM.prj ‘-browserType=Chrome (headless)’ -retry=2 -retryFailedTestCases=true -statusDelay=15 ‘-testSuitePath=Test Suites/TS_GDM’
    error has occurred. See the log file
    atalon/katalon/tmp/1547233800961.log
    Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

LOG:
** tail -f 1547233800961.log**
!STACK
java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Long.java:552)
at java.lang.Long.parseLong(Long.java:631)
at org.eclipse.equinox.launcher.Main.getLastKnownConfigIniBaseTimestamp(Main.java:1974)
at org.eclipse.equinox.launcher.Main.processConfiguration(Main.java:1913)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

Anyone can help me?
Regards


Jenkins and Docker - Run Katalon - error: JVM terminated. Exit code=13
#2

Thank you for the detailed report. We will try running Katalon Studio image on OpenShift next week to reproduce.


#3

Hello @debalex88,

Ty for reply, Ok I will be waiting :grinning:

Regards


#4

Hi velascojonathanxd,

I’m currently working on the same topic. So far I’m able to run a pod which executes my tests. For me the next step is to get the results out of the finished pod. Then I’ll have a look into configuring the test run, e.g. tell Katalon which URL to run test against (I’m totally new to Katalon).

What I’ve done is

  1. create an S2I Builder Image, which gets a Git Repository with a Katalon project as its source and creates an image, which can execute the tests
  2. create a BuildConfig for the S2I and another one using this S2I and building the final image with your Katalon Project
  3. start a pod

I’ll give you more details here, but I’m afraid I cannot give you all the sources, since there are things from my customer in it.

The Builder Image

The Dockerfile for the S2I Buidler Image is

FROM katalonstudio/katalon:5.10.1

# Set the labels that are used for OpenShift to describe the builder image.
LABEL io.k8s.description="Source to Image for creating Katalon Test Suite Executor" \
	io.k8s.display-name="S2I Katalon Executor" \
	io.openshift.tags="builder,katalon,testing,e2e" \
	# this label tells s2i where to find its mandatory scripts
	# (run, assemble, save-artifacts)
	io.openshift.s2i.scripts-url="image:///usr/libexec/s2i"

ARG USERID=1001

# Copy the S2I scripts to /usr/libexec/s2i since we set the label that way
COPY ./s2i/bin/ /usr/libexec/s2i

RUN chmod 755 /usr/libexec/s2i/* \
	&& chmod -R a+w /katalon /opt \
	&& chmod a+x /opt/katalonstudio/katalon \
	&& find /opt -type d -exec chmod a+x {} \; \
	&& mkdir /home/katalon \
	&& chmod a+wx /home/katalon \
	&& echo "-Duser.home=/home/katalon" >> /opt/katalonstudio/katalon.ini

USER $USERID

CMD ["/usr/libexec/s2i/usage"]

The assemble script contains

if [[ "$(ls -A /tmp/src)" ]]; then
	mv /tmp/src /katalon/katalon/source
	chmod ga+w /katalon/katalon/source
fi

The run script contains

[[ -z $BROWSER_TYPE ]] && BROWSER_TYPE="Chrome"
[[ -z $TEST_SUITE_PATH ]] && TEST_SUITE_PATH="set the test suite path via TEST_SUITE_PATH env variable"

exec /katalon/katalon/scripts/katalon-execute.sh -consoleLog -browserType="$BROWSER_TYPE" -retry=0 -statusDelay=15 -testSuitePath="$TEST_SUITE_PATH"

Add a new build for the S2I project itself, to build the builder image. Note you need to have a secret created and added to the git repository.

oc new-build git@github.com:path/to/repo.git --source-secret github-s2i-katalon-executor

Building a concrete image

The Katalon project is contained in its own Git repository. Now you add a build based on the S2I and your Katalon project (again a secret is needed)

oc new-build s2i-katalon-executor~git@github.com:path/to/katalonproject.git --source-secret github-katalon-project

Start a pod

The concrete image can be run with

oc run katalon-test-1 --image=docker-registry.default.svc:5000/openshiftproject/concrete-katalon-project-image-stream --env=TEST_SUITE_PATH="Test Suites/MyTestSuite" --restart=Never

Check the logs and see how your tests are running.

That’s the point I’m currently at. My solution may not be the optimal and the code is just to get it working. Many problems arose from Katalon creating folders and assuming that the container runs with root. I hope this helps a bit.

Cheers,
Lars