fix(ci): batch of 3 CI fixes (live test, rust toolchain, cargo profile) - #52
Merged
Conversation
…e main workspace
The live integration test for octo-adapter-telegram against a real TDLib
session was previously located at crates/octo-adapter-telegram/tests/
live_session_test.rs. Because octo-telegram-onboard-core depends on
octo-adapter-telegram with features = ["real-tdlib"], cargo's workspace
feature unification enabled the real-tdlib feature across the workspace,
which in turn caused 'cargo test --workspace' to auto-discover and build
the live_session_test target. At test-execution time the test binary
failed to load with 'error while loading shared libraries: libc++.so.1'
because the prebuilt TDLib shared library is linked against LLVM's libc++,
which is not installed on the default ubuntu-latest CI runner. This
broke CI for every push.
Feature gates and explicit [[test]] entries could not isolate the test:
cargo's feature resolver unifies 'free' features across the workspace,
so the test was always built.
Move the live test to a new standalone crate at
live-tests/octo-telegram-live-tests/ that is intentionally NOT a member
of the main workspace (root Cargo.toml uses members = ["crates/*"]; the
new crate lives in live-tests/, which the root glob does not match). The
new crate declares an empty [workspace] table so it is a complete
workspace of its own, and is therefore physically unreachable from
'cargo test --workspace' at the repo root.
This guarantees CI can never build or run the live test, regardless of
feature flags, resolver behavior, or transitive feature unification.
To run the live test manually:
cd live-tests/octo-telegram-live-tests
cargo test -- --ignored --nocapture --test-threads=1
Changes:
- Move crates/octo-adapter-telegram/tests/live_session_test.rs
-> live-tests/octo-telegram-live-tests/tests/live_session_test.rs
- New crate: live-tests/octo-telegram-live-tests/ (standalone, with
empty [workspace] table) containing Cargo.toml, src/lib.rs (marker),
tests/live_session_test.rs, and .gitignore (target/, Cargo.lock)
- Move tracing-subscriber dev-dependency from octo-adapter-telegram
to the new crate (where the test now lives)
- ci.yml: no change needed; the 'Install C++ runtime' step is no longer
required because CI cannot reach the live test
The type-check job was failing on fresh runners with:
💥 maturin failed
Caused by: Failed to run rustc to get the host target
error: failed to install component: 'clippy-preview-x86_64-unknown-linux-gnu',
detected conflict: 'bin/cargo-clippy'
Root cause: the type-check job ran 'maturin develop' without first
installing a Rust toolchain via rustup. Maturin then tried to bootstrap
its own rustc and hit a toolchain conflict on runners with a partially
installed or stale rustup state.
The test job in the same workflow already has
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
and works. The type-check job was missing this step. Adding it
mirrors the test job exactly, gives maturin a clean system rustc to
use, and resolves the conflict on fresh runners.
…ild job
The build job was failing on fresh runners with:
info: syncing channel updates for 1.96.0-x86_64-unknown-linux-gnu
info: downloading component clippy
error: 'cargo' is not installed for the toolchain '1.96.0-x86_64-unknown-linux-gnu'
💥 maturin failed
Caused by: Cargo metadata failed.
Caused by: `cargo metadata` exited with an error
Root cause: dtolnay/rust-toolchain@stable defaults to --profile
minimal, which installs only rustc (no cargo, no clippy, no
rustfmt). The test and type-check jobs in this workflow happen to
work because their runners have cargo pre-installed in the Ubuntu
image. The build job hit a fresh runner without that, and maturin
could not find cargo for the stable toolchain.
Switch the build job's Install Rust step to profile: default, which
installs cargo (and clippy, rustfmt, rust-docs) explicitly via
rustup. The build job is now self-sufficient regardless of the
runner image.
The test and type-check jobs are left at the default (minimal)
profile since they currently work; they can be flipped to default
later if they start hitting the same issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent CI fixes, batched into one PR because they are all
small workflow / workspace-config changes and have been verified
together on the
nextbranch (commit rangee201d48..a8754e8). All 5 CI jobs (Lint, Rust CI, Coverage,Security Scan, Quota Router Python SDK) are green.
e201d48chore(ci): move telegram live_session_test to standalone crate outside main workspaceca9709afix(ci): install rust toolchain in quota-router-python type-check joba8754e8fix(ci): install cargo via profile: default in quota-router-python build jobDetails
1.
e201d48— movelive_session_testout of the main workspacecrates/octo-adapter-telegram/tests/live_session_test.rswas beingbuilt by
cargo test --workspacebecause of feature unification(
octo-telegram-onboard-coredepends onocto-adapter-telegramwithfeatures = ["real-tdlib"], whichcargo's resolver propagates workspace-wide). The test requires
libc++.so.1(TDLib is linked against LLVM's libc++), which isnot installed on the default
ubuntu-latestCI runner, so everypush failed with
error while loading shared libraries: libc++.so.1.Feature gates /
required-features/autotests = falsecouldnot isolate the test — cargo's resolver unifies "free" features
across the workspace. The only robust solution is to physically
move the test to a sibling crate that is NOT a workspace member.
New crate:
live-tests/octo-telegram-live-tests/(standalone,has empty
[workspace]table,members = ["crates/*"]in rootdoes not match
live-tests/). CI can never build or run thelive test from
cargo test --workspace.ci.ymlno longerneeds the
Install C++ runtimestep.Run manually:
2.
ca9709a—Install Rustin quota-router-pythontype-checkThe
type-checkjob was missing thedtolnay/rust-toolchain@stablestep that the
testjob already had. Without it,maturin developtried to bootstrap its own rustc on fresh runners and failed with:
Adding the
Install Ruststep mirrors thetestjob exactly andgives maturin a clean system rustc.
3.
a8754e8—profile: defaultin quota-router-pythonbuildThe
buildjob was also failing on fresh runners with:Root cause:
dtolnay/rust-toolchain@stabledefaults to--profile minimal, which installs onlyrustc(no cargo, noclippy, no rustfmt). The
testandtype-checkjobs happenedto work because their runners had cargo pre-installed; the
buildjob hit a fresh runner without that. Switching to
profile: defaultinstalls cargo (and clippy, rustfmt,rust-docs) explicitly via rustup.
Test plan
nextand have been runningin CI for several hours
Quota Router Python SDK
same green result
cargo test --workspace --exclude quota-router-pyo3no longer builds the telegram live test (only the whatsapp one,
which is correctly feature-gated and unrelated)
Notes for reviewer
the 3 commits were authored on top of
7fc7486and the PR baseis also
7fc7486.f66aea0,7e3583b,2f99780(vs the originals
e201d48,ca9709a,a8754e8onnext) — only the parent changes; commits are byte-identical.