-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add tests and workflow for package build / testing #22
Add tests and workflow for package build / testing #22
Conversation
If no activity happens on the upstream |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
d8f8a26
to
466f910
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
=======================================
Coverage ? 62.20%
=======================================
Files ? 8
Lines ? 381
Branches ? 62
=======================================
Hits ? 237
Misses ? 136
Partials ? 8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
As mentioned in #22 (comment) I proceeded to copy the action here in 0abad0d, we can revisit that if some feedback comes from the upstream reusable workflow maintainers It seems PR to merge the changes back to main and make sure this package works on Windows in ros2-rust/cargo-ament-build#8. Once the |
test/rust-sample-package/Cargo.toml
Outdated
[package] | ||
name = "rust-sample-package" | ||
version = "0.1.0" | ||
authors = ["Nikos Koukis <nickkouk@gmail.com>"] |
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.
Just curious, whose name is this and how did it land here? I feel hesitant to use the name of someone who's not involved in the project.
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 copied the package from colcon-cargo
hence kept the original attribution.
It is true that at the end of the day it's just an empty template where the only code contribution was made by me though (adding code that passes / fails test)
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 see, it's an interesting dilemma. On one hand, I wouldn't want to use someone's contact info without their explicit consent. On the other hand, it could be interpreted as an act of attribution, as you're saying.
Since we're using the same code in the same way that the original author intended it, just in a different (but strongly related) package, I suppose I don't object to keeping it as-is. But if anyone has a different perspective, I'd appreciate hearing it.
I'll tag @bergercookie and maybe if he sees the notification, he can give a 👍/👎 on the usage.
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.
Since this sample package is not meant to be published as is, I'd change the author and email to something non-specific (Test McTestface notareal@email.address) to avoid attribution, but also prevent @bergercookie getting spammed. I'd do the same for package.xml
.
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.
This reverts commit 566e6f9. Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
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.
LGTM
# missing_ok flag was introduced in Python 3.8, older versions | ||
# raise a FileNotFoundError exception | ||
if sys.version_info.minor >= 8: | ||
cargo_config_toml_out.unlink(missing_ok=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.
So we delete the previous config.toml
if it exists?
Nit: Perhaps unnecessary for folks who spend a lot of time in python, but I would suggest wrapping this in a small free function with a clear name.
def _delete_file(f)
or something similar.
Also, we should probably explain why we pass on the exception
# No work for us to do, the file already doesn't exist
or something like that.
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.
After looking at this further I feel the step might not be necessary, unless there is some extreme corner case, opening a file as w
by default already deletes its whole content and replaces it, so I removed the whole block in 0612fda
The only case in which this would behave differently (I believe) is if users created a .cargo/config.toml
that was a symlink to their own file, then ran a colcon build
, previously the link would be deleted and a new config file would be created, now the symlink would be followed and edited.
I'd argue that it is such a corner case that I don't even know what the intended behavior would be
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Based of #19, I can merge it there to have a single PR with functionality and tests or keep it separate and retarget
main
once #19 is merged.Note that CI will be red until the upstream colcon/colcon-cargo#39 is merged, since this PR adds a test for
colcon test
, which is not implemented right now.Furthermore, it currently uses a proposed strategy for injecting setup commands into the colcon reusable workflow in colcon/ci#33. If the PR is merged we should revert to main, if other strategies are proposed we should adopt them before merging this in.