-
Notifications
You must be signed in to change notification settings - Fork 129
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 catkin_lint feature. #219
Conversation
a86b458
to
d6ef730
Compare
I don't know if we want to allow_failure those failing jobs just for catkin_lint. |
c6f197f
to
fabbcef
Compare
@130s wrote:
You almost make me feel bad ;) In any case: I don't think But +1000 for 🙇 |
Great!
I would suggest to install catkin_lint only if
Nope ;)
I would place it between
We should run a test for the
The |
@@ -158,6 +158,12 @@ if [ "$BUILDER" == catkin ]; then catkin build $OPT_VI --summarize --no-status | |||
|
|||
ici_time_end # catkin_build | |||
|
|||
if [ "$CATKIN_LINT" == "true" ]; then | |||
ici_time_start catkin_lint | |||
catkin_lint --strict $CATKIN_LINT_ARGS $CATKIN_WORKSPACE/src && echo "catkin_lint passed." || error "`catkin_lint --strict` failed by either/both errors and/or warnings" |
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.
IMHO the echo ouputs are superfluous, the fold will highlight the error anyway.
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.
If you check $CATKIN_WORKSPACE/src
, the rosinstall packages will get included.
It might be better to check only "$CATKIN_WORKSPACE/src/$(basename $TARGET_REPO_PATH)"
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.
Or simply "$TARGET_REPO_PATH"
.
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.
the echo ouputs are superfluous, the fold will highlight the error anyway.
echo
is called only upon success, so no problem?
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.
It's is harder to read / maintain and the ouput does not add any information
So I would remove it, but I leave the decision to you.
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 found the output of catkin_lint
is often not clearly telling me if it passed or not, e.g. with the following that includes a line from my commit (catkin_lint passed.
), if you're not that used to the tool then it could be hard to tell without my commit. With folded in green-color, most of the cases you might not even have to unfold the section, but I'd still prefer to being explicit.
https://travis-ci.org/ros-industrial/industrial_ci/jobs/289293486
catkin_lint: checked 1 packages and found 1 problems
catkin_lint: 1 notices have been ignored. Use -W2 to see them
catkin_lint passed.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function catkin_lint returned with code '0' after 0 min 3 sec
It's harder to read / maintain
How so?
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 found the output of catkin_lint is often not clearly telling me if it passed or not
The state if encoded in "Function catkin_lint returned with code '0' after 0 min 3 sec" and the color.
It's harder to read / maintain
How so?
catkin_lint --strict $CATKIN_LINT_ARGS $CATKIN_WORKSPACE/src && echo "catkin_lint passed." || error "catkin_lint --strict failed by either/both errors and/or warnings"
(Beware: do not use the backticks in the string, it is the same as $()
!)
vs.
catkin_lint --strict $CATKIN_LINT_ARGS $CATKIN_WORKSPACE/src
An enhancement mentioned in ros-industrial#98 Some considerations: - By default `catkin_lint` is run with `--strict` option, which makes the job fail even when there's only warning returned by catkin_lint. I'm not sure if we want to allow disabling --strict option on CI (those who just want the result without failing the CI job can run catkin_lint locally IMO). - `catkin_lint` runs between build-install and tests, which I'm not sure is the best location.
Thanks @ipa-mdl @gavanderhoorn for the feedback, all of which should be now addressed. |
@@ -149,6 +149,13 @@ set +o pipefail | |||
|
|||
ici_time_end # rosdep_install | |||
|
|||
if [ "$CATKIN_LINT" == "true" ]; then | |||
ici_time_start catkin_lint | |||
sudo apt-get install -qq -y python-catkin-lint || error |
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.
|| error
is not needed, the script will fail on all errors.
Please use the pip version for compatibility with Debian.
if [ "$CATKIN_LINT" == "true" ]; then | ||
ici_time_start catkin_lint | ||
sudo apt-get install -qq -y python-catkin-lint || error | ||
catkin_lint --explain $CATKIN_LINT_ARGS $TARGET_REPO_PATH && echo "catkin_lint passed." || error "`catkin_lint --strict` failed by either/both errors and/or warnings" |
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.
error message still contains --strict
;)
.travis.yml
Outdated
@@ -56,7 +56,7 @@ env: | |||
- ROS_DISTRO=kinetic OS_NAME=debian OS_CODE_NAME=xenial EXPECT_EXIT_CODE=1 | |||
- ROS_DISTRO=kinetic DOCKER_BASE_IMAGE="ros:kinetic-ros-base" NOT_TEST_BUILD='true' DEBUG_BASH='true' VERBOSE_OUTPUT='false' | |||
- ROS_DISTRO=kinetic APTKEY_STORE_SKS=hkp://ha.pool.sks-keyservers.vet # Passing wrong SKS URL as a break test. Should still pass. | |||
- ROS_DISTRO=lunar ROS_REPO=ros-shadow-fixed USE_MOCKUP='industrial_ci/mockups/industrial_ci_testpkg' | |||
- ROS_DISTRO=lunar ROS_REPO=ros-shadow-fixed USE_MOCKUP='industrial_ci/mockups/industrial_ci_testpkg' CATKIN_LINT=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.
industrial_ci_testpkg
should get patched to issue a warning, so we can add a supposed-to-fail test using the `--strict' flag.
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.
Do you mean we should use something else, not industrial_ci_testpkg
for checking catkin_lint feature? If so do you have a suggestion?
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.
Do you mean we should use something else, not industrial_ci_testpkg for checking catkin_lint feature? If so do you have a suggestion?
No, that's fine.
But I want to add another teststhat fails on purpose to see that catkin_lint
was actually run for the given situation.
@@ -149,6 +149,14 @@ set +o pipefail | |||
|
|||
ici_time_end # rosdep_install | |||
|
|||
if [ "$CATKIN_LINT" == "true" ]; then | |||
ici_time_start catkin_lint | |||
sudo apt-get install -qq -y python-pip |
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.
python-pip
should already be installed in our images.
I am undecided if we want to enforce it here again.
sudo apt-get install -qq -y python-catkin-lint || error | ||
catkin_lint --explain $CATKIN_LINT_ARGS $TARGET_REPO_PATH && echo "catkin_lint passed." || error "`catkin_lint --strict` failed by either/both errors and/or warnings" | ||
sudo apt-get install -qq -y python-pip | ||
sudo pip install python-catkin-lint |
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.
sudo pip install catkin_lint
What do you think of |
…ness. Small fixes.
@ipa-mdl All your comments and suggestions should be addressed. Please review again. |
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 great!
I have modified the pedantic test to expect to fail.
However, I did not want to sacrify our only lunar test, so I have duplicated the other.
If the the job passes, just go ahead to squash and/or merge :)
+1 |
An enhancement mentioned in #98
Some considerations:
catkin_lint
in this PR is run with--strict
option, which makes the job fail even when there's only warning returned by catkin_lint. I'm not sure if we want to allow disabling --strict option on CI (those who just want the result without failing the CI job can run catkin_lint locally IMO).catkin_lint
runs between build-install and tests, which I'm not sure is the best location.