This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move issues to actual tests and refactor
- Loading branch information
Showing
6 changed files
with
66 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use dagger_sdk::{ | ||
ContainerBuildOptsBuilder, HostDirectoryOpts, QueryContainerOpts, QueryContainerOptsBuilder, | ||
}; | ||
|
||
static PLATFORMS: [&str; 2] = ["linux/arm64", "linux/x86_64"]; | ||
|
||
#[tokio::test] | ||
async fn test_issue_30_alt() -> eyre::Result<()> { | ||
let client = dagger_sdk::connect().await?; | ||
|
||
let context = client.host().directory_opts( | ||
".", | ||
HostDirectoryOpts { | ||
exclude: Some(vec!["target", "client/node_modules", "client/build"]), | ||
include: None, | ||
}, | ||
); | ||
|
||
for platform in PLATFORMS { | ||
let ref_ = client | ||
.container_opts(QueryContainerOpts { | ||
id: None, | ||
platform: Some(platform.to_string().into()), | ||
}) | ||
.from("alpine") | ||
.export("./test") | ||
.await?; | ||
|
||
println!("published image to: {:#?}", ref_); | ||
} | ||
|
||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_issue_30() -> eyre::Result<()> { | ||
let client = dagger_sdk::connect().await?; | ||
|
||
let context = client.host().directory_opts( | ||
".", | ||
HostDirectoryOpts { | ||
exclude: Some(vec!["target", "client/node_modules", "client/build"]), | ||
include: None, | ||
}, | ||
); | ||
|
||
for platform in PLATFORMS { | ||
let ref_ = client | ||
.container_opts( | ||
QueryContainerOptsBuilder::default() | ||
.platform(platform) | ||
.build() | ||
.unwrap(), | ||
) | ||
.from("alpine") | ||
.export("./test") | ||
.await?; | ||
|
||
println!("published image to: {:#?}", ref_); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod iss_30; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod issues; | ||
|
||
use dagger_sdk::{connect, ContainerExecOptsBuilder}; | ||
use pretty_assertions::assert_eq; | ||
|
||
|