feat: with updated dagger-sdk
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -3,12 +3,12 @@ use std::{path::PathBuf, sync::Arc};
|
||||
use crate::{build::RustVersion, source::RustSource};
|
||||
|
||||
pub struct RustTest {
|
||||
client: Arc<dagger_sdk::Query>,
|
||||
client: dagger_sdk::Query,
|
||||
registry: Option<String>,
|
||||
}
|
||||
|
||||
impl RustTest {
|
||||
pub fn new(client: Arc<dagger_sdk::Query>) -> Self {
|
||||
pub fn new(client: dagger_sdk::Query) -> Self {
|
||||
Self {
|
||||
client,
|
||||
registry: None,
|
||||
@@ -45,9 +45,9 @@ impl RustTest {
|
||||
let build_options = vec!["cargo", "build", "--workspace"];
|
||||
let rust_prebuild = rust_build_image
|
||||
.with_workdir("/mnt/src")
|
||||
.with_directory("/mnt/src", dep_src.id().await?)
|
||||
.with_directory("/mnt/src", dep_src)
|
||||
.with_exec(build_options)
|
||||
.with_mounted_cache("/mnt/src/target/", target_cache.id().await?);
|
||||
.with_mounted_cache("/mnt/src/target/", target_cache);
|
||||
|
||||
let incremental_dir = rust_source
|
||||
.get_rust_target_src(&source, rust_prebuild.clone(), crates.to_vec())
|
||||
@@ -57,10 +57,10 @@ impl RustTest {
|
||||
.with_workdir("/mnt/src")
|
||||
.with_directory(
|
||||
"/usr/local/cargo",
|
||||
rust_prebuild.directory("/usr/local/cargo").id().await?,
|
||||
rust_prebuild.directory("/usr/local/cargo"),
|
||||
)
|
||||
.with_directory("/mnt/src/target", incremental_dir.id().await?)
|
||||
.with_directory("/mnt/src/", src.id().await?);
|
||||
.with_directory("/mnt/src/target", incremental_dir)
|
||||
.with_directory("/mnt/src/", src);
|
||||
|
||||
let test = rust_with_src.with_exec(vec!["cargo", "test"]);
|
||||
|
||||
@@ -68,9 +68,7 @@ impl RustTest {
|
||||
let stderr = test.stderr().await?;
|
||||
println!("stdout: {}, stderr: {}", stdout, stderr);
|
||||
|
||||
if 0 != test.exit_code().await? {
|
||||
eyre::bail!("failed rust:test");
|
||||
}
|
||||
test.sync().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user