Skip to content

Commit

Permalink
Simplified tests (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Mar 19, 2022
1 parent a6e6cf3 commit 6511088
Show file tree
Hide file tree
Showing 18 changed files with 1,157 additions and 1,280 deletions.
122 changes: 29 additions & 93 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,40 @@ name: Check and test
on: [push, pull_request]

jobs:
# test the crate
linux-test:
test:
name: Test
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: /github/home/.cargo
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
key: cargo-cache-
- name: Cache dependencies
uses: actions/cache@v2
with:
path: /github/home/target
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
key: ${{ runner.os }}-amd64-target-cache-stable
- name: Setup toolchain
run: |
rustup toolchain install stable
rustup default stable
rustup component add rustfmt
- name: Run unit tests
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo test
- name: Install Rust
run: rustup update stable
- uses: Swatinem/rust-cache@v1
- name: Setup parquet files
run: |
apt update && apt install python3-pip python3-venv -y -q
cd integration-tests
python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install pyarrow==5
venv/bin/python integration/write_pyarrow.py
cd ..
- name: Run integration tests
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cd integration-tests
cargo test
source venv/bin/activate
pip install pip --upgrade
pip install pyarrow==6
python tests/write_pyarrow.py
deactivate
- name: Run
run: cargo test

clippy:
name: Clippy
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: /github/home/.cargo
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
key: cargo-cache-
- name: Cache dependencies
uses: actions/cache@v2
with:
path: /github/home/target
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
key: ${{ runner.os }}-amd64-target-cache-stable
- name: Setup toolchain
run: |
rustup toolchain install stable
rustup default stable
rustup component add rustfmt clippy
- name: Run
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo clippy
- name: Install Rust
run: rustup update stable
- uses: Swatinem/rust-cache@v1
- name: Install clippy
run: rustup component add clippy
- name: "clippy"
run: cargo clippy

coverage:
name: Coverage
Expand All @@ -94,38 +45,23 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: /home/runner/.cargo
# this key is not equal because the user is different than on a container (runner vs github)
key: cargo-coverage-cache-
- name: Cache dependencies
uses: actions/cache@v2
with:
path: /home/runner/target
# this key is not equal because coverage uses different compilation flags.
key: ${{ runner.os }}-amd64-target-coverage-cache-stable-
- name: Install Rust
run: rustup update stable
- uses: Swatinem/rust-cache@v1
- name: Setup parquet files
run: |
apt update && apt install python3-pip python3-venv -y -q
cd integration-tests
python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install pyarrow==5
venv/bin/python integration/write_pyarrow.py
cd ..
source venv/bin/activate
pip install pip --upgrade
pip install pyarrow==6
python tests/write_pyarrow.py
deactivate
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Run coverage
run: |
export CARGO_HOME="/home/runner/.cargo"
export CARGO_TARGET_DIR="/home/runner/target"
# 2020-11-15: There is a cargo-tarpaulin regression in 0.17.0
# see https://github.com/xd009642/tarpaulin/issues/618
cargo install --version 0.16.0 cargo-tarpaulin
cargo tarpaulin --out Xml
cd integration-tests
cargo tarpaulin --out Xml
cargo tarpaulin --ignore-tests --out Xml
- name: Report coverage
continue-on-error: true
run: bash <(curl -s https://codecov.io/bash)
4 changes: 0 additions & 4 deletions integration-tests/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions integration-tests/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions integration-tests/README.md

This file was deleted.

Loading

0 comments on commit 6511088

Please sign in to comment.