750 Commits

Author SHA1 Message Date
hudeng
59bf4501e8 feat: Use databaseBackend config repace databaseEtcd
databaseBackend config contains type and url sub config, It can facilitate the expansion of other types of databases in the future.
2024-07-31 22:16:00 +02:00
hudeng
f29449db14 feat: Add system test for etcd 2024-07-31 22:16:00 +02:00
hudeng
78172d11d7 feat: Add etcd database support
improve concurrent access and high availability of aptly with the help of the characteristics of etcd
2024-07-31 22:16:00 +02:00
André Roth
57e2c5c670 api tests: use check_task_fail 2024-07-24 21:19:47 +02:00
André Roth
49ff832f94 reenable lost tests 2024-07-24 21:19:47 +02:00
André Roth
4a0bdcbb64 improve system tests
- log import errors for test modules
- log output only on test failure
- improve docker system test container
- use go 1.19 in docker system tests
- download go dependencies in docker container
- system tests: color failues output
- imrpove test result output
- do not install golangci-lint in system tests
2024-07-24 21:19:47 +02:00
André Roth
fe25414b45 api: repo copy handle package not found
and add tests for error proper handling.
2024-07-24 21:19:47 +02:00
André Roth
440c3debdc improve api tests and error output
show only relevant aptly logs if a test fails.
for async tasks, show task output, as it contains the error message.
2024-07-24 21:19:47 +02:00
André Roth
8029305d32 dependencies: remove duplicates / missing deps from test 2024-07-11 18:25:49 +02:00
Sylvain Nieuwlandt
11401ca472 [api/copy] create system tests for new copy api endpoint 2024-07-10 16:43:03 +02:00
André Roth
d8c1e432c6 add test 2024-07-03 18:08:58 +02:00
André Roth
4661913265 add system test for maximumVersion filter 2024-06-24 17:44:40 +02:00
Ryan Gonzalez
b5bf2cbcda Fix functional tests' '--capture' on Python 3
None of the commands' output is ever treated as binary, so we can just
always decode it as text.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez
f9325fbc91 Add support for Azure package pools
This adds support for storing packages directly on Azure, with no truly
"local" (on-disk) repo used. The existing Azure PublishedStorage
implementation was refactored to move the shared code to a separate
context struct, which can then be re-used by the new PackagePool. In
addition, the files package's mockChecksumStorage was made public so
that it could be used in the Azure PackagePool tests as well.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez
8e37813129 Add support for custom package pool locations
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez
91574b53d9 Add functional tests for Azure publishing
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez
859edb10cd Fix S3 tests on Python 3
read_path() can read in binary, which the S3 tests don't support (simply
because they don't need it)...but it needs to be able to take the `mode`
argument anyway.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
André Roth
f0bf519d36 cleanup 2024-06-15 19:18:14 +02:00
André Roth
d8cfafccc9 system tests: improve log output 2024-06-15 19:18:14 +02:00
André Roth
34c1c1f83a system-tests: make docker abortable and use colors 2024-06-15 19:18:14 +02:00
André Roth
45035802be implement task queue waiting for resources 2024-06-15 19:18:14 +02:00
André Roth
2d97ba2bbd fix flake8 error 2024-06-15 19:18:14 +02:00
Ramón N.Rodriguez
47696a3303 api:publish: test concurrency
This commit introduces a test which runs concurrent publishes (which
could be parallell with multiproccessing, python is fun).
The test purposly fails (at the point in history that this patch is
written) in order to make it as easy as possible to verify later patches,
which hopefully addresses concurrency problems.

The same behaviour can easily be tested outside of the system tests with
the following (or similar) shell

$ aptly serve -listen=:8080 -no-lock
$ aptly repo create create -distributions=testing local-repo
$ atply publish repo -architectures=amd64 local-repo
$ apt download aptly
$ aptly repo add local-repo ./aptly*.deb
$ for _ in $(seq 10); do curl -X PUT 127.0.0.1:8080/api/publish//testing

In the local testing perfomed (on a dual core vm) the first 1-4 jobs
would typically succeed and the rest would error out.
2024-06-15 19:18:14 +02:00
André Roth
57ff7c69cd mirror api: add test for SkipArchitectureCheck and SkipComponentCheck 2024-06-14 14:30:29 +02:00
André Roth
06be6f23a6 Revert "Bump requests from 2.28.2 to 2.31.0 in /system"
This reverts commit 24e62b58bc.
2024-04-17 22:08:27 +02:00
dependabot[bot]
24e62b58bc Bump requests from 2.28.2 to 2.31.0 in /system
Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.2...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-17 21:35:16 +02:00
André Roth
2a2e35c096 add test for publishing distribution with slash (/) 2024-04-11 19:37:51 +02:00
André Roth
32595e7cb7 openpgp: export full key for internal gpg 2024-04-11 10:15:02 +02:00
André Roth
9deb031c44 fix system tests
- use s3 mirror instead of internet download
- reduce download verbosity
- do not use venv in docker-system-tests
- be more verbose on test output
- do not run golangci-lint in system-tests
2024-04-11 10:15:02 +02:00
André Roth
50eaf6c0bb update docker / makefile 2024-03-06 12:46:44 +01:00
André Roth
72a7780054 fix golint complaints 2024-03-06 06:21:36 +01:00
André Roth
d7cc9b89d1 system tests: use repository mirrors on S3 for reproducibility
no direct internet download from apt repositories,
which over time will change or cease to exist.

also migrate to gpg2 on newer ubuntu.
2024-02-05 13:04:45 +01:00
André Roth
a69aa7c533 system-tests: add Dockerfile 2024-02-05 13:04:45 +01:00
Paul Cacheux
99dbe31d20 fix t09_repo/IncludeRepo21Test_gold gold error 2023-11-23 11:40:58 +01:00
Ryan Gonzalez
ed45c44931 Fix the test output regex on Go 1.20
1.20 changes the output format of coverage checks slightly to include
a package name on each line, followed by `coverage:`, but the current
regex assumes that the line *starts* with `coverage:`.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2023-10-03 08:31:39 +02:00
Ryan Gonzalez
889fcc2158 Improve test output regex for better perf
The current regex runs in exponential time, which massively impacts the
runtime of the test suite, taking several seconds (~4s on my system)
just to perform a single match. By replacing the mix of re.findall + the
initial capture group with re.search + some string slicing, the time
spent matching the regex becomes nearly instant, e.g.:

    $ make system-test TESTS='Config*'

goes from taking ~10s to ~1.5s.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2023-10-03 08:31:39 +02:00
Mauro Regli
0d20c59a98 Fix: Change expected output for malformed input that changed in Go 2023-09-21 11:25:18 +02:00
Mauro Regli
18203c614d Fix: Pipeline failing because of outdated Repo
Updated the repo key, repo links in tests (jessie-cran35 -> bullseye-cran40) and the expected test output.

Fixes: #1218
2023-09-14 10:35:00 +02:00
Mauro Regli
ee4c83e323 Fix: Pipeline failing because of nvidia repo change 2023-09-13 09:04:51 +02:00
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