Skip to content
Open
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
run: |
# Start mock s3 service
make s3-bg
sleep 1
# Set up fixture S3 files
make fixture
make cover # run test with coverage
env:
AWS_REGION: ap-northeast-1 # for awscli
Expand Down
35 changes: 5 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FLOCI_VERSION = 1.5.30

.PHONY: test
test:
go test . -v
Expand All @@ -24,35 +22,12 @@ cover:

.PHONY: s3
s3:
docker run -p 4572:4566 -e SERVICES=s3 floci/floci:$(FLOCI_VERSION)
docker compose -f ./docker-compose.e2e.yml up

.PHONY: s3-bg
s3-bg:
docker run -d -p 4572:4566 -e SERVICES=s3 floci/floci:$(FLOCI_VERSION)
docker compose -f ./docker-compose.e2e.yml up -d --wait

.PHONY: fixture
fixture:
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket/foo/
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket/bar/baz/
aws s3 --endpoint-url http://localhost:4572 mb s3://s3-source
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://s3-source
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://s3-source/foo/
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://s3-source/bar/baz/
aws s3 --endpoint-url http://localhost:4572 mb s3://s3-destination
aws s3 --endpoint-url http://localhost:4572 mb s3://s3-destination2
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-escaped
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-upload
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket-upload/dest_only_file
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-upload-file
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-delete
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket-delete/dest_only_file
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-delete-file
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket-delete-file
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket-delete-file/dest_only_file
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-dryrun
aws s3 --endpoint-url http://localhost:4572 cp README.md s3://example-bucket-dryrun/dest_only_file
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-directory
aws s3 --endpoint-url http://localhost:4572 mb s3://example-bucket-mime
aws s3api --endpoint-url http://localhost:4572 put-object --bucket example-bucket-directory --key test/
.PHONY: s3-down
s3-down:
docker compose -f ./docker-compose.e2e.yml down
13 changes: 13 additions & 0 deletions docker-compose.e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
floci:
image: floci/floci:1.5.30-compat
volumes:
- "./test/s3/start.d:/etc/floci/init/start.d"
- "./README.md:/fixture/README.md"
ports:
- "4572:4566"
healthcheck:
test: "curl -f http://localhost:4566/_floci/health && test -f /tmp/START_SCRIPTS_DONE || exit 1"
interval: 2s
timeout: 1s
retries: 15
14 changes: 0 additions & 14 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
"config:recommended",
"schedule:weekends"
],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": [
"/^Makefile$/"
],
"matchStrings": [
"FLOCI_VERSION\\s*=\\s*(?<currentValue>.*)"
],
"datasourceTemplate": "docker",
"depNameTemplate": "floci/floci",
"versioningTemplate": "docker"
}
],
"postUpdateOptions": [
"gomodTidy"
],
Expand Down
39 changes: 39 additions & 0 deletions test/s3/start.d/00-s3-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

set -eu

awslocal s3 mb s3://example-bucket
awslocal s3 cp /fixture/README.md s3://example-bucket
awslocal s3 cp /fixture/README.md s3://example-bucket/foo/
awslocal s3 cp /fixture/README.md s3://example-bucket/bar/baz/

awslocal s3 mb s3://s3-source
awslocal s3 cp /fixture/README.md s3://s3-source
awslocal s3 cp /fixture/README.md s3://s3-source/foo/
awslocal s3 cp /fixture/README.md s3://s3-source/bar/baz/

awslocal s3 mb s3://s3-destination

awslocal s3 mb s3://s3-destination2

awslocal s3 mb s3://example-bucket-escaped

awslocal s3 mb s3://example-bucket-upload
awslocal s3 cp /fixture/README.md s3://example-bucket-upload/dest_only_file

awslocal s3 mb s3://example-bucket-upload-file

awslocal s3 mb s3://example-bucket-delete
awslocal s3 cp /fixture/README.md s3://example-bucket-delete/dest_only_file

awslocal s3 mb s3://example-bucket-delete-file
awslocal s3 cp /fixture/README.md s3://example-bucket-delete-file
awslocal s3 cp /fixture/README.md s3://example-bucket-delete-file/dest_only_file

awslocal s3 mb s3://example-bucket-dryrun
awslocal s3 cp /fixture/README.md s3://example-bucket-dryrun/dest_only_file

awslocal s3 mb s3://example-bucket-directory
awslocal s3api put-object --bucket example-bucket-directory --key test/

awslocal s3 mb s3://example-bucket-mime
3 changes: 3 additions & 0 deletions test/s3/start.d/99-done.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec touch /tmp/START_SCRIPTS_DONE
Loading