-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cloud workflow connectivity (#332)
- Loading branch information
Showing
9 changed files
with
99 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod emit; | ||
pub mod format; | ||
pub mod output_mode; | ||
pub mod testing; | ||
pub mod workflows; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use anyhow::Result; | ||
use marzano_core::api::MatchResult; | ||
|
||
use crate::emit::Messager; | ||
|
||
/// A testing messenger that doesn't actually send messages anywhere. | ||
/// | ||
/// This should be used in tests to avoid sending messages to real backends. | ||
pub struct TestingMessenger { | ||
message_count: usize, | ||
} | ||
|
||
impl TestingMessenger { | ||
pub fn new() -> Self { | ||
Self { message_count: 0 } | ||
} | ||
|
||
pub fn message_count(&self) -> usize { | ||
self.message_count | ||
} | ||
} | ||
|
||
impl Default for TestingMessenger { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} | ||
|
||
impl Messager for TestingMessenger { | ||
fn raw_emit(&mut self, _message: &MatchResult) -> Result<()> { | ||
self.message_count += 1; | ||
Ok(()) | ||
} | ||
} |