Commit Graph

761 Commits

Author SHA1 Message Date
Mauro Regli f6a7030654 Try to fix UnixSocketAPITest by upgrading dependencies
Updated urllib, requests and requests_unixsocket
2023-05-15 11:15:48 +02:00
Mauro Regli 7c8dd7362d Fix: Missing newline makes tests fail 2023-05-15 11:15:48 +02:00
Mauro Regli 0ae9884836 Fix: Tests with jenkins repo not finding public key. 2023-05-15 11:15:48 +02:00
Mauro Regli 95ca6fb376 Fix: Replace security.debian.org with archive 2023-05-15 11:15:48 +02:00
Mauro Regli c9b1782d62 Fix CreateMirror9Test by removing Acquire-By-Hash 2023-05-15 11:15:48 +02:00
Mauro Regli d1102e2e9c Fix: Pipeline dependency on deb.debian.org, replace with archive
This should fix some tests, as a lot of them are dependent on
deb.debian.org which no longer supports Debian 9 "Stretch".
Instead we use archive.debian.org which will continue to contain
"Stretch" packages for a long time.
2023-05-15 11:15:48 +02:00
Markus Muellner 9c6f896666 add endpoint for listing repos while serving in api mode and add more metrics 2023-03-22 17:22:54 +01:00
Markus Muellner 0fdba29d51 make serving published repos in api mode configurable 2023-03-22 17:22:54 +01:00
Markus Muellner f74217ed9c implement system tests for serving api and published repos simultaneously 2023-03-22 17:22:54 +01:00
Mauro Regli 77e02bf7a3 Feature: Add Merge Snapshot API
Is part of Issue #176
2023-03-14 08:38:55 +01:00
Mauro Regli 90932cdac5 Improvement: Remove Magic Numbers in Tests with Tasks
Replaced 2 with TASK_SUCCEEDED, 3 with TASK_FAILED.

fixes: #1158
2023-03-13 13:17:17 +01:00
Markus Muellner 8e62195eb5 implement structured logging 2023-02-20 13:42:50 +01:00
Markus Muellner 2020ca9971 add ready and healthy probe endpoints 2022-12-12 13:39:07 +01:00
Josh Bayfield b3d9055059 Fix system tests for custom codenames 2022-08-29 15:54:29 +02:00
Steven Stone 904265120b Fix PublishSnapshot39Test_release_i386 system test 2022-08-29 15:54:29 +02:00
Steven Stone 47930a4214 Fix system test 2022-08-29 15:54:29 +02:00
Steven Stone a59cad6f20 Enable the ability to pass in a custom codename
While testing out Aptly, the `apt-get` client complains with the following error, since the `codename` was switched from the InRelease files that are baked out by Aptly:

```
E: Repository 'http://debianrepo.example.com/bionic testing InRelease' changed its 'Codename' value from '' to 'testing'
```
2022-08-29 15:54:29 +02:00
Sjoerd Simons 393d1a6888 api: Allow querying the packages endpoint
The ".../packages" endpoints for mirror, local repos and snapshots all
share the same syntax for querying. However the "/api/packages" endpoint
doesn't match this. Adjust that to allow for a bit more consistency and
allow querying the full package database.

The current endpoint functionality "/packages/:name" is kept intact and
can be used the same as now

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-08-29 10:28:44 +02:00
Benj Fassbind 42cfee2c09 Fix mirror test 2022-08-16 09:04:16 +02:00
Benj Fassbind ff3bf4b180 Improve error messages 2022-07-13 08:33:48 +02:00
Benj Fassbind 1d4e6183be Capture coverage of integration tests
To capture the coverage also for the integration tests,
a test only executing the cmd.Run function is used.

The test always exits with code 0 and prints the
real exit code to stdout. Otherwise no coverage
report is generated.

Those changes enable a more accurate coverage report
for future contributions.
2022-07-13 08:33:48 +02:00
Benj Fassbind 69d473ea6f Fix failing mirror test
Add the https redirect to the gold ouptut of the test
as this was changed for the jenkins debian repos
and the tests were failing after this change.
2022-07-13 08:33:48 +02:00
Sjoerd Simons f61514edaf Allow disabling bzip2 compression for index files
Using bzip2 generates smaller index files (roughly 20% smaller Packages
files) but it comes with a big performance penalty.  When publishing a
debian mirror snapshot (amd64, arm64, armhf, source) without contents
skipping bzip speeds things up around 1.8 times.

