Skip to content
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

Gather test coverage with stable rust #2286

Merged
merged 2 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
continue-on-error: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
),
allow(unused_variables, unused_assignments)
)))]
#![cfg_attr(coverage, feature(no_coverage))] // used in src/test_hygiene.rs

//! Rust bindings to the Python interpreter.
//!
Expand Down
3 changes: 0 additions & 3 deletions src/test_hygiene/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// The modules in this test are used to check PyO3 macro expansion is hygienic. By locating the test
// inside the crate the global `::pyo3` namespace is not available, so in combination with
// #[pyo3(crate = "crate")] this validates that all macro expansion respects the setting.
//
// The generated code is never executed (these tests are checking compile time correctness.)
#![cfg_attr(coverage, no_coverage)]

mod misc;
mod pyclass;
Expand Down
8 changes: 0 additions & 8 deletions xtask/src/llvm_cov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,5 @@ fn get_coverage_env() -> Result<HashMap<String, String>> {
env.get("CARGO_LLVM_COV_TARGET_DIR").unwrap().to_owned(),
);

// Coverage only works on nightly.
let rustc_version =
String::from_utf8(get_output(Command::new("rustc").arg("--version"))?.stdout)
.context("failed to parse rust version as utf8")?;
if !rustc_version.contains("nightly") {
env.insert("RUSTUP_TOOLCHAIN".to_owned(), "nightly".to_owned());
}

Ok(env)
}