-
Notifications
You must be signed in to change notification settings - Fork 92
[#709] Add initial set of end to end tests for CLI #1058
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
base: main
Are you sure you want to change the base?
[#709] Add initial set of end to end tests for CLI #1058
Conversation
3275499 to
9c49322
Compare
9c49322 to
5a5dbc7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1058 +/- ##
==========================================
- Coverage 78.53% 78.52% -0.02%
==========================================
Files 342 342
Lines 36845 36845
Branches 271 271
==========================================
- Hits 28937 28932 -5
- Misses 7331 7336 +5
Partials 577 577
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Not sure if this is the best place to put this common script now that it is used outside of the examples directory ... accepting ideas.
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.
We also did not like it when we created it but we had no better idea where to place it. Suggestions welcome.
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 Thoughts on creating this top-level iceoryx2-testing directory for utility scripts like this? I was also thinking to move the types used in examples to here too so they can be re-used in tests (e.g. the ComplexData type, which I am currently duplicating in the iceoryx2-tunnel test.
iceoryx2-bb-testing did not seem like the right place for these to me. The nesting in iceoryx2-bb does not seem fitting.
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.
@orecham in theory, this could as well go into internal/something. It is currently only meant to be used in the repo
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.
@elBoberido I moved the script to internal/end-to-end-testing/.
25cb855 to
f0ad188
Compare
| /// All configurable settings of a [`Service`](crate::service::Service). | ||
| #[non_exhaustive] | ||
| #[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] | ||
| #[serde(rename_all = "kebab-case")] |
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.
@elBoberido FYI I would like to remove this from our structs because it causes the RON output to prepend #r before every field (since it is not valid Rust syntax):
global: (
r#root-path: "/tmp/iceoryx2/",
prefix: "iox2_",
service: (
directory: "services",
r#data-segment-suffix: ".data",
r#static-config-storage-suffix: ".service",
r#dynamic-config-storage-suffix: ".dynamic",
r#creation-timeout: (
secs: 0,
nanos: 500000000,
),
r#connection-suffix: ".connection",
r#event-connection-suffix: ".event",
r#blackboard-mgmt-suffix: ".blackboard_mgmt",
r#blackboard-data-suffix: ".blackboard_data",
),
node: (
directory: "nodes",
r#monitor-suffix: ".node_monitor",
r#static-config-suffix: ".details",
r#service-tag-suffix: ".service_tag",
r#cleanup-dead-nodes-on-creation: true,
r#cleanup-dead-nodes-on-destruction: true,
),
)
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 wouldn't do that. It would completely break every config setup out there.
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.
@elBoberido Hmm, if we ever want to change it, now (before v1.0.0) would be the time. Otherwise we need to live with this not-so-nice output from the default formater, which is currently ron.
We could of course change the default format to something else... although ron seems the most appropriate, given we the core is Rust.
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.
Isn't this just for testing? Shouldn't the default formatter be TOML, which is also used for the config files
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.
@elBoberido Not everything output by the CLI is a config. The format can be selected by the user using the --format option - the motivation here is that users can choose what they prefer and if they are parsing the output programatically specify the output (e.g. if they decide they prefer to parse it as JSON). For instance they might want to parse the output of iox2 service subscribe from a script or other application.
The default format was chosen kind of arbitrarily, but the train of thought was to use ron since it is a Rust project and besides the r# it seemed to be the most human-readable (other output formats deal withValueEnums kind of strangely), but only Ron has this not-so-nice-to-read r# before strings.
Moving forward, we either:
- Leave it as is and just live with the
r#being prepended forron - Change the default formatting to something else (although users will still be able to choose something else)
- Remove the
kebab-casemodification to the output
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.
Unfortunately, we did not version the config files. If this would be the case, we would be able to read the version and the print a warning to use iox2 config check --fix. We cold of course start with the versioning now, and if no version info is present, print the warning.
We will most probably also break the C++ API with the new Optional, so we might as well declare the v0.8.0 as broken records release 😬
@elfenpiff what is your opinion?
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 Ping
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 side with @orecham on this one but I have no strong feelings. But this would have to be prepared a bit more in the release notes. We have to state search - and replace it with _
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.
What about the idea of implementing a cli command to check and fix the config to make it easier for users to update their configs.
Something like iox2 config check and iox2 config fix.
It might take some time to actually get to this though. Not so sure it will be trivial to do it well.
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.
Also no strong feeling about this. We will introduce breakages with the new C++ Optional so it might be a good idea to use the next release for other breaking changes as well.
0c478be to
4be0217
Compare
4be0217 to
bfd08d6
Compare
…rvice discovery info
…from iceoryx2-testing
bfd08d6 to
68719b5
Compare
Notes for Reviewer
Adds initial set of end-to-end tests for
iceoryx2-cli.Not all CLI functionality is covered, just the most straight-forward. Provides the foundation for adding more complex test cases in follow-ups.
Additionally:
iox2-tunneliox2 service discoveryiox2 config generatePre-Review Checklist for the PR Author
Convert to draft)SPDX-License-Identifier: Apache-2.0 OR MITiox2-123-introduce-posix-ipc-example)[#123] Add posix ipc example)task-list-completed)Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #709