Skip to content

Nextest-2024 #1033

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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2aa78d2
update proj and ci
ChristianBeilschmidt Feb 18, 2025
bc1b246
pipx
ChristianBeilschmidt Feb 18, 2025
aee56d4
no free space
ChristianBeilschmidt Feb 18, 2025
841065e
pipx
ChristianBeilschmidt Feb 18, 2025
5fe5fe4
exclude scripts workspace
ChristianBeilschmidt Feb 18, 2025
40b24a6
custom action
ChristianBeilschmidt Feb 19, 2025
e3c2a69
move yml
ChristianBeilschmidt Feb 19, 2025
191abe0
fix yml
ChristianBeilschmidt Feb 19, 2025
ea502b5
find path
ChristianBeilschmidt Feb 19, 2025
30bff06
executable entrypoint
ChristianBeilschmidt Feb 19, 2025
8f28e7e
fix raster stream geotiff tests
ChristianBeilschmidt Feb 20, 2025
fc5f097
postgres in CI container
ChristianBeilschmidt Feb 20, 2025
8e05681
start postgres before testing
ChristianBeilschmidt Feb 21, 2025
2695bcb
fix tests
ChristianBeilschmidt Feb 24, 2025
7ad2f5d
fix action
ChristianBeilschmidt Feb 24, 2025
53ed624
debug lcov.info
ChristianBeilschmidt Feb 24, 2025
9f365ba
debug coveralls
ChristianBeilschmidt Feb 24, 2025
2b80834
base path
ChristianBeilschmidt Feb 24, 2025
5ed3d66
jobs 1
ChristianBeilschmidt Feb 24, 2025
bac947b
upload lcov
ChristianBeilschmidt Feb 24, 2025
a71c4fe
adjust lcov
ChristianBeilschmidt Feb 25, 2025
d877639
test threads
ChristianBeilschmidt Feb 25, 2025
13d792f
remove debug output
ChristianBeilschmidt Feb 25, 2025
a6d01fb
1.85 + clippy fixes
ChristianBeilschmidt Feb 25, 2025
7ef1f2f
rust 2024 adaptions
ChristianBeilschmidt Feb 28, 2025
c859824
cargo fmt
ChristianBeilschmidt Feb 28, 2025
0eb99b9
fix no mangle unsafe
ChristianBeilschmidt Mar 1, 2025
22ca932
simplify CI
ChristianBeilschmidt Mar 3, 2025
ccbe1b4
try out nextest
ChristianBeilschmidt Mar 3, 2025
c0ccaa9
serial tests
ChristianBeilschmidt Mar 3, 2025
604b677
clean cargo between build and run
ChristianBeilschmidt Mar 3, 2025
9c43079
debug stripping for CI tests
ChristianBeilschmidt Mar 3, 2025
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
8 changes: 8 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[test-groups]
integration-tests = { max-threads = 1 }


[[profile.default.overrides]]
filter = 'package(geoengine-services)'
test-group = 'integration-tests'
slow-timeout = { period = "360s" }
6 changes: 6 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: "Run Tests & Generate Coverage"
description: "Run Geo Engine tests with coverage"
runs:
using: "docker"
image: "docker://quay.io/geoengine/devcontainer:latest"
entrypoint: "./.github/actions/test/test.sh"
30 changes: 30 additions & 0 deletions .github/actions/test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

function print_headline() {
local BOLD_WHITE_ON_CYAN="\e[1;46;37m"
local BOLD_CYAN="\e[1;49;36m"
local RESET_COLOR="\e[0m"
printf "${BOLD_WHITE_ON_CYAN} ▶ ${BOLD_CYAN} $1 ${RESET_COLOR}\n" >&2
}

print_headline "Install cargo-llvm-cov and nextest"
cargo install --locked cargo-llvm-cov
cargo install --locked cargo-nextest

print_headline "Run Tests & Generate Code Coverage"
service postgresql start
cargo llvm-cov nextest-archive \
--archive-file tests.tar.zst \
--cargo-profile ci \
--locked \
--all-features
cargo clean
cargo llvm-cov nextest \
--archive-file tests.tar.zst
--all-features \
--lcov \
--output-path lcov.info

print_headline "Run Doctests"
# cf. https://github.com/taiki-e/cargo-llvm-cov/issues/2
cargo test --doc --all-features --locked
145 changes: 47 additions & 98 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,11 @@ env:

jobs:
test:
runs-on: ${{matrix.os}}

services:
postgres:
image: postgis/postgis
env:
POSTGRES_USER: geoengine
POSTGRES_PASSWORD: geoengine
POSTGRES_DB: geoengine
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
matrix:
os:
- ubuntu-22.04
features: [""]
build: [""]
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand All @@ -44,22 +26,41 @@ jobs:
large-packages: true
docker-images: true
swap-storage: true
- name: Install lld & GDAL & Protobuf
run: |
sudo apt-get update
sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler
sudo apt-get clean
export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH
sudo ldconfig
- name: Install Rustup
# TODO: Get Cache back
# - name: setup rust build cache
# uses: Swatinem/rust-cache@v2
# with:
# # An explicit cache key that is used instead of the automatic `job`-based
# # cache key and is thus stable across jobs.
# # Default: empty
# shared-key: ""

