Skip to content
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

Ensure that cobra is executed during tests (#103). #120

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

xfiderek
Copy link
Contributor

@xfiderek xfiderek commented Jan 13, 2024

Summary

This PR fixes #103.

Space ROS's main Earthfile's build-testing procedure is invoked in CI to push results of tests and static code analysis. Currently, for all packages cobra-autosar.sarif results are empty. This is because cobra or some dependent executables are not found when colcon test command is invoked.

This PR prefixes the call to colcon test in the Earthfile by a call to source that brings all the necessary tools and dependencies into scope.

Note that re-enabling cobra significantly extends build-testing time from 1hr 13 minutes to 1hr 55 minutes on my local machine 1.

Check the files before and after for comparison:

Future work

The results on SARIF dashboard are empty anyway, despite the fix. The reason is that level and kind fields in results have value "unknown" 2. It can be an issue either with process_sarif package or with ament_cobra package. I will investigate that further and raise consecutive issues.

Footnotes

  1. Time compared using time earthly --no-cache +build-testing command

  2. Visualizing the results from build folder works, however cobra-autosar file from processed folder shows no results on dashboard. After changing level and kind fields in processed files, violated rules are displayed on dashboard as expected.

@xfiderek xfiderek changed the title Fix cobra empty results by making sure that packages are sourced before tests (#103). Fix empty cobra results by making sure that packages are sourced before tests (#103). Jan 13, 2024
@ivanperez-keera ivanperez-keera self-requested a review January 13, 2024 21:58
@ivanperez-keera
Copy link
Contributor

Can you modify the commit message to something like the following?

Ensure that cobra is executed during tests (#103).

Space ROS's main Earthfile's build-testing procedure is invoked in CI to push
results of tests and static code analysis. Currently, for all packages
cobra-autosar.sarif results are empty. This is because cobra or some dependent
executables are not found when colcon test command is invoked.

This commit prefixes the call to colcon test in the Earthfile by a call to
source that brings all the necessary tools and dependencies into scope.

@xfiderek xfiderek changed the title Fix empty cobra results by making sure that packages are sourced before tests (#103). Ensure that cobra is executed during tests (space-ros#103). Jan 16, 2024
@xfiderek xfiderek changed the title Ensure that cobra is executed during tests (space-ros#103). Ensure that cobra is executed during tests (#103). Jan 16, 2024
@xfiderek
Copy link
Contributor Author

Done

@ivanperez-keera
Copy link
Contributor

@xfiderek I know it built already but I'll wait for everything to build successfully before I merge.

@ivanperez-keera
Copy link
Contributor

I just rebased this and I plan to merge today.

Space ROS's main Earthfile's build-testing procedure is invoked in CI to push
results of tests and static code analysis. Currently, for all packages
cobra-autosar.sarif results are empty. This is because cobra or some dependent
executables are not found when colcon test command is invoked.

This commit prefixes the call to colcon test in the Earthfile by a call to
source that brings all the necessary tools and dependencies into scope.
@ivanperez-keera
Copy link
Contributor

There was an extra empty line at the end. I removed it and push-forced. Per our process, I'll wait for the build again.

@@ -179,3 +179,4 @@ image:
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
SAVE IMAGE --push osrf/space-ros:latest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove this line? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed that comment

@ivanperez-keera ivanperez-keera merged commit 297fedf into space-ros:main Jan 22, 2024
3 checks passed
@Bckempa Bckempa added this to the humble-2024.01.0 milestone Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cobra analysis results are empty for all packages
3 participants