feat: add cockroach db
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-02-22 18:26:53 +01:00
parent b4af46aa23
commit ff6cc941d8
13 changed files with 515 additions and 106 deletions

View File

@@ -15,7 +15,6 @@ use flux_releaser::{
},
};
use tokio::{net::TcpListener, runtime::Runtime, sync::Mutex, time::sleep};
use uuid::Uuid;
struct Server {
endpoints: Endpoints,
@@ -200,4 +199,41 @@ async fn can_publish_artifact() -> anyhow::Result<()> {
Ok(())
}
#[tokio::test]
async fn can_trigger_latest_release() -> anyhow::Result<()> {
let test_id = uuid::Uuid::now_v7();
std::env::set_var("RUST_LOG", "flux_releaser=trace");
let (endpoints, app) = setup().await?;
let local_app = local_setup(endpoints.clone()).await?;
let upload_id = local_app
.flux_local_cluster_manager()
.package_clusters("testdata/flux_local_cluster")
.await?;
let archive = app.file_store().get_temp(upload_id.clone()).await?;
assert!(archive.exists());
let _ = local_app
.flux_local_cluster_manager()
.commit_artifact(test_id, "some-branch", upload_id)
.await?;
local_app
.flux_local_cluster_manager()
.trigger_release(test_id, "some-branch", "flux_local_cluster")
.await?;
// 1. Verify that release event has been sent
// 2. Verify that we've splatted the flux cluster over the upstream registry
// 3. Verify database has a release record
todo!();
Ok(())
}
pub struct TestGreeter {}