48
crates/flux-releaser/tests/publish_artifacts.rs
Normal file
48
crates/flux-releaser/tests/publish_artifacts.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
struct Server {}
|
||||
|
||||
impl Server {
|
||||
pub async fn new() -> Self {
|
||||
Self {}
|
||||
}
|
||||
|
||||
pub async fn start(&self) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
static INIT: std::sync::Once = std::sync::Once::new();
|
||||
|
||||
// Makes sure the setup is ready for execution
|
||||
async fn is_ready() -> anyhow::Result<()> {
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn setup() -> anyhow::Result<()> {
|
||||
INIT.call_once(|| {
|
||||
tokio::spawn(async move {
|
||||
println!("once was created once");
|
||||
Server::new().await.start().await.unwrap();
|
||||
});
|
||||
});
|
||||
|
||||
is_ready().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn can_create_artifact() -> anyhow::Result<()> {
|
||||
setup().await?;
|
||||
anyhow::bail!("failed one");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn can_more_create_artifact() -> anyhow::Result<()> {
|
||||
setup().await?;
|
||||
|
||||
anyhow::bail!("failed two");
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user