-
Notifications
You must be signed in to change notification settings - Fork 847
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port
object_store
integration tests, use github actions (#2148)
* Add github test skeleton * Cleanups and fmt * Run on changes to object_store * Update name * Broken yaml? * Remove uneeded lint job * Run only object store tests * Add local gcp test instructions * Allow custom http client for gcs * remove unused error * Also run clippy * Update object_store/src/gcp.rs Co-authored-by: Raphael Taylor-Davies <[email protected]> * rename more * Fixup test Co-authored-by: Raphael Taylor-Davies <[email protected]>
- Loading branch information
Showing
5 changed files
with
213 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
--- | ||
name: "Object Store" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
# Only run when object store files or github workflows change | ||
- object_store/** | ||
- .github/** | ||
|
||
jobs: | ||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
container: | ||
image: amd64/rust | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Rust toolchain with clippy | ||
run: | | ||
rustup toolchain install stable | ||
rustup default stable | ||
rustup component add clippy | ||
- name: Run clippy | ||
run: | | ||
cargo clippy -p object_store --all-features | ||
# test the crate | ||
linux-test: | ||
name: Emulator Tests | ||
runs-on: ubuntu-latest | ||
services: | ||
fake-gcs: | ||
image: fsouza/fake-gcs-server | ||
ports: | ||
- 4443:4443 | ||
localstack: | ||
image: localstack/localstack:0.14.4 | ||
ports: | ||
- 4566:4566 | ||
azurite: | ||
image: mcr.microsoft.com/azure-storage/azurite | ||
ports: | ||
- 10000:10002 | ||
container: | ||
image: amd64/rust | ||
env: | ||
# Disable full debug symbol generation to speed up CI build and keep memory down | ||
# "1" means line tables only, which is useful for panic tracebacks. | ||
RUSTFLAGS: "-C debuginfo=1" | ||
# https://github.com/rust-lang/cargo/issues/10280 | ||
CARGO_NET_GIT_FETCH_WITH_CLI: "true" | ||
RUST_BACKTRACE: "1" | ||
# Run integration tests | ||
TEST_INTEGRATION: 1 | ||
AWS_DEFAULT_REGION: "us-east-1" | ||
AWS_ACCESS_KEY_ID: test | ||
AWS_SECRET_ACCESS_KEY: test | ||
AWS_ENDPOINT: http://localstack:4566 | ||
AZURE_USE_EMULATOR: "1" | ||
AZURITE_BLOB_STORAGE_URL: "http://azurite:10000" | ||
AZURITE_QUEUE_STORAGE_URL: "http://azurite:10001" | ||
GOOGLE_SERVICE_ACCOUNT: "/tmp/gcs.json" | ||
OBJECT_STORE_BUCKET: test-bucket | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Configure Fake GCS Server (GCP emulation) | ||
run: | | ||
curl --insecure -v -X POST --data-binary '{"name":"test-bucket"}' -H "Content-Type: application/json" "https://fake-gcs:4443/storage/v1/b" | ||
echo '{"gcs_base_url": "https://fake-gcs:4443", "disable_oauth": true, "client_email": "", "private_key": ""}' > "$GOOGLE_SERVICE_ACCOUNT" | ||
- name: Setup LocalStack (AWS emulation) | ||
run: | | ||
cd /tmp | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
unzip awscliv2.zip | ||
./aws/install | ||
aws --endpoint-url=http://localstack:4566 s3 mb s3://test-bucket | ||
- name: Configure Azurite (Azure emulation) | ||
# the magical connection string is from | ||
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#http-connection-strings | ||
run: | | ||
curl -sL https://aka.ms/InstallAzureCLIDeb | bash | ||
az storage container create -n test-bucket --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;' | ||
- name: Setup Rust toolchain | ||
run: | | ||
rustup toolchain install stable | ||
rustup default stable | ||
- name: Run object_store tests | ||
run: | | ||
# run tests | ||
cargo test -p object_store --features=aws,azure,azure_test,gcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters