Commit Graph

35 Commits

Author SHA1 Message Date
Phaedrus Leeds
2a111e5042 common: Add API for listing related refs of installed ref
Currently if a user of libflatpak wants to list the related refs (such
as extensions and plugins) of something, they have three options:
1. They can parse the metadata manually with e.g.
   flatpak_remote_ref_get_metadata() and then key-file operations, but
   this means re-implementing parts of libflatpak and using key file
   strings that are not actually public (FLATPAK_METADATA_KEY_...).
2. They can use flatpak_installation_list_installed_related_refs_sync()
   but this only works for installed related refs not remote ones.
3. They can use flatpak_installation_list_remote_related_refs_sync() but
   this lists all remotely available related refs, including ones that
   may not be compatible with the installed version of the main ref
   (because they don't match any of the values in the "versions"
   metadata key).

So since none of these provide a way to get the remote related refs
corresponding to an installed application, add new API for that. For the
motivation of this see
https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1132
2021-02-10 09:17:53 +01:00
Alexander Larsson
7043093a5f tests: Avoid unnecessarily recreating the summary file
We enforce --no-update-summary when we create test apps and
runtimes, and then we ensure we always manually call update_repo
after all modifications are done.

This means we save work avoiding summary updates, but it also means we
can do special handling in update_summary and guarantee that this is
the only place this happens. For example, we want this to work around
the mtime handling of summary updates.
2020-11-17 15:20:43 +01:00
Alexander Larsson
620157ba12 tests: Allow specifying app id and app branch for updated apps 2020-06-22 10:51:36 +02:00
Will Thompson
babb2da71a tests: test search-provider DefaultDisabled logic
2ebf672866 introduced special handling to
mark exported GNOME Shell search provider .ini files as disabled by
default. This functionality was not previously tested.
2019-11-29 20:15:08 +00:00
Alexander Larsson
4eb213a39a update-portal: Add tests with changed permission errors 2019-10-02 14:57:11 +02:00
Alexander Larsson
8832e7c7d1 Make test output a bit less noicy
This gets rid of some unnecessary spew that happens in every
test run and just makes the logs harder to read.
2019-10-02 14:57:11 +02:00
Alexander Larsson
62117308c1 tests: Add test for required-flatpak versioning
This sets required-flatpak in the metadata to some different versions
and ensure we're properly able or not able to install it.

Additionally it uses some options with multiple versions. This is not
yet supported but I want to test the existing code and make sure it
properly falls back to just using the first element of the list.

Closes: #3112
Approved by: alexlarsson
2019-09-18 14:55:38 +00:00
Matthew Leeds
803fa15b06 tests: Consistently use a bash shebang
There's not much point in using /bin/bash for all but three scripts and
using /bin/sh for those, so use bash for everything.

Closes: #2705
Approved by: alexlarsson
2019-05-09 09:12:26 +00:00
Will Thompson
113ee117c0 tests: Test preserving previous-ids and X-Flatpak-RenamedFrom
This copy-pastes a lot of internal code from flatpak-dir.c to mess with
the deploy file. It could be made a lot shorter...

https://phabricator.endlessm.com/T23845

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
f85416ce55 tests: Fix test-app Locale dependency
We were always looking for org.test.Hello.Locale even when the
app id was something else

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Matthew Leeds
3d74d4b37f tests: Add ability to test a branch other than master
This commit makes it so that a unit test can create the test app and
runtime using a branch other than master, and changes test-run.sh to use
the branch "stable". This will allow the run command to be tested better
in the following commit.

Closes: #2788
Approved by: matthiasclasen
2019-03-30 13:02:10 +00:00
Simon McVittie
2184205801 make-test-*: Don't sandbox the icon validator
During build-time tests, bwrap doesn't necessarily work. In particular,
official Debian autobuilders can't enter namespaces.

