Path to argument of xvfb-run "not found"

Replace this template with your information

I’ve set up a CI job that looks like this:

GuiTest:
  stage: test
  dependencies:
    - build
  before_script:
    - apt-get update && apt-get install python3-pyatspi gnome-icon-theme gsettings-desktop-schemas xvfb -y
  script:
    - chmod a+x ./tests/gui/test.py
    - xvfb-run./tests/gui/test.py

When the job runs I get the error

$ chmod a+x ./tests/gui/test.py
$ xvfb-run ./tests/gui/test.py
/usr/bin/xvfb-run: 184: ./tests/gui/test.py: not found

This looks to me like either the path ./tests/gui/test.py does not exist (which it does, after all chmod succeeds and ls validates the existence of test.py) or its permissions don’t exist (which is hard to believe.)

Line 184 of xvfb-run looks like this:
DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1

The job is running in a hosted environment.

Hmm,

I think your paths are problem. I assume you’re trying to access the files that are artifacts from build job and should be located in builds folder?

You need to know that actually GitLab clones your project and does everything in $CI_BUILDS_DIR, which is not / (root), but somewhere like /group/subgroup/project/...

So, if my assumption (first sentence) is correct, I think the solution to your problem is to remove the / in front of builds, as it’s not located in root, but in the same location where you are currently ($CI_BUILDS_DIR):

  script:
    - chmod a+x builds/sw/tests/gui/test.py
    - xvfb-run builds/sw/tests/gui/test.py

That was a sanity check. I didn’t run /builds/sw/tests/gui/test.py but ./tests/gui/test.py. (Fixing the post.)

*Update

What’s odd is that xvfb-run ls -l works!.

Solved:

cd tests/gui
xvfb-run python3 test.py
2 Likes