What is the project directory when configured with Gitlab CI

Hi, I am working on integrating Katalon with Gitlab CI but have failed many times. I have installed gitlab-runner directly on Windows 10 instead of docker. I followed the instruction from the official doc to setup configuration file as follows:

run_katalon_test_suite:
  tags:
    - shell
  script:
    - katalon -noSplash  -runMode=console -consoleLog -projectPath=
      "C:/Users/<user_name>/Katalon Studio/<project_name>" -retry=0
      -testSuitePath="Test Suites/Sample Test Suite" -executionProfile=
      "login as Nick Huang" -browserType="Chrome (headless)" 

However, I got **ERROR: Job failed: exit status 2 **after running pipeline:

Running with gitlab-runner 11.4.0 (8af42251)  on ab e0c76b18Using Shell executor...Running on <username>...Fetching changes...Removing config/.metadata/.plugins/org.eclipse.core.resources/.projects/C%%Users%<username>%Katalon Studio%<project_name>%<project_name>.prj/.locationRemoving config/.metadata/.plugins/org.eclipse.core.resources/.projects/C%%Users%<username>%Katalon Studio%<project_name>%<project_name>.prj/.markers.snapRemoving config/.metadata/.plugins/org.eclipse.core.resources/.projects/C%%Users%<username>%Katalon Studio%<project_name>%<project_name>.prj/.syncinfo.snapRemoving config/.metadata/.plugins/org.eclipse.core.resources/.rootRemoving config/.metadata/.plugins/org.eclipse.core.resources/.safetableRemoving config/.metadata/.plugins/org.eclipse.core.resources/0.snapRemoving config/.metadata/.plugins/org.eclipse.core.runtimeRemoving config/.metadata/.plugins/org.eclipse.debug.coreRemoving config/.metadata/.plugins/org.eclipse.jdt.coreRemoving config/.metadata/.plugins/org.eclipse.jdt.launchingRemoving config/.metadata/.logRemoving config/recent_projectswarning: could not open directory 'config/.metadata/.plugins/org.eclipse.core.resources/.projects/C%%Users%<username>%Katalon Studio%<project_name>%<project_name>.prj/org.eclipse.jdt.core/': Filename too longwarning: Could not stat path 'config/.metadata/.plugins/org.eclipse.core.resources/.projects/C%%Users%<username>%Katalon Studio%<project_name>%<project_name>.prj/org.eclipse.jdt.core': Filename too longHEAD is now at 36e989a Fix yml with valid execution profileFrom https://<gitlab>/<username>/<repo>   36e989a..d094b97  katalon-test -> origin/katalon-testChecking out d094b970 as katalon-test...Skipping Git submodules setup$ katalon -noSplash  -runMode=console -consoleLog -projectPath= "C:/Users/<username>/Katalon Studio/<project_name>/<project_name>.prj" -retry=0 -testSuitePath="Test Suites/Sample Test Suite" -executionProfile= "login as Nick Huang" -browserType="Chrome ^(headless^)"ERROR: Job failed: exit status 2

My test case is a simple login test with two steps:

WebUI.openBrowser('')
WebUI.authenticate('https://url-for-authentication', 
                                 GlobalVariable.username, 
                                 GlobalVariable.password, 5)
WebUI.navigateToUrl('https://url-to-home-page')

Thanks in advance:)

1 Like

You have this now:

katalon -noSplash  -runMode=console -consoleLog -projectPath=....

You should not specify ‘-consoleLog’ if you run katalon under the control of CI server. Change this to:

katalon -noSplash  -runMode=console -projectPath=....

Then you will find more verbose messages logged by CI sever. The messages will tell why you got exit status 2; for example WebUI.authenticate() failed etc.

(The official doc is explaining “Console mode execution” in general; not necessarily 100% precise for running it under CI server)

1 Like