Skip to content

Commit

Permalink
First pass at integration tests
Browse files Browse the repository at this point in the history
Some rough edges still exist:

- Issues with running tests in parallel on GH Actions
- Over reliance on magic delays rather than waiting on a condition
- Are the assertions for segment archiving robust enough?
  • Loading branch information
DanNixon committed Dec 8, 2023
1 parent e71b2b3 commit f3d960f
Show file tree
Hide file tree
Showing 20 changed files with 1,307 additions and 59 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ jobs:
- name: Clippy
run: nix develop --command cargo clippy --all-targets -- -D warnings

- name: Test
- name: Tests
run: nix develop --command cargo test

- name: Integration tests
run: nix develop --command cargo test integration_tests -- --ignored --test-threads=1

build:
name: Build
needs:
Expand Down
148 changes: 148 additions & 0 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ members = [
"archiver",
"ctl",
"event-processor",

"integration-tests",
]

[workspace.package]
Expand All @@ -31,6 +33,7 @@ crossterm = "0.27"
futures = "0.3.25"
hex = "0.4.3"
hpke = { version = "0.11.0", features = ["std", "serde_impls"] }
indoc = "2.0.4"
lazy_static = "1.4.0"
m3u8-rs = "5.0.3"
mqtt-channel-client = { version = "0.6.0", features = ["metrics"] }
Expand All @@ -42,6 +45,7 @@ ratatui = { version = "0.23.0", features = ["all-widgets"]}
rayon = "1.7.0"
regex = "1.7.1"
reqwest = "0.11.13"
rumqttc = "0.23.0"
rust-s3 = "0.34.0-rc4"
satori-common = { path = "./common" }
satori-storage = { path = "./storage" }
Expand All @@ -51,7 +55,7 @@ serde_with = "3.0"
serde_json = "1.0.91"
tempfile = "3.3.0"
thiserror = "1.0.38"
tokio = { version = "1.26", features = ["macros", "rt-multi-thread", "signal"] }
tokio = { version = "1.26", features = ["macros", "rt-multi-thread", "signal", "process"] }
toml = "0.8"
tower-http = { version = "0.5.0", features = ["fs"] }
tracing = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ satori-common.workspace = true
serde.workspace = true
serde_with.workspace = true
tempfile.workspace = true
tokio = { workspace = true, features = ["process"] }
tokio.workspace = true
tower-http.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
Expand Down
1 change: 1 addition & 0 deletions event-processor/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub(crate) struct Config {
#[derive(Debug, Deserialize)]
pub(crate) struct TriggersConfig {
/// Trigger configs that are used when a trigger with a specific ID are issued
#[serde(default)]
pub(crate) templates: HashMap<String, TriggerTemplate>,

/// Trigger defaults that are used when no matching template is found
Expand Down
15 changes: 15 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "satori-integration-tests"
license.workspace = true
version.workspace = true
edition.workspace = true

[dev-dependencies]
ctor.workspace = true
indoc.workspace = true
rumqttc.workspace = true
satori-testing-utils.workspace = true
tempfile.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
10 changes: 10 additions & 0 deletions integration-tests/src/integration_tests/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[ctor::ctor]
fn init() {
tracing_subscriber::fmt()
.with_test_writer()
.with_max_level(tracing::Level::DEBUG)
.init();
}

mod one;
mod two;
Loading

0 comments on commit f3d960f

Please sign in to comment.