Skip to content

Commit

Permalink
Merge 9faebb8 into c6716ed
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed May 11, 2022
2 parents c6716ed + 9faebb8 commit 8fc22d0
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 10 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/connectors/impls/stdio.rs
Expand Up @@ -112,7 +112,7 @@ impl Source for StdStreamSource {
}

fn asynchronous(&self) -> bool {
true
false
}
}

Expand Down
2 changes: 1 addition & 1 deletion tremor-cli/Cargo.toml
Expand Up @@ -18,6 +18,7 @@ criterion = "0.3"
float-cmp = "0.9"
matches = "0.1"
pretty_assertions = "1.2.0"
tempfile = { version = "3.2" }

[dependencies]
anyhow = "1"
Expand Down Expand Up @@ -69,7 +70,6 @@ termcolor = "1.1"
[[bin]]
name = "tremor"
path = "src/main.rs"
test = false

[features]
#
Expand Down
32 changes: 27 additions & 5 deletions tremor-cli/src/run.rs
Expand Up @@ -25,7 +25,7 @@ use tremor_runtime::{
config,
postprocessor::Postprocessor,
preprocessor::Preprocessor,
system::{ShutdownMode, World, WorldConfig},
system::{World, WorldConfig},
};
use tremor_script::{
arena::Arena,
Expand Down Expand Up @@ -425,11 +425,9 @@ impl Run {
debug_connectors: true,
..WorldConfig::default()
};
let (world, _handle) = World::start(config).await?;
let (world, handle) = World::start(config).await?;
tremor_runtime::load_troy_file(&world, &self.script).await?;
async_std::task::sleep(std::time::Duration::from_millis(150_000)).await;
world.stop(ShutdownMode::Graceful).await?;

handle.await?;
Ok(())
}

Expand All @@ -444,3 +442,27 @@ impl Run {
}
}
}

#[cfg(test)]
mod test {
use async_std::prelude::FutureExt;
use std::time::Duration;

use super::*;
#[async_std::test]
async fn run_troy_source() -> Result<()> {
let r = Run {
script: "tests/fixtures/exit.troy".into(),
interactive: false,
pretty: false,
encoder: "json".into(),
decoder: "json".into(),
infile: "-".into(),
outfile: "-".into(),
preprocessor: String::new(),
postprocessor: String::new(),
port: None,
};
r.run().timeout(Duration::from_secs(1)).await?
}
}
19 changes: 19 additions & 0 deletions tremor-cli/tests/fixtures/exit.troy
@@ -0,0 +1,19 @@
define flow exit
flow
define pipeline p
pipeline
select event from in into out;
end;
define connector e from exit;
define connector m from metronome
with
config = {"interval": 1}
end;
create connector e;
create connector m;
create pipeline p;
connect /connector/m to /pipeline/p;
connect /pipeline/p to /connector/e;
end;
deploy flow exit;

1 change: 0 additions & 1 deletion tremor-cli/tests/fixtures/resolve_tags/a/b/c/tags.json

This file was deleted.

1 change: 1 addition & 0 deletions tremor-cli/tests/fixtures/resolve_tags/a/b/c/tags.yaml
@@ -0,0 +1 @@
- c
1 change: 0 additions & 1 deletion tremor-cli/tests/fixtures/resolve_tags/a/b/tags.json

This file was deleted.

1 change: 1 addition & 0 deletions tremor-cli/tests/fixtures/resolve_tags/a/b/tags.yaml
@@ -0,0 +1 @@
- b
1 change: 0 additions & 1 deletion tremor-cli/tests/fixtures/resolve_tags/a/tags.json

This file was deleted.

1 change: 1 addition & 0 deletions tremor-cli/tests/fixtures/resolve_tags/a/tags.yaml
@@ -0,0 +1 @@
- a

0 comments on commit 8fc22d0

Please sign in to comment.