```
$ hyperfine -w 1 -L skip-bz2 true,false  -m 3 -p "aptly -config aptly.conf publish drop bullseye || true" "aptly -config aptly.conf  publish snapshot  --skip-bz2={skip-bz2} --skip-contents --skip-signing bullseye"
Benchmark 1: aptly -config aptly.conf  publish snapshot  --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     35.567 s ±  0.307 s    [User: 39.366 s, System: 10.075 s]
  Range (min … max):   35.311 s … 35.907 s    3 runs

Benchmark 2: aptly -config aptly.conf  publish snapshot  --skip-bz2=false --skip-contents --skip-signing bullseye
  Time (mean ± σ):     64.740 s ±  0.135 s    [User: 68.565 s, System: 10.129 s]
  Range (min … max):   64.596 s … 64.862 s    3 runs

Summary
  'aptly -config aptly.conf  publish snapshot  --skip-bz2=true --skip-contents --skip-signing bullseye' ran
    1.82 ± 0.02 times faster than 'aptly -config aptly.conf  publish snapshot  --skip-bz2=false --skip-contents --skip-signing bullseye'
```

Allow skipping bz2 creation for setups where faster publishing is more
important then Package file size.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-06-22 11:25:45 +02:00
Markus Muellner db19a56458 Add functional test for metrics endpoint 2022-04-12 14:39:16 +02:00
Markus Muellner 6539e1b856 Add metrics endpoint with http metrics using Prometheus client lib 2022-04-12 14:39:16 +02:00
Reinhold Gschweicher c1e577c1ac Add unittest for zstd compression support 2022-04-04 17:51:21 +02:00
Lorenzo Bolla fd404064c9 Use University of Utah mirror in tests
Fix #1034
2022-02-13 20:44:28 +01:00
Lorenzo Bolla e8ec6385f3 Fix linting errors 2022-02-08 11:18:50 +01:00
Lorenzo Bolla 1361bf20dd Revive skipped tests 2022-02-08 11:18:50 +01:00
Lorenzo Bolla 5d98546e1d Use a more recent GPG key server 2022-02-08 11:18:50 +01:00
Lorenzo Bolla 1afcd68e01 Make downloader type configurable 2022-01-31 10:32:54 +01:00
Lorenzo Bolla 035d5314b0 Convert tests to Python 3
Fix #938
2022-01-27 15:06:33 +01:00
Lorenzo Bolla 70f7d7409a Allow to check for empty output in tests 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 48635c8057 Strip irrelevant lines from test output
It may happen that aptly retries to download data during tests (maybe because
of a network issue), but our fixtures doesn't account for it. So, we strip
those irrelevant lines before comparison.
2022-01-27 09:30:14 +01:00
Lorenzo Bolla 30e94064e5 Ignore dates in test 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 91c3ed8ec4 Fix failing tests 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 8ecd01be1f Temporarily skip test failing on CI 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 4933e3caf4 Try to fix test failing on CI
PublishRepo26Test fails to run because something in the CI environment forces
gpg to ask for the user's password. Try to require gpg1 for the test, which
seems to run fine in other environments.
2022-01-27 09:30:14 +01:00
Lorenzo Bolla 4a9a5bc713 Fix some failing system tests 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 7412b84e04 Fix flake8 lint errors 2022-01-27 09:30:14 +01:00
Ximon Eighteen 8e309b57b3 Workaround differences in the GHA Ubuntu 18.04 environment compared to the Travis CI Ubuntu 16.04 environment. 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 370e3cdfea Fix unittests 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 787cc8e3ee Fix system tests 2022-01-27 09:30:14 +01:00
Lorenzo Bolla 914ddf4859 Fix syntax error 2022-01-27 09:30:14 +01:00
Oliver Sauder b4efe6a810 Add db cleanup api 2022-01-27 09:30:14 +01:00
Oliver Sauder f09a273ad7 Add publish output progress counting remaining number of packages 2022-01-27 09:30:14 +01:00
Oliver Sauder b0ab8f417d Added gpg api so mirror updates are fully functional from api 2022-01-27 09:30:14 +01:00
Oliver Sauder d7ccf95499 Added mirror api based on task list 2022-01-27 09:30:14 +01:00
Oliver Sauder 6ab5e60833 Add task api and resource locking ability 2022-01-27 09:30:14 +01:00
chuan bb42a2158d Add support for Azure storage as a publishing backend
This adds a new configuration setting: AzurePublishEndpoints, similar
to the existing S3PublishEndpoints and SwiftPublishEndpoints.

For each endpoint, the following has to be defined:
 - accountName
 - accountKey
 - container
 - prefix

Azure tests require the following environment variables to be set:
 - AZURE_STORAGE_ACCOUNT
 - AZURE_STORAGE_ACCESS_KEY

With either of these not set, Azure-specific tests are skipped.
2022-01-21 11:46:36 +01:00