Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: watch mode for patterns test #298

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
94 changes: 94 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ flate2 = { version = "1.0.17", features = [
"rust_backend",
], default-features = false }
axoupdater = { version = "0.6.4", default-features = false, features = [
"github_releases"
"github_releases",
] }

opentelemetry-otlp = { version = "0.14.0", optional = true, features = [
Expand All @@ -73,6 +73,8 @@ opentelemetry_sdk = { version = "0.21.1", optional = true, features = [
tracing-opentelemetry = { version = "0.22.0", optional = true, default-features = false }

tracing = { version = "0.1.40", default-features = false, features = [] }
notify = "6.1.1"
notify-debouncer-mini = "0.4.1"
tracing-subscriber = { version = "0.3", default-features = false, optional = true }

[target.'cfg(not(windows))'.dependencies]
Expand Down Expand Up @@ -106,12 +108,8 @@ workflows_v2 = []
bundled_workflows = []
remote_redis = []
remote_pubsub = []
remote_workflows = [
"dep:grit_cloud_client",
]
workflow_server = [
"dep:grit_cloud_client",
]
remote_workflows = ["dep:grit_cloud_client"]
workflow_server = ["dep:grit_cloud_client"]
server = [
"workflows_v2",
"external_functions",
Expand All @@ -120,7 +118,7 @@ server = [
"remote_pubsub",
"ai_builtins",
"dep:cli_server",
"grit_tracing"
"grit_tracing",
]
updater = []
grit_tracing = [
Expand Down Expand Up @@ -149,7 +147,7 @@ grit_beta = [
"ai_builtins",
"workflows_v2",
"remote_workflows",
"workflow_server"
"workflow_server",
# "grit_timing",
]
grit_timing = []
2 changes: 1 addition & 1 deletion crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ async fn run_command() -> Result<()> {
Commands::Parse(arg) => run_parse(arg, app.format_flags, None).await,
Commands::Patterns(arg) => match arg.patterns_commands {
PatternCommands::List(arg) => run_patterns_list(arg, app.format_flags).await,
PatternCommands::Test(arg) => run_patterns_test(arg, app.format_flags).await,
PatternCommands::Test(arg) => run_patterns_test(arg, app.format_flags, None).await,
PatternCommands::Edit(arg) => run_patterns_edit(arg).await,
PatternCommands::Describe(arg) => run_patterns_describe(arg).await,
},
Expand Down
5 changes: 4 additions & 1 deletion crates/cli/src/commands/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub enum PatternCommands {
Describe(PatternsDescribeArgs),
}

#[derive(Args, Debug, Serialize)]
#[derive(Args, Debug, Serialize, Clone)]
pub struct PatternsTestArgs {
/// Regex of a specific pattern to test
#[clap(long = "filter")]
Expand All @@ -53,6 +53,9 @@ pub struct PatternsTestArgs {
/// Update expected test outputs
#[clap(long = "update")]
pub update: bool,
/// Enable watch mode on .grit dir
#[clap(long = "watch")]
pub watch: bool,
}

#[derive(Args, Debug, Serialize)]
Expand Down