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

[ci] [R-package] R CI jobs on mac, linux do not always fail if unit tests fail #3616

Closed
jameslamb opened this issue Dec 1, 2020 · 1 comment · Fixed by #3630
Closed

[ci] [R-package] R CI jobs on mac, linux do not always fail if unit tests fail #3616

jameslamb opened this issue Dec 1, 2020 · 1 comment · Fixed by #3630

Comments

@jameslamb
Copy link
Collaborator

Look at this build from #3598 : https://github.com/microsoft/LightGBM/pull/3598/checks?check_run_id=1477128773. It was marked successful in GitHub Actions, even though a unit test is failing.

image

Status: 1 ERROR

Similar jobs on Mac have the same test error, but are marked as failures by GitHub Actions. For example, https://github.com/microsoft/LightGBM/pull/3598/checks?check_run_id=1477128812.

image

It looks like the ones that failed only failed because they also had NOTEs.

So I think that the current R CI scripts aren't correctly accounting for the possibility of an R CMD check run that yields ERRORs but no NOTEs or WARNINGs. R CMD check should yield a non-0 exit code on ERRORs.

Windows jobs all correctly fail under these conditions, with a message like this

ERRORs have been found by R CMD check!

How to Fix This

Something in this code is not correctly capturing ERRORs on Mac and Linux:

# fails tests if either ERRORs or WARNINGs are thrown by
# R CMD CHECK
check_succeeded="yes"
(
R CMD check ${PKG_TARBALL} \
--as-cran \
--run-donttest \
|| check_succeeded="no"
.

You can add a stop("hello") in any of the R unit tests in R-package/tests/testthat to simulate the situation where R CMD check results in Status: 1 ERROR, and then try to fix that script. It might be the case that the trickery with putting R CMD check into the background and polling (to avoid timeouts) results in some mistakes, and the solution could be to just grep for ERROR in the output of R CMD check, just like we do for WARNING:

if grep -q -R "WARNING" "$LOG_FILE_NAME"; then
echo "WARNINGS have been found by R CMD check!"
exit -1
fi

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant