mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-07-26 03:19:21 +02:00
feat: update to dagger-v0.3.13
https://github.com/dagger/dagger/releases/tag/v0.3.13
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
use std::{
|
||||
fs::canonicalize,
|
||||
path::PathBuf,
|
||||
process::Stdio,
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{fs::canonicalize, path::PathBuf, process::Stdio, sync::Arc};
|
||||
|
||||
use tokio::io::AsyncBufReadExt;
|
||||
|
||||
@@ -105,7 +100,9 @@ impl InnerCliSession {
|
||||
}
|
||||
});
|
||||
|
||||
let conn = receiver.recv().await.ok_or(eyre::anyhow!("could not receive ok signal from dagger-engine"))?;
|
||||
let conn = receiver.recv().await.ok_or(eyre::anyhow!(
|
||||
"could not receive ok signal from dagger-engine"
|
||||
))?;
|
||||
|
||||
Ok((conn, proc))
|
||||
}
|
||||
|
@@ -129,7 +129,8 @@ impl Downloader {
|
||||
|
||||
if !cli_bin_path.exists() {
|
||||
cli_bin_path = self
|
||||
.download(cli_bin_path).await
|
||||
.download(cli_bin_path)
|
||||
.await
|
||||
.context("failed to download CLI from archive")?;
|
||||
}
|
||||
|
||||
@@ -238,7 +239,11 @@ mod test {
|
||||
|
||||
#[tokio::test]
|
||||
async fn download() {
|
||||
let cli_path = Downloader::new("0.3.10".into()).unwrap().get_cli().await.unwrap();
|
||||
let cli_path = Downloader::new("0.3.10".into())
|
||||
.unwrap()
|
||||
.get_cli()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
Some("dagger-0.3.10"),
|
||||
|
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
use crate::{
|
||||
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
|
||||
};
|
||||
@@ -12,14 +10,17 @@ impl Engine {
|
||||
}
|
||||
|
||||
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
let cli = Downloader::new("0.3.12".into())?.get_cli().await?;
|
||||
let cli = Downloader::new("0.3.13".into())?.get_cli().await?;
|
||||
|
||||
let cli_session = CliSession::new();
|
||||
|
||||
Ok(cli_session.connect(cfg, &cli).await?)
|
||||
}
|
||||
|
||||
pub async fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
pub async fn start(
|
||||
&self,
|
||||
cfg: &Config,
|
||||
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
// TODO: Add from existing session as well
|
||||
self.from_cli(cfg).await
|
||||
}
|
||||
@@ -35,7 +36,10 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn engine_can_start() {
|
||||
let engine = Engine::new();
|
||||
let params = engine.start(&Config::new(None, None, None, None)).await.unwrap();
|
||||
let params = engine
|
||||
.start(&Config::new(None, None, None, None))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_ne!(
|
||||
params.0,
|
||||
|
Reference in New Issue
Block a user