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

tests: several failures when running in gnome from non gnome terminal #1278

Open
pierre-labastie opened this issue Feb 5, 2024 · 1 comment
Labels

Comments

@pierre-labastie
Copy link
Contributor

Operating System

Ubuntu 23.10, linux from scratch development

XDG Desktop Portal version

1.18

XDG Desktop Portal version (Other)

1.18.2

Desktop Environment

GNOME

Desktop Environment (Other)

No response

Expected Behavior

All tests pass

Current Behavior

Five tests fail:

test-portals-camera
test-portals-inhibit
test-portals-wallpaper
pytest test_remotedesktop
pytest test_globalshortcuts

Steps to Reproduce

  1. Open an uxterm from menu (may have to install it first)
  2. build with mkdir build && cd build && meson setup && ninja
  3. run ninja test
    ...

Anything else we should know?

Same issue also with the konsole terminal. Note that the unit associated to uxterm is of the form app-gnome-uxterm-xxxx.scope (or app-gnome-debian\x2duxterm-xxxx.scope on ubuntu), so that the app_id is non empty, and I guess all the failures come from that, because the app_id is supposed to be empty by all tests accessing the permission store.

I have a working patch for the C tests, but I don't know how to access the app_id in python. On the other hand, I am not sure what your policy is for tests: I think there is no problem when running them in the CI set up.

Note also that the scope unit for gnome-terminal starts with vte-spawn, hence it generates an empty app_id, and the tests pass in that terminal...

@whot
Copy link
Contributor

whot commented Feb 6, 2024

Confirmed, I get the same in kitty and thus run the test-suite in gnome-terminal or gnome-console. I haven't figured out yet how to guess whether appid is set from the tests yet, the easiest would be to just remove that particular set of asserts though.

pierre-labastie added a commit to pierre-labastie/xdg-desktop-portal that referenced this issue Feb 7, 2024
Because programs running in a non gnome-terminal belong to
a .scope unit starting with app, xdg-desktop-portal assings a
non empty appid to them. On the other hand, for setting permissions
into the permission store, tests assume that appid is the empty
string. To fix this, retrieve the appid during global setup
a,d store it in a global variable. It is then available to tests,
and can be passed when setting permissions.

Fix 3 test failures out of 5 reported in flatpak#1278

The other failures are in python tests.

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
pierre-labastie added a commit to pierre-labastie/xdg-desktop-portal that referenced this issue Feb 7, 2024
Python tests assume that the appid is an empty string, which
may be false when running tests on GNOME in a non gnome-terminal.
Therefore, asserting that the appid is empty leads to an error.
To fix this, just remove the asserts. They don't test anything since
there is no independant way to retrieve the appid.

Fix the remaining failures reported in flatpak#1278

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
github-merge-queue bot pushed a commit that referenced this issue Feb 28, 2024
Because programs running in a non gnome-terminal belong to
a .scope unit starting with app, xdg-desktop-portal assings a
non empty appid to them. On the other hand, for setting permissions
into the permission store, tests assume that appid is the empty
string. To fix this, retrieve the appid during global setup
a,d store it in a global variable. It is then available to tests,
and can be passed when setting permissions.

Fix 3 test failures out of 5 reported in #1278

The other failures are in python tests.

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
github-merge-queue bot pushed a commit that referenced this issue Feb 28, 2024
Python tests assume that the appid is an empty string, which
may be false when running tests on GNOME in a non gnome-terminal.
Therefore, asserting that the appid is empty leads to an error.
To fix this, just remove the asserts. They don't test anything since
there is no independant way to retrieve the appid.

Fix the remaining failures reported in #1278

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
jsparber pushed a commit to jsparber/xdg-desktop-portal that referenced this issue Apr 4, 2024
Because programs running in a non gnome-terminal belong to
a .scope unit starting with app, xdg-desktop-portal assings a
non empty appid to them. On the other hand, for setting permissions
into the permission store, tests assume that appid is the empty
string. To fix this, retrieve the appid during global setup
a,d store it in a global variable. It is then available to tests,
and can be passed when setting permissions.

Fix 3 test failures out of 5 reported in flatpak#1278

The other failures are in python tests.

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
jsparber pushed a commit to jsparber/xdg-desktop-portal that referenced this issue Apr 4, 2024
Python tests assume that the appid is an empty string, which
may be false when running tests on GNOME in a non gnome-terminal.
Therefore, asserting that the appid is empty leads to an error.
To fix this, just remove the asserts. They don't test anything since
there is no independant way to retrieve the appid.

Fix the remaining failures reported in flatpak#1278

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
jsparber pushed a commit to jsparber/xdg-desktop-portal that referenced this issue Apr 4, 2024
Because programs running in a non gnome-terminal belong to
a .scope unit starting with app, xdg-desktop-portal assings a
non empty appid to them. On the other hand, for setting permissions
into the permission store, tests assume that appid is the empty
string. To fix this, retrieve the appid during global setup
a,d store it in a global variable. It is then available to tests,
and can be passed when setting permissions.

Fix 3 test failures out of 5 reported in flatpak#1278

The other failures are in python tests.

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
jsparber pushed a commit to jsparber/xdg-desktop-portal that referenced this issue Apr 4, 2024
Python tests assume that the appid is an empty string, which
may be false when running tests on GNOME in a non gnome-terminal.
Therefore, asserting that the appid is empty leads to an error.
To fix this, just remove the asserts. They don't test anything since
there is no independant way to retrieve the appid.

Fix the remaining failures reported in flatpak#1278

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants