Skip to content

Commit

Permalink
Update toolchain before running build-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Oct 13, 2023
1 parent c10535a commit 4f8eaf6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ mod tests {
storage.store_one(&old_source_file, Vec::new())?;

let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

// check release record in the db (default and other targets)
Expand Down Expand Up @@ -1039,6 +1040,7 @@ mod tests {
storage.store_one(&old_source_file, Vec::new())?;

let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(!builder.build_package(crate_, version, PackageKind::CratesIo)?);

// check release record in the db (default and other targets)
Expand Down Expand Up @@ -1086,6 +1088,7 @@ mod tests {
let crate_ = "thiserror-impl";
let version = "1.0.26";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

let storage = env.storage();
Expand All @@ -1109,6 +1112,7 @@ mod tests {
let crate_ = "windows-win";
let version = "2.4.1";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
if builder.toolchain.as_ci().is_some() {
return Ok(());
}
Expand Down Expand Up @@ -1158,6 +1162,7 @@ mod tests {
let crate_ = "docs_rs_test_incorrect_lockfile";
let version = "0.1.2";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

Ok(())
Expand All @@ -1180,6 +1185,7 @@ mod tests {
let crate_ = "docs_rs_test_incorrect_lockfile";
let version = "0.2.0";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

Ok(())
Expand All @@ -1193,6 +1199,7 @@ mod tests {
let crate_ = "proc-macro2";
let version = "1.0.33";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);
Ok(())
});
Expand All @@ -1205,6 +1212,7 @@ mod tests {
let crate_ = "serde";
let version = "1.0.152";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

let mut conn = env.db().conn();
Expand All @@ -1231,6 +1239,7 @@ mod tests {
let crate_ = "stylish-core";
let version = "0.1.1";
let mut builder = RustwideBuilder::init(env).unwrap();
builder.update_toolchain()?;
assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?);

let mut conn = env.db().conn();
Expand All @@ -1254,8 +1263,9 @@ mod tests {
#[ignore]
fn test_build_std() {
wrapper(|env| {
assert!(RustwideBuilder::init(env)?
.build_local_package(Path::new("tests/crates/build-std"))?);
let mut builder = RustwideBuilder::init(env)?;
builder.update_toolchain()?;
assert!(builder.build_local_package(Path::new("tests/crates/build-std"))?);
Ok(())
})
}
Expand Down

0 comments on commit 4f8eaf6

Please sign in to comment.