-
Notifications
You must be signed in to change notification settings - Fork 38
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
[#98] Clean up entrypoint CLI #366
[#98] Clean up entrypoint CLI #366
Conversation
f082455
to
a503b85
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #366 +/- ##
=======================================
Coverage 79.48% 79.48%
=======================================
Files 193 193
Lines 22716 22716
=======================================
+ Hits 18055 18056 +1
+ Misses 4661 4660 -1 |
a503b85
to
8536d97
Compare
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.
Looks good in general. Just a few remarks.
iceoryx2-cli/iox2/src/commands.rs
Outdated
if let Some(arguments) = args { | ||
command.args(arguments); | ||
#[test] | ||
fn test_paths() { |
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.
You could actually let the test work in the real environment. Take a look at iceoryx2-bb/posix/tests/file_tests.rs
. Here, I utilize the iceoryx2_bb_posix::config::test_directory()
call, which provides a platform-independent location to a directory where you can create files and directories for testing.
This would allow you to get rid of the traits and the generic parameters.
What do you think?
e3b1b25
to
67f46a2
Compare
use std::io::Write; | ||
|
||
#[cfg(windows)] | ||
const MINIMAL_EXE: &[u8] = include_bytes!("minimal.exe"); |
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.
@elfenpiff @elBoberido This is the easiest way I could test the execution on windows. Thoughts?
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.
I am fine with it - I would rename it to no-op.exe
since it is a bit more descriptive but this is not a must.
@@ -173,6 +173,34 @@ macro_rules! assert_that { | |||
} | |||
} | |||
}; | |||
($lhs:expr, contains_match |$element:ident| $predicate:expr) => { |
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.
@elfenpiff To use assert_that
I had to extend it with this. Thoughts?
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.
I like it. But a look at this file reminds me that we have to start to document this at some point ...
iceoryx2-cli/iox2/Cargo.toml
Outdated
thiserror = { workspace = true } | ||
clap = { workspace = true } | ||
human-panic = { workspace = true } | ||
cargo_metadata = { version = "0.18.1" } |
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.
Should this and tempfile
be moved to the workspace Cargo.toml
? I left them here since I doubt they will be used elsewhere.
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.
Yes. The idea is that the whole workspace has unified and compatible dependencies. Therefore, everything has to be in the workspace and is then used with workspace = true
by the individual crates of that workspace.
9e719f8
to
ff0ce66
Compare
@@ -173,6 +173,34 @@ macro_rules! assert_that { | |||
} | |||
} | |||
}; | |||
($lhs:expr, contains_match |$element:ident| $predicate:expr) => { |
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.
I like it. But a look at this file reminds me that we have to start to document this at some point ...
iceoryx2-cli/iox2/Cargo.toml
Outdated
thiserror = { workspace = true } | ||
clap = { workspace = true } | ||
human-panic = { workspace = true } | ||
cargo_metadata = { version = "0.18.1" } |
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.
Yes. The idea is that the whole workspace has unified and compatible dependencies. Therefore, everything has to be in the workspace and is then used with workspace = true
by the individual crates of that workspace.
use std::io::Write; | ||
|
||
#[cfg(windows)] | ||
const MINIMAL_EXE: &[u8] = include_bytes!("minimal.exe"); |
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.
I am fine with it - I would rename it to no-op.exe
since it is a bit more descriptive but this is not a must.
d895d19
to
c6cb7d4
Compare
3e254d8
to
89355a0
Compare
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.
Looks good. Just one question regarding a potential ambiguous constant name.
89355a0
to
e83a259
Compare
Notes for Reviewer
Refactoring of
commands.rs
:anyhow
since errors only require printing, no unique error handling--dev
flagfoo-debug
orfoo-release
)cargo_metadata
to more reliably determine the target dir to search for dev buildsPre-Review Checklist for the PR Author
SPDX-License-Identifier: Apache-2.0 OR MIT
iox2-123-introduce-posix-ipc-example
)[#123] Add posix ipc example
)Changelog updated in the unreleased section including API breaking changestask-list-completed
)Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Relates #98