# # An additional cache key that is added alongside the automatic `job`-based
# # cache key and can be used to further differentiate jobs.
# # Default: empty
# key: ci_test_
- name: Testsuite
uses: ./.github/actions/test
- name: Adjust lcov.info
# The lcov file is generated in the container and contains absolute paths, so we need to adjust them.
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Install SQLFluff
run: pip install sqlfluff==3.3.0
sed -i 's|/github/workspace/||g' lcov.info
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: lcov.info

lint:
runs-on: ubuntu-24.04
container: quay.io/geoengine/devcontainer:latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init rustup toolchain
run: rustup show # enough to initialize the toolchain
# somehow rustup show will take care to initialize the version based on the toolchain file
run: rustup show
- name: setup rust build cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -71,64 +72,30 @@ jobs:
# An additional cache key that is added alongside the automatic `job`-based
# cache key and can be used to further differentiate jobs.
# Default: empty
key: ci_test_${{ matrix.os }}_${{ matrix.features }}_${{ matrix.build }}

# A whitespace separated list of env-var *prefixes* who's value contributes
# to the environment cache key.
# The env-vars are matched by *prefix*, so the default `RUST` var will
# match all of `RUSTC`, `RUSTUP_*`, `RUSTFLAGS`, `RUSTDOC_*`, etc.
# Default: "CARGO CC CFLAGS CXX CMAKE RUST"
#env-vars: ""

# The cargo workspaces and target directory configuration.
# These entries are separated by newlines and have the form
# `$workspace -> $target`. The `$target` part is treated as a directory
# relative to the `$workspace` and defaults to "target" if not explicitly given.
# Default: ". -> target"
#workspaces: ""

# Determines if the cache should be saved even when the workflow has failed.
# Default: "false"
#cache-on-failure: ""
- name: Check with Rustfmt
key: ci_test_
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Check with Clippy
run: cargo clippy --all-targets --locked ${{ matrix.features }} ${{ matrix.build }} -- -D warnings
- name: Check with SQLFluff
run: sqlfluff lint
- name: Verify for expression dependencies workspace
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: SQLFluff
run: pipx run sqlfluff==3.3.0 lint
- name: Verifying expression dependencies workspace
run: |
rustup toolchain install nightly
chmod +x ./.scripts/check-expression-deps.rs
./.scripts/check-expression-deps.rs
- name: Run tests
run: cargo test --locked ${{ matrix.features }} ${{ matrix.build }} --verbose

build:
runs-on: ${{matrix.os}}
runs-on: ubuntu-24.04
container: quay.io/geoengine/devcontainer:latest

strategy:
matrix:
os:
- ubuntu-22.04
features: [""]
build: ["", "--release"]

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: APT update
run: sudo apt-get update
- name: Install lld & GDAL & Protobuf
run: |
sudo apt-get install lld libgdal-dev gdal-bin build-essential curl protobuf-compiler
export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH
sudo ldconfig
- name: Install Rustup
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
uses: actions/checkout@v4
- name: Init rustup toolchain
# somehow rustup show will take care to initialize the version based on the toolchain file
run: rustup show
Expand All @@ -143,24 +110,6 @@ jobs:
# An additional cache key that is added alongside the automatic `job`-based
# cache key and can be used to further differentiate jobs.
# Default: empty
key: ci_test_${{ matrix.os }}_${{ matrix.features }}_${{ matrix.build }}

# A whitespace separated list of env-var *prefixes* who's value contributes
# to the environment cache key.
# The env-vars are matched by *prefix*, so the default `RUST` var will
# match all of `RUSTC`, `RUSTUP_*`, `RUSTFLAGS`, `RUSTDOC_*`, etc.
# Default: "CARGO CC CFLAGS CXX CMAKE RUST"
#env-vars: ""

# The cargo workspaces and target directory configuration.
# These entries are separated by newlines and have the form
# `$workspace -> $target`. The `$target` part is treated as a directory
# relative to the `$workspace` and defaults to "target" if not explicitly given.
# Default: ". -> target"
#workspaces: ""

# Determines if the cache should be saved even when the workflow has failed.
# Default: "false"
#cache-on-failure: ""
key: ci_test_${{ matrix.build }}
- name: Build
run: cargo build --locked ${{ matrix.features }} ${{ matrix.build }} --verbose
run: cargo build --locked ${{ matrix.build }} --verbose
4 changes: 2 additions & 2 deletions .github/workflows/clear-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
clear-cache:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Clear all caches
Expand All @@ -21,7 +21,7 @@ jobs:
const [owner, repo] = GITHUB_REPOSITORY.split('/')

console.log(`Clearing all caches for ${owner}/${repo}`)

let caches = [];

do {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
create-container:
if: github.event_name != 'schedule' || github.repository_owner == 'geo-engine'

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

env:
TAG_NAME: nightly
Expand Down Expand Up @@ -54,13 +54,13 @@ jobs:
echo "CONTAINER_REPOSITORY_BRANCH=${{ github.event.inputs.container_repository_branch }}" >> $GITHUB_ENV

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
path: geoengine

- name: Checkout container files
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: geo-engine/geoengine-container
ref: ${{ env.CONTAINER_REPOSITORY_BRANCH }}
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
name: Post to a Slack channel in case of failure
needs: create-container
if: always()
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Post to a Slack channel
if: ${{ needs.create-container.result == 'failure' }}
Expand Down
Loading
Loading