xvfb should not be mandatory in custom container image when using ROBOT_BASE_IMAGE variable
## Describe the bug Using a light container image without xvfb is impossible since it's always called in `function robot_cli()` https://gitlab.com/to-be-continuous/robotframework/-/blob/master/templates/gitlab-ci-robotframework.yml#L404 I am only testing with robotframework modules that don't need a display (robotframework-requests, robotframework-datadriver, robotframework-jsonlibrary ...) ## Expected behavior I would like to run my tests without having xvfb in image, maybe reuse variable `ROBOT_BROWSER=none` to run tests without `xvfb-run` ? ## Actual behavior I would like to run tests without `xvfb-run`, directly by using `robot`/`pabot` inside `function robot_cli()` ## Logs and/or screenshots ``` Running with gitlab-runner ... on gitlab-runner-... Preparing the "kubernetes" executor 00:00 Preparing environment 00:14 Getting source from Git repository 00:10 Executing "step_script" stage of the job script 00:01 $ # BEGSCRIPT # collapsed multi-line command $ install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" $ mkdir -p -m 777 reports $ maybe_exec_hook "./pre-robot.sh" $ robot_cli $ROBOT_OPTIONS --variable BROWSER:${ROBOT_BROWSER} --outputdir reports/ --xunit robotframework.xunit.xml $ROBOT_TESTS_DIR || rc=$? [INFO] No upstream environment url found: leave default /scripts-1572-746482/step_script: line 446: xvfb-run: command not found $ maybe_exec_hook "./post-robot.sh" $ exit $rc Uploading artifacts for failed job 00:01 Uploading artifacts... WARNING: reports/robotframework.*: no matching files. Ensure that the artifact path is relative to the working directory (/builds/gosmic/gosmicval) ERROR: No files to upload Uploading artifacts... WARNING: reports/robotframework.xunit.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/gosmic/gosmicval) ERROR: No files to upload Cleaning up project directory and file based variables 00:00 ERROR: Job failed: command terminated with exit code 127 ``` ## Context & Configuration Link to a project: private The issue was reproduced using: * Version of the template: '4.4.0' * GitLab server(s): self-managed GitLab Community Edition v17.11.4 * GitLab runner(s): not relevant Here is the `.gitlab-ci.yml` file: ```yaml ... include: # Include Robot Framework - project: 'to-be-continuous/robotframework' ref: '4.4.0' file: '/templates/gitlab-ci-robotframework.yml' variables: ROBOT_BASE_IMAGE: '$CI_REGISTRY/my-group/my-project/my-custom-image:1.0.0' ROBOT_TESTS_DIR: "/opt/robotframework/tests" ``` # Additional information A light docker container referenced by ROBOT_BASE_IMAGE to test this issue could look like this : ```dockerfile FROM python:3.13-slim RUN apt-get update && \ apt-get install -y git=1:2.39* --no-install-recommends && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir \ robotframework==6.1.1 \ robotframework-pabot==4.2.0 \ allure-robotframework==2.13.2 \ robotframework-robocop==6.1.1 \ robotframework-openapidriver==4.3.0 \ robotframework-datadriver==1.11.2 \ robotframework-openapi-libcore==1.11.0 \ robotframework-jsonlibrary==0.5 \ robotframework-requests==0.9.7 ``` This image is around 96 MiB, by adding `xvfb=2:21.1*` and a needed depency `xauth=1:1.1*` the image is around 170 MiB.
issue