diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..73967a89 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[alias] +# run tests and generate lcov.info +cov = "llvm-cov --workspace --lcov --output-path lcov.info" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..0fc29d76 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,44 @@ +name: Coverage Badge + +on: + push: + branches: [main] + paths: + - crates/** + - Cargo.toml + - Cargo.lock + - Dockerfile + pull_request: + paths: + - crates/** + - Cargo.toml + - Cargo.lock + - Dockerfile +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true +jobs: + code-coverage-publish-coveralls: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Dependencies + run: | + # Install lcov if not already installed + sudo apt-get install -y lcov + cargo install cargo-llvm-cov + rustup update + rustup component add llvm-tools-preview + + - name: Create coverage info + run: | + # Run coverage test + cargo cov + + - name: Upload to coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.DOCKERHUB_TOKEN }} + path-to-lcov: lcov.info \ No newline at end of file diff --git a/README.md b/README.md index 666e4f40..83d24bda 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Coverage Status](https://coveralls.io/repos/github/embucket/embucket/badge.svg?branch=master)](https://coveralls.io/github/embucket/embucket?branch=master) + # Embucket **Run Snowflake SQL dialect on your data lake in 30 seconds. Zero dependencies.** diff --git a/crates/api-snowflake-rest/src/tests/test_stress.rs b/crates/api-snowflake-rest/src/tests/test_stress.rs index 0bc6890f..ad8e1e55 100644 --- a/crates/api-snowflake-rest/src/tests/test_stress.rs +++ b/crates/api-snowflake-rest/src/tests/test_stress.rs @@ -56,7 +56,7 @@ mod stress { // Returned results match any of these patterns let expected_patterns = vec![ "successfully executed", - "Too many open files", // OS related error + "Too many open files", // OS related error "SQL compilation error: Schema 's3_table_db.schema1' does not exist or not authorized 002003", "Generic S3 error: Error performing GET", "Iceberg Object store: The operation lacked the necessary privileges to complete for path metadata",