diff --git a/backend/CLAUDE.md b/backend/CLAUDE.md index dcc993b6c5..edfeb5207d 100644 --- a/backend/CLAUDE.md +++ b/backend/CLAUDE.md @@ -49,6 +49,10 @@ Windmill uses a workspace-based architecture with multiple crates: - Use feature flags: `#[cfg(feature = "enterprise")]` - Isolate enterprise code in separate modules +## Git Workflow + +- **Never push directly to main** — always create a branch and open a pull request + ## Testing - Write unit tests for core functionality diff --git a/backend/tests/dependency_map.rs b/backend/tests/dependency_map.rs index 9113e8f165..bb9510c688 100644 --- a/backend/tests/dependency_map.rs +++ b/backend/tests/dependency_map.rs @@ -2,7 +2,9 @@ use sqlx::{Pool, Postgres}; use tokio_stream::StreamExt; use windmill_api_client::types::NewScript; -use windmill_test_utils::{in_test_worker, init_client, listen_for_completed_jobs, ApiServer}; +use windmill_test_utils::{ + in_test_worker, init_client, listen_for_completed_jobs, rebuild_dmap, ApiServer, +}; mod dependency_map { use super::*; @@ -169,7 +171,7 @@ mod dependency_map { let (client, _port, _s) = init(db.clone()).await; assert_dmap(&db, None, CORRECT_DMAP.clone()).await; // rebuild map - assert!(common::rebuild_dmap(&client).await); + assert!(rebuild_dmap(&client).await); assert_dmap(&db, None, CORRECT_DMAP.clone()).await; Ok(()) } @@ -182,7 +184,7 @@ mod dependency_map { // Spawn first rebuild let handle = { let client = client.clone(); - tokio::spawn(async move { common::rebuild_dmap(&client).await }) + tokio::spawn(async move { rebuild_dmap(&client).await }) }; // Immidiately spawn another diff --git a/backend/windmill-api-integration-tests/Cargo.toml b/backend/windmill-api-integration-tests/Cargo.toml index 4d5759335f..1936a13fd9 100644 --- a/backend/windmill-api-integration-tests/Cargo.toml +++ b/backend/windmill-api-integration-tests/Cargo.toml @@ -12,6 +12,8 @@ path = "src/lib.rs" default = [] private = ["windmill-test-utils/private", "dep:aws-config", "dep:aws-credential-types", "dep:aws-sdk-sqs"] enterprise = ["windmill-test-utils/enterprise", "dep:base64"] +deno_core = ["windmill-test-utils/deno_core"] +mcp = [] [dependencies] windmill-test-utils.workspace = true diff --git a/backend/windmill-api-integration-tests/tests/permissions.rs b/backend/windmill-api-integration-tests/tests/permissions.rs index 329ed5e11d..4342c61235 100644 --- a/backend/windmill-api-integration-tests/tests/permissions.rs +++ b/backend/windmill-api-integration-tests/tests/permissions.rs @@ -1,9 +1,13 @@ +#[cfg(feature = "deno_core")] use serde_json::json; +#[cfg(feature = "deno_core")] use sqlx::{Pool, Postgres}; +#[cfg(feature = "deno_core")] use windmill_test_utils::*; /// Helper to create a client authenticated as a specific user +#[cfg(feature = "deno_core")] async fn create_client_for_user(_port: u16, token: &str) -> reqwest::Client { let mut headers = reqwest::header::HeaderMap::new(); headers.insert( @@ -17,12 +21,14 @@ async fn create_client_for_user(_port: u16, token: &str) -> reqwest::Client { } /// Test helper to check if a GET request succeeds +#[cfg(feature = "deno_core")] async fn can_read(client: &reqwest::Client, url: &str) -> bool { let resp = client.get(url).send().await.unwrap(); resp.status().is_success() } /// Test helper to check if a POST request succeeds (for write operations) +#[cfg(feature = "deno_core")] async fn can_write(client: &reqwest::Client, url: &str, body: serde_json::Value) -> bool { let resp = client.post(url).json(&body).send().await.unwrap(); let status = resp.status();