[KShare] Microsoft hosted agent no longer support Ubuntu 18.04

Hi Community members, :wave:

Are you aware that the Microsoft-hosted agents for Ubuntu 18.04 were retired completely from April 2023? In other words, you must update your yml file to Ubuntu 20.04 onwards.

There are some error messages that you may get familiar with when executing the tests with Azure DevOps or Github Action on Ubuntu 20.04 onwards.

  1. ADO Error(Operation Cancelled)
  2. Unable to init server: Could not connect: Connection refused" in Github Actions for Ubuntu 20.04
  3. Unable to init server: Could not connect: Connection refused
  4. Katalonc: Cannot open display:

To move forward, please refer to the following steps:

  1. On Ubuntu 20.04 and 22.04, Microsoft set JDK 11 as the default Java version. Thus, this default is incompatible with the Katalon Runtime OS requirement.
Required Operating System
Default Java Versions should be Katalon Runtime Engine Versions
OpenJDK 8 Version 8.x
OpenJDK 17 Version 9.x

So we basically need to change the default Java version on the yml file to 8 for KRE v8, and 17 for KRE v9 onward without manually downloading Java 11.

  1. In detail, to change the default Java version on your yml file, please refer to the parameters below:

Version 8.x

Azure DevOps

env:

    JAVA_HOME: $(JAVA_HOME_8_X64)

    PATH: $(JAVA_HOME_8_X64)/bin:$(PATH)

GitHub Actions

steps:

    - uses: actions/setup-java@v3

      with:

        distribution: 'zulu' # Set any 'Supported distributions' according to your preferences

        java-version: '8'

Version 9.x

Azure DevOps

env:

    JAVA_HOME: $(JAVA_HOME_17_X64)

    PATH: $(JAVA_HOME_17_X64)/bin:$(PATH)

GitHub Actions

steps:

    - uses: actions/setup-java@v3

      with:

        distribution: 'zulu' # Set any 'Supported distributions' according to your preferences

        java-version: '17'

:information_source: References:


Sample yml files to run with KRE v8:

Azure DevOps

trigger:

master

 

pool:

  vmImage: 'ubuntu-20.04'

 

steps:

task: katalonTask@1

  inputs:

    version: '8.6.8'

    executeArgs: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'

    xvfbConfiguration: '-s "-screen 0 1024x768x24"'

  env:

    JAVA_HOME: $(JAVA_HOME_8_X64)

    PATH: $(JAVA_HOME_8_X64)/bin:$(PATH)

GitHub Actions

name: Chris

 

# Controls when the workflow will run

on:

  # Triggers the workflow on push or pull request events but only for the "master" branch

  push:

    branches: [ "master" ]

  pull_request:

    branches: [ "master" ]

 

  # Allows you to run this workflow manually from the Actions tab

  workflow_dispatch:

 

# A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:

  build:

    runs-on: ubuntu-22.04

    steps:

    - uses: actions/setup-java@v3

      with:

        distribution: 'zulu' # Set any 'Supported distributions' according to your preferences

        java-version: '8'

name: Prepare

      run: |

            sudo apt-get -y install xvfb

            sudo /usr/bin/Xvfb :0 -screen 0 1280x1024x24 &

            

name: Katalon Studio Github Action

      uses: katalon-studio/katalon-studio-github-action@v2

      with:

          version: '8.6.8'

          projectPath: '${{ github.workspace }}'

          args: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'

Sample yml files to run with KRE v9

Azure DevOps

trigger:

master

 

pool:

  vmImage: 'ubuntu-20.04'

 

steps:

task: katalonTask@1

  inputs:

    version: '9.0.0'

    executeArgs: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'

    xvfbConfiguration: '-s "-screen 0 1024x768x24"'

  env:

    JAVA_HOME: $(JAVA_HOME_17_X64)

    PATH: $(JAVA_HOME_17_X64)/bin:$(PATH)

GitHub Actions

name: Chris

 

# Controls when the workflow will run

on:

  # Triggers the workflow on push or pull request events but only for the "master" branch

  push:

    branches: [ "master" ]

  pull_request:

    branches: [ "master" ]

 

  # Allows you to run this workflow manually from the Actions tab

  workflow_dispatch:

 

# A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:

  build:

    runs-on: ubuntu-22.04

    steps:

    - uses: actions/setup-java@v3

      with:

        distribution: 'zulu' # Set any 'Supported distributions' according to your preferences

        java-version: '17'

name: Prepare

      run: |

            sudo apt-get -y install xvfb

            sudo /usr/bin/Xvfb :0 -screen 0 1280x1024x24 &

            

name: Katalon Studio Github Action

      uses: katalon-studio/katalon-studio-github-action@v2

      with:

          version: '9.0.0'

          projectPath: '${{ github.workspace }}'

          args: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'
1 Like

Thank you Product Support team (@support.squad) as always for this insightful topic. And also a big shout-out to the individual below for your contribution to this topic:

Chris
Quan Trinh - Chris (@quan.trinh) - Product Support Specialist
Quan (Chris) is a Product Support Specialist who has offered informative and insightful advice to Katalon users worldwide for years. He is devoted to sustaining your testing journey with Katalon. No limits!!!
2 Likes