Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to run (GNU/Linux) GUI tests in Bazel #22446

Open
radoye opened this issue May 18, 2024 · 1 comment
Open

Document how to run (GNU/Linux) GUI tests in Bazel #22446

radoye opened this issue May 18, 2024 · 1 comment
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: support / not a bug (process)

Comments

@radoye
Copy link

radoye commented May 18, 2024

Description of the bug:

It is unclear how to run GUI tests. For example

bazel test //:my_gui_test --test_arg=--enable_display=true --test_env=DISPLAY --test_output=all

where :my_gui_test contains

  if (glfwInit() != GLFW_TRUE) {
    return absl::AbortedError("GLFW failed to initialize.");
  }

fails with logs (logging code not displayed)

Authorization required, but no authorization protocol specified
[16:19:58.798375] [error] GLFW error 65544: X11: Failed to open display :0

The same code works just fine in a cc_binary when actually executed in the user environment. It seems that, for some reason, test code cannot connect to X11 display.

So, something is different about the test environment in this respect, but I can't seem to find any mention in the docs. Any pointers? Thanks!

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Try to open a window from a test, e.g. using GLFW like in the description.

Which operating system are you running Bazel on?

Ubuntu 24.04, Debian testing

What is the output of bazel info release?

release 7.1.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

Tangentially related: https://bazel.build/docs/android-instrumentation-test

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added type: support / not a bug (process) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website and removed type: bug labels May 20, 2024
@meteorcloudy meteorcloudy added team-Local-Exec Issues and PRs for the Execution (Local) team and removed team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels May 28, 2024
@joeleba joeleba added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jun 4, 2024
@oquenchil
Copy link
Contributor

Could you please provide a small repro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: support / not a bug (process)
Projects
None yet
Development

No branches or pull requests

7 participants