Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Support CI test for s3_read_on_wasm #3813

Merged
merged 5 commits into from
Dec 24, 2023
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
45 changes: 45 additions & 0 deletions .github/workflows/edge_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,48 @@ jobs:
env:
OPENDAL_FS_ROOT: /tmp/test_dir

test_s3_read_on_wasm:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup

- name: Setup for wasm32
run: |
rustup target add wasm32-unknown-unknown

- name: Install Chrome Environment
run: |
mkdir -p /tmp/chrome
wget $(curl https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r '.versions | sort_by(.version) | reverse | .[0] | .downloads.chrome | .[] | select(.platform == "linux64") | .url')
wget $(curl https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r '.versions | sort_by(.version) | reverse | .[0] | .downloads.chromedriver | .[] | select(.platform == "linux64") | .url')
unzip chromedriver-linux64.zip
unzip chrome-linux64.zip
cp -r chrome-linux64/ /tmp/chrome/
cp -r chromedriver-linux64 /tmp/chrome/chromedriver

- name: Setup wasm-pack
run: |
cargo install wasm-pack

- name: Setup MinIO Server
shell: bash
working-directory: fixtures/s3
run: docker compose -f docker-compose-minio.yml up -d --wait

- name: Setup test bucket
shell: bash
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test

- name: Test wasm
working-directory: core/edge/s3_read_on_wasm
run: |
export PATH=$PATH:/tmp/chrome/chrome-linux64/:/tmp/chrome/chromedriver-linux64/
wasm-pack test --chrome --headless
4 changes: 2 additions & 2 deletions core/edge/s3_read_on_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub async fn hello_world() -> String {
let mut cfg = S3::default();
cfg.endpoint("http://127.0.0.1:9900");
cfg.endpoint("http://127.0.0.1:9000");
cfg.access_key_id("minioadmin");
cfg.secret_access_key("minioadmin");
cfg.bucket("opendal");
cfg.bucket("test");
cfg.region("us-east-1");

let op = Operator::new(cfg).unwrap().finish();
Expand Down
Loading