-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#112] FileSystem, Command 모킹 구현 및 executor 테스트 환경 작성 #113
Conversation
Pull reviewers statsStats of the last 14 days for rrdb:
|
✅ Total Coverage: 38.14% |
✅ Total Coverage: 39.40% |
|
||
pub struct Executor { | ||
pub(crate) config: Arc<GlobalConfig>, | ||
pub(crate) file_system: Arc<dyn FileSystem + Send + Sync>, | ||
pub(crate) command_runner: Arc<dyn CommandRunner + Send + Sync>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
유연한 테스트를 위한 모킹 인터페이스 추가
|
||
#[cfg(target_os = "linux")] | ||
#[tokio::test] | ||
async fn test_init_config() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트코드
@@ -32,7 +32,8 @@ async fn main() -> Result<(), RRDBError> { | |||
|
|||
let executor = Executor::new(Arc::new(config)); | |||
|
|||
executor.init().await?; | |||
executor.init_config().await?; | |||
executor.init_database().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
쿼리랑 초기화가 좀 섞여있으니까 어지러워서 분리함
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이니셜라이저와 query executor를 분리해서 관리해야하나 하는 생각도...
✅ Total Coverage: 39.40% |
|
||
#[cfg(target_os = "linux")] | ||
pub const SYSTEMD_DAEMON_SCRIPT: &str = r#"[Unit] | ||
Description=RRDB | ||
|
||
[Service] | ||
Type=simple | ||
Restart=on-failure | ||
ExecStart=/usr/bin/rrdb run | ||
RemainAfterExit=on | ||
User=root | ||
StandardOutput=file:/var/log/rrdb.stdout.log | ||
StandardError=file:/var/log/rrdb.stderr.log | ||
|
||
[Install] | ||
WantedBy=multi-user.target"#; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macos도 비슷한 pub const 상수 만드는게 좋을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나쁘지 않죠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿뜨
resolves: #112
설명
executor 수준의 단위테스트 작성을 위한 모킹 구조 추가