1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 14:30:11 +01:00
Commit Graph

856 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
6eee83db47 run black on new .ipa test cases 2024-01-11 16:02:06 +01:00
Michael Pöhn
8b5a61bb25 ⛰️ make ipa related test cases more robust 2024-01-11 12:02:53 +01:00
Michael Pöhn
7211e9f9b4 🍲 add unit test for update.scan_repo_for_ipas 2024-01-11 11:34:21 +01:00
Michael Pöhn
995118bcd2 🥔 add strapped IPA file and test for parse_ipa 2024-01-11 11:34:21 +01:00
Michael Pöhn
c288317530 🪨 version string conversion: error handling+tests 2024-01-11 11:34:21 +01:00
Hans-Christoph Steiner
0849e664e7 metadata_v0: use git rev-parse instead of git describe 2024-01-09 14:54:38 +01:00
Hans-Christoph Steiner
96fc49d7fc lint: check syntax of countryCode: fields for mirrors 2024-01-09 09:32:37 +00:00
Hans-Christoph Steiner
4511da68b9 lint: support linting config files 2024-01-09 09:32:37 +00:00
Hans-Christoph Steiner
15b983f48d handle all cases of @ in srclibs
expands on fdroidserver!1422
2024-01-07 10:50:29 +01:00
Hans-Christoph Steiner
8c8b9021f5 tests/run-tests: disable nightly.TestCase on non-Linux until its ported 2023-12-15 09:15:19 +01:00
Hans-Christoph Steiner
52f27aea75 tests/run-tests: temp disable git mirror test on non-Linux
I looked into this but couldn't figure it out.  It is the only failing
test on macOS, so it seemed worth just adding this single quirk for now.
2023-12-15 09:15:19 +01:00
Hans-Christoph Steiner
865673964e gitlab-ci: enable shellcheck on tests/run-tests 2023-12-15 08:40:01 +01:00
Hans-Christoph Steiner
45d1363a0e tests/run-tests: use $sed var for all calls that need GNU sed
FreeBSD, macOS, and others come with BSD sed, which does not support all
the things that GNU sed does.  Also, BSD rmdir does not have any extended
options like --ignore-fail-on-non-empty.
2023-12-13 22:30:19 +01:00
Hans-Christoph Steiner
e2949cbd61 port to looseversion 2023-12-08 10:48:01 +01:00
Andrew Gunnerson
679ba6f552
Add support for Python 3.12
Python 3.12 completely removed the builtin `distutils` module. This
commit replaces its use with the `packaging` package, which is an
external dependency, but maintained by the Python developers.

Signed-off-by: Andrew Gunnerson <accounts+gitlab@chiller3.com>
2023-12-07 18:15:05 -05:00
Hans-Christoph Steiner
6d541e3ef6
establish config/mirrors.yml as a way to set up mirrors
The mirrors: entry in config.yml is great for quick access and shorter
mirror lists.  Now that we are adding a lot more metadata to the mirrors,
including potentially the full text of the privacy policy, having this
in its own file should make these cases easier to manage.
2023-12-07 14:38:26 +01:00
Hans-Christoph Steiner
f13d9235ce remove jq dependency in the tests, port to GNU sed
This avoids spreading the jq dependency to more places, like:

https://gitlab.com/eighthave/ansible-role-install-fdroidserver-dependencies/-/jobs/5559798360

And is helpful when porting to non-Debian platforms.
2023-11-23 12:24:49 +00:00
linsui
f99f430e9e deinit git submodule 2023-11-14 01:06:49 +08:00
Jochen Sprickerhof
521ff4fe17 Add default locale for generated categories
The client expects at least a name to be set.

Regression of 2c566cf6.
2023-09-21 14:14:06 +00:00
Hans-Christoph Steiner
3757add164 test_sdk_exists to be based on apksigner, that's the requirement
Before, lots of pieces of the Android SDK were required for fdroidserver to
operate, like aapt, zipalign, etc.  Now, apksigner is the only requirement.

%"support APK Signature v2+"
!889
2023-09-17 23:31:07 +02:00
Hans-Christoph Steiner
48559ecec5 category with no apps should be ignored, even if defined in config
https://gitlab.com/fdroid/fdroidclient/-/issues/2619#note_1421280589

The test needed to change because the test index files contained category
definitions that were not ever used in the "copy tests/repo, generate java/gpg
keys, update, and gpgsign" test in tests/run-tests.
2023-09-08 10:45:53 +02:00
Hans-Christoph Steiner
2c566cf68f update: add all categories in metadata files to repo definitions
!1366 makes it so categories are now defined by the repo. Categories can be
defined in the config so that lint has a list of categories to enforce. This
also provides a place for localization and icons for the categories. The old
way of defining categories was just listing them in app metadata files. This
restores that way of functioning when using index-v2.

