Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .circleci/config.yml

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Start MinIO
- name: Start SeaweedFS
run: |
docker run -d --name minio \
docker run -d --name seaweedfs \
-p 9000:9000 \
--entrypoint sh \
minio/minio:RELEASE.2025-04-22T22-12-26Z \
-c 'mkdir -p /data/test && minio server /data --json'
-e AWS_ACCESS_KEY_ID=minioadmin \
-e AWS_SECRET_ACCESS_KEY=minioadmin \
docker.io/chrislusf/seaweedfs:4.48 \
mini -dir=/data -webdav=false -admin.ui=false \
-s3.port=9000 -s3.port.iceberg=0 -s3.port.lance=0 -s3.autoCreateBucket=false \
-bucket=test

- name: Start fake-gcs-server
run: |
Expand All @@ -41,9 +44,12 @@ jobs:
- name: Wait for services
run: |
for i in $(seq 1 30); do
curl -sf http://localhost:9000/minio/health/live && curl -sf http://localhost:8080/ && break
curl -sfI --aws-sigv4 aws:amz:us-east-1:s3 --user minioadmin:minioadmin http://localhost:9000/test \
&& curl -sf "http://localhost:8080/storage/v1/b/$GCS_BUCKET" >/dev/null && exit 0
sleep 1
done
echo "SeaweedFS or fake-gcs-server did not become ready" >&2
exit 1

- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
Expand Down
1 change: 0 additions & 1 deletion dip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ interaction:

provision:
- ./docker/prepare_env.sh
- mkdir -p uploads/s3/$S3_BUCKET
- rm -rf uploads/gcs/$GCS_BUCKET
- rm -rf Gemfile.lock
- mkdir -p uploads/gcs/$GCS_BUCKET
Expand Down
21 changes: 15 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ services:
- bundler-data:/bundle
command: sh
depends_on:
- s3
- gcs
s3:
condition: service_healthy
gcs:
condition: service_started

s3:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
volumes:
- ../uploads/s3:/data
command: server /data --json
image: docker.io/chrislusf/seaweedfs:4.48
command: ["mini", "-dir=/data", "-webdav=false", "-admin.ui=false",
"-s3.port=9000", "-s3.port.iceberg=0", "-s3.port.lance=0", "-s3.autoCreateBucket=false",
"-bucket=${S3_BUCKET}"]
environment:
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
healthcheck:
test: ["CMD-SHELL", "for b in ${S3_BUCKET}; do curl -sfI --aws-sigv4 aws:amz:us-east-1:s3 --user \"$$AWS_ACCESS_KEY_ID:$$AWS_SECRET_ACCESS_KEY\" http://localhost:9000/$$b || exit 1; done"]
interval: 1s
retries: 30

gcs:
image: fsouza/fake-gcs-server
Expand Down
2 changes: 1 addition & 1 deletion spec/cloud_storage/objects/gcs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
subject(:url) { obj.signed_url(expires_in: 30, issuer: 'max@tretyakov-ma.ru', signing_key: key, version: :v2) }

it { is_expected.to match(%r{\A#{ENV.fetch('GCS_ENDPOINT')}#{ENV.fetch('GCS_BUCKET')}/test_1.txt}) }
it { is_expected.to match(/GoogleAccessId=/) }
it { is_expected.to include('GoogleAccessId=') }
end
end

Expand Down
18 changes: 18 additions & 0 deletions spec/cloud_storage/wrappers/s3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@

it { expect(cli.exist?('file.txt')).to be(false) }
end

# Servers differ on an invalid bucket name (400 on AWS and MinIO, 404 on
# SeaweedFS), so the error branch is driven by a stubbed client.
context 'when S3 rejects the request' do
let(:cli) { described_class.new(bucket: 'invalid_bucket', stub_responses: { head_object: 'BadRequest' }) }

it { expect(cli.exist?('file.txt')).to be(false) }
end
end

describe '#find' do
Expand Down Expand Up @@ -168,6 +176,16 @@
expect { cli.find('test6.txt') }.to raise_error(CloudStorage::ObjectNotFound, /test6.txt/)
end
end

# Servers differ on an invalid bucket name (400 on AWS and MinIO, 404 on
# SeaweedFS), so the error branch is driven by a stubbed client.
context 'when S3 rejects the request' do
let(:cli) { described_class.new(bucket: 'invalid_bucket', stub_responses: { head_object: 'BadRequest' }) }

it do
expect { cli.find('test6.txt') }.to raise_error(CloudStorage::ObjectNotFound, /test6.txt/)
end
end
end

describe '#delete_files' do
Expand Down
Loading