Skip to content

Commit f39d68c

Browse files
chore: introduce c++ integration test (#352)
1 parent ec4eb74 commit f39d68c

14 files changed

Lines changed: 2601 additions & 221 deletions
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: C++ Build and Tests
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
paths-ignore:
25+
- 'website/**'
26+
- '**/*.md'
27+
pull_request:
28+
branches:
29+
- main
30+
paths-ignore:
31+
- 'website/**'
32+
- '**/*.md'
33+
- 'bindings/python/**'
34+
workflow_dispatch:
35+
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
38+
cancel-in-progress: true
39+
40+
jobs:
41+
build-and-test-cpp:
42+
timeout-minutes: 60
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install protoc
48+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
49+
50+
- name: Install Apache Arrow C++
51+
run: |
52+
sudo apt-get install -y -V ca-certificates lsb-release wget
53+
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
54+
sudo apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
55+
sudo apt-get update
56+
sudo apt-get install -y -V libarrow-dev
57+
58+
- name: Rust Cache
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cargo/registry
63+
~/.cargo/git
64+
target
65+
key: cpp-test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
66+
67+
- name: Build C++ bindings and tests
68+
working-directory: bindings/cpp
69+
run: |
70+
cmake -B build -DFLUSS_ENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
71+
cmake --build build --parallel
72+
73+
- name: Run C++ integration tests
74+
working-directory: bindings/cpp
75+
run: cd build && ctest --output-on-failure --timeout 300
76+
env:
77+
RUST_LOG: DEBUG
78+
RUST_BACKTRACE: full
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Python Build and Tests
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
paths-ignore:
25+
- 'website/**'
26+
- '**/*.md'
27+
pull_request:
28+
branches:
29+
- main
30+
paths-ignore:
31+
- 'website/**'
32+
- '**/*.md'
33+
- 'bindings/cpp/**'
34+
workflow_dispatch:
35+
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
38+
cancel-in-progress: true
39+
40+
jobs:
41+
build-and-test-python:
42+
timeout-minutes: 60
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
python: ["3.9", "3.10", "3.11", "3.12"]
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: ${{ matrix.python }}
54+
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v4
57+
58+
- name: Install protoc
59+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
60+
61+
- name: Rust Cache
62+
uses: actions/cache@v4
63+
with:
64+
path: |
65+
~/.cargo/registry
66+
~/.cargo/git
67+
target
68+
key: python-test-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/Cargo.lock') }}
69+
70+
- name: Build Python bindings
71+
working-directory: bindings/python
72+
run: |
73+
uv sync --extra dev
74+
uv run maturin develop
75+
76+
- name: Run Python integration tests
77+
working-directory: bindings/python
78+
run: uv run pytest test/ -v
79+
env:
80+
RUST_LOG: DEBUG
81+
RUST_BACKTRACE: full
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Rust Build and Tests
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
paths-ignore:
25+
- 'website/**'
26+
- '**/*.md'
27+
pull_request:
28+
branches:
29+
- main
30+
paths-ignore:
31+
- 'website/**'
32+
- '**/*.md'
33+
- 'bindings/python/**'
34+
- 'bindings/cpp/**'
35+
workflow_dispatch:
36+
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
build-and-test-rust:
43+
timeout-minutes: 60
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
matrix:
47+
os:
48+
- ubuntu-latest
49+
- macos-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Install protoc
54+
run: |
55+
if [ "$RUNNER_OS" = "Linux" ]; then
56+
sudo apt-get update && sudo apt-get install -y protobuf-compiler
57+
elif [ "$RUNNER_OS" = "macOS" ]; then
58+
brew install protobuf
59+
fi
60+
61+
- name: Rust Cache
62+
uses: actions/cache@v4
63+
with:
64+
path: |
65+
~/.cargo/registry
66+
~/.cargo/git
67+
target
68+
key: rust-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
69+
70+
- name: Build
71+
run: cargo build --workspace --all-targets --exclude fluss_python --exclude fluss-cpp
72+
73+
- name: Unit Test
74+
run: cargo test --all-targets --workspace --exclude fluss_python --exclude fluss-cpp
75+
env:
76+
RUST_LOG: DEBUG
77+
RUST_BACKTRACE: full
78+
79+
- name: Integration Test (Linux only)
80+
if: runner.os == 'Linux'
81+
run: |
82+
RUST_TEST_THREADS=1 cargo test --features integration_tests --all-targets --workspace --exclude fluss_python --exclude fluss-cpp -- --nocapture
83+
env:
84+
RUST_LOG: DEBUG
85+
RUST_BACKTRACE: full
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
################################################################################
1818

1919
# This workflow is meant for checking broken links in the documentation.
20-
name: Check Documentation
20+
name: Documentation Check
2121
permissions:
2222
contents: read
2323
on:
@@ -31,7 +31,7 @@ on:
3131
- 'website/**'
3232

3333
jobs:
34-
test-deploy:
34+
check-documentation:
3535
runs-on: ubuntu-latest
3636
defaults:
3737
run:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: License and Formatting Check
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
paths-ignore:
25+
- 'website/**'
26+
- '**/*.md'
27+
pull_request:
28+
branches:
29+
- main
30+
workflow_dispatch:
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
check-license-and-formatting:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Check License Header
43+
uses: apache/skywalking-eyes/header@v0.6.0
44+
45+
- name: Install cargo-deny
46+
uses: taiki-e/install-action@v2
47+
with:
48+
tool: cargo-deny@0.14.22
49+
50+
- name: Check dependency licenses (Apache-compatible)
51+
run: cargo deny check licenses
52+
53+
- name: Install protoc
54+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
55+
56+
- name: Format
57+
run: cargo fmt --all -- --check
58+
59+
- name: Clippy
60+
run: cargo clippy --all-targets --workspace -- -D warnings

0 commit comments

Comments
 (0)