closes #1137
2023-09-08 10:45:51 +02:00
Hans-Christoph Steiner
64b8ee772c throw useful error if a config YAML file is not a dict 2023-09-08 10:42:27 +02:00
Hans-Christoph Steiner
00aa595f37 deploy: give useful error if rsync is not installed 2023-09-08 10:42:27 +02:00
linsui
8188bb6bfa metadata: set mapping indentation to 2 2023-09-08 08:18:27 +00:00
Hans-Christoph Steiner
4e28fad55a use constants for names used in the config dict
Hopefully this helps with the Anti-Features case confusion:
* antifeatures
* antiFeatures
* AntiFeatures
2023-07-25 14:31:09 +00:00
Hans-Christoph Steiner
6b82710039 test load_localized_config() with categories 2023-06-02 13:28:53 +02:00
Hans-Christoph Steiner
bc58959315 purge remnants of repo/categories.txt, which is long unused 2023-06-02 13:26:03 +02:00
Hans-Christoph Steiner
1c3a87e002 lint: get Categories from config 2023-06-02 13:26:03 +02:00
Jochen Sprickerhof
27ea667438
Add test for !1370
The bug fixed in !1370 was due to a reuse of the per app anti features
dictionary in the per version one and adding the per version anti
features into it. This was not caught by the test suite as the app
versions are processed from newest to oldest and the test data had only
anti features in the oldest version. This patch adds an anti feature to
a newest version so only those in between should not have it.
2023-06-02 10:26:27 +02:00
Hans-Christoph Steiner
d96de4d8c2 update: test archive_old_apks() with ArchivePolicy: 0 2023-06-01 20:31:26 +02:00
Hans-Christoph Steiner
9ef2088ace
add unit tests 2023-05-30 23:02:36 +02:00
Gregor Düster
337974cbed
metadata: Make ArchivePolicy an interger internally 2023-05-30 23:02:34 +02:00
Hans-Christoph Steiner
fac7ceffe3 metadata: remove non-values from Builds: entries 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
b055559df7 metadata: remove STRING/INT conversion on output
The type conversion should all happen in post_parse_yaml_metadata whenever
possible.  Also, when `if` blocks end in `return`, it is clearer if no
`elif` or `else` is used.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
070dae1431 versionCode is an int everywhere since !1176 fixed #332 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
e64f121c0c metadata: type conversion happens at parsing, not at writing
These test cases were writing assuming they had to transform the data
format.  That is no longer the case.  Going forward, the parsing process
converts everything to a standardized format.  That will hopefully be
enforceable by the JSON Schema in the future.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
26b2cffdcc metadata: tests for converting Builds: entries for writing out
* The metadata.Builds() class initializes all possible flags, then the
  flags with init values are filtered out when writing out YAML.
* TYPE_SCRIPT flags with one entry will be converted to a string.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
d3521d7374 metadata: case-insensitive sort for AntiFeatures Categories 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
2aa0403208 metadata: handle SHA-256 values that parse as decimal ints
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/1350#note_1370665635
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
642e444cfa metadata: _normalize_type_list for TYPE_LIST quirks and errors
This should reduce surprises when dealing with filenames in things like
`rm:`.  So any float/int/bool value can be used directly, without quoting.

* A plain str/int/float value is interpreted as a list of one string.
* Dictionaries as values throws error.
* A set is treated like a list.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
4711b632b8 metadata: _normalize_type_int to handle exceptions 2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
9f606d0fbb metadata: auto-convert YAML special float values: .nan .inf -.inf
Even for people who know what the special floats not-a-number, infinity,
and negative infinity, they don't necessarily know the YAML 1.2 syntax for
these.  I didn't.  And I've spent some quality time fighting things with
those values.  They are also easy to reliably convert to string values.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
8374842faa metadata: normalize TYPE_BOOL to YAML 1.2 booleans
This makes the internal representation always be a boolean, and that also
means that YAML 1.2 booleans will be written out, e.g. rewritemeta.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
aa98d67c86 metadata: test None in post_metadata_parse 2023-05-25 15:10:05 +02:00
Hans-Christoph Steiner
df7c909884 build: add test to ensure Prepare: is only run in VM 2023-05-25 13:03:25 +00:00
Hans-Christoph Steiner
dbf163e03f test to check that the right Builds flag values get removed 2023-05-23 12:11:09 +02:00
Hans-Christoph Steiner
895e0553a0 error if a YAML Anti-Feature conflicts with a localized file
https://gitlab.com/fdroid/fdroidserver/-/issues/683#note_1383597734
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
b0c05842d8 metadata: RequiresRoot is boolean, according to docs
"Set this optional field to ‘True’ if the application requires root
privileges to be usable."
https://f-droid.org/docs/Build_Metadata_Reference/#RequiresRoot
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
0393e46af9 metadata: handle TYPE_STRINGMAP when writing out YAML 2023-05-23 10:47:03 +02:00