We continue to leave the sandbox enabled in the build-export calls in
tests/test-extensions.sh, tests/test-unsigned-summaries.sh
and tests/test-update-remote-configuration.sh, which are already
skipped if bwrap isn't available. This means we exercise both the
normal and --disable-sandbox code paths.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2661
Approved by: alexlarsson
2019-01-31 14:02:24 +00:00
Matthias Clasen
490924c5f0 tests: Add appstream version to test app
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
ca4d4a9c3b Add a second language to the test app
This will let us test subpaths better.
2018-10-10 12:21:15 +02:00
Matthias Clasen
c8db26cc35 Make the test app not hang
We want an app that keeps running for some of the
library tests, but other tests expect it to return
right away. Make this opt-in.
2018-10-10 12:21:15 +02:00
Matthias Clasen
d4df921940 Modify the instance test
Avoid the initial sleep statement, and instead poll
for the child pid.

We also need the test app to stick around and not
exit right away, so change it to exec a shell.
2018-10-10 12:21:15 +02:00
Matthias Clasen
ccbd5b52e9 fixup! tests: Generate a .Locale extension 2018-10-10 12:21:15 +02:00
Matthias Clasen
c7090c5c0b tests: Generate a .Locale extension
Give the test app a Locale extension, so we can test
things around related refs and subpaths. Fix up the
library tests to work with a related ref in the repo.
2018-10-10 12:21:15 +02:00
Alexander Larsson
df93c9b563 tests: Make make-test-{app,runtime}.sh take repo, not repo name
Later we want to use these outside the test suite, and then we
might not use the same repo naming.

Closes: #2188
Approved by: alexlarsson
2018-10-05 11:43:12 +00:00
Joaquim Rocha
1c8dd13f55 tests: Make the app ID in make-test-app.sh a parameter
This is in order to allow tests to make several apps if needed, and will
be useful when e.g. testing repos that have multiple apps with different
collection IDs.

This patch modifies the mentioned script as mentioned and updates the
places that call it.

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Alexander Larsson
fabe1e5ff4 Add tests for end-of-line
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Philip Withnall
9989188a1e tests: Add support for collection IDs to test-repo.sh
This adds variable support for collection IDs: they can either be
enabled on the server, on the server and client, or not at all. If
enabled on the server, apps and runtimes are built with collection IDs
and the repository has one set. If enabled on the client, the remote
config is added to the local repository with a collection ID and GPG
verification enabled. They are controlled with
USE_COLLECTIONS_IN_{SERVER,CLIENT}={yes,no}.

These variables are used in the new wrapper tests,
test-repo-collections.sh and test-repo-collections-server-only.sh.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-18 14:23:03 +02:00
Alexander Larsson
99a6200cab tests: Make it possible to create multiple test repos 2017-05-10 11:54:27 +02:00
Alexander Larsson
7975dc489e tests: Remove some leftover debug spew 2017-01-30 14:33:43 +01:00
Alexander Larsson
b8c3b5aa44 Fix tests now that build-init requires the runtime to be installed 2017-01-27 13:56:04 +01:00
Alexander Larsson
0fb2f362a8 tests: Move the test repo to a subdirectory (repos/test)
This makes the ostree trivial-httpd --autoexit feature work better,
because it seems to exit whenever the root directory changes (i.e. not
only when its deleted).

This means the root dir can't be the repo (because then we can't
update the repo), or the base testdir (because we create files there
too), so instead we make the repo $testdir/repos/test and
$testdir/repos as the httpd root.
2017-01-12 00:04:36 +01:00
Alexander Larsson
6345f0bae7 build-finish: Support exporting more than hicolor icons
We really want apps to be able to export e.g. HighContrast icons too.
2016-10-18 10:14:10 +02:00
Alexander Larsson
c809ee4fa0 Fix test failures due to desktop validation 2016-07-30 23:52:56 +02:00
Alexander Larsson
f36a57b3b1 tests: Use gpg signatures during test 2016-05-17 13:04:44 +02:00
Alexander Larsson
c432c417c2 tests: Add test for update 2016-05-17 10:32:29 +02:00
Alexander Larsson
8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson
123f32015d tests/test-run.sh: Add tests for proper installation 2016-05-02 10:47:59 +02:00
Alexander Larsson
327f432219 tests: Add a basic test that just runs an app 2016-04-27 21:23:42 +02:00
Alexander Larsson
eba6a1e552 Add appdata to test apps 2016-02-25 19:03:09 +01:00
Alexander Larsson
0e595519c1 Add test scripts that create trivial a runtime and app 2016-02-25 15:14:57 +01:00