Skip to content

CI: run the S3 tests against moto instead of MinIO - #224

Merged
ThomasWaldmann merged 1 commit into
borgbackup:mainfrom
ThomasWaldmann:ci-moto-s3
Sep 19, 2026
Merged

ThomasWaldmann merged 1 commit into
borgbackup:mainfrom
ThomasWaldmann:ci-moto-s3

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Problem

dl.min.io answers HTTP 410 Gone for the minio and mc release binaries now (checked with curl -sI on 2026-09-19), so the step "Install and configure MinIO S3 server (test only)" fails in every Linux test job (curl: (22) The requested URL returned error: 410, first seen in the py314 job of #223), and fail-fast cancels the rest of the matrix. CI is broken for every PR.

Change

Run the S3 tests against moto in server mode (moto_server), the same way borg does since borgbackup/borg#10386 (borgbackup/borg#10361):

  • new requirements.d/s3-test-server.txt: moto[s3], flask, flask-cors, pinned - dependabot already watches /requirements.d. moto's own server extra pulls in the dependencies of all the AWS services it can mock (47 packages, some of them compiled); for S3 the server only needs flask and flask-cors on top of the s3 extra.
  • the MinIO step is replaced by "Install and start moto S3 server (test only)": pip install, start moto_server -H 127.0.0.1 -p 9000, wait for the port, create the bucket test with boto3 (a moto dependency), export BORGSTORE_TEST_S3_URL=s3:test:test@http://127.0.0.1:9000/test/path (same format as before; moto accepts any credentials and keeps the objects in memory).
  • the step moved behind "Set up Python" / "Install Python requirements", because it needs pip. tox runs the tests in its own venv, so moto's pins do not influence the test environment.
  • curl is not installed anymore (it was only added for the MinIO download), and the moto log is shown by the "Display diagnostics on failure" step.

Testing

Locally (macOS, Python 3.11, moto 5.2.3): full test suite with BORGSTORE_TEST_S3_URL pointing at moto_server: 290 passed, 19 skipped - none of the skips is an S3 one (SFTP / REST / blake3 are not set up on that machine). The S3 tests alone: 26 passed; moto's access log shows 18 206 Partial Content responses for them, so the ranged GETs of S3.load(name, size=..., offset=...) are really served as ranges.

🤖 Generated with Claude Code

dl.min.io answers "410 Gone" for the minio and mc release binaries now, so
the "Install and configure MinIO S3 server" step failed in every test job
(and fail-fast cancelled the rest of the matrix).

Use moto in server mode (moto_server) instead, like borg does since
borgbackup/borg#10386: it comes from PyPI, so there is no server binary to
download. The versions are pinned in requirements.d/s3-test-server.txt,
which dependabot watches. moto's "server" extra pulls in the dependencies
of all the AWS services it can mock; for S3, flask and flask-cors on top of
the "s3" extra are enough.

The step moved behind the Python setup, because it needs pip. moto keeps
the objects in memory and accepts any credentials; the bucket is created
with boto3. curl is not needed anymore.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann merged commit 1f8bc8f into borgbackup:main Sep 19, 2026
9 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the ci-moto-s3 branch September 19, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant