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

updating make test-math-dependencies; fixing warnings #1107

Merged
merged 18 commits into from
Feb 2, 2019

Conversation

syclik
Copy link
Member

@syclik syclik commented Jan 23, 2019

Summary

This PR does 3 things.

  1. It fixes the math dependencies errors that are currently in develop. These errors are in stan/math/prim/scal/meta/StdVectorBuilder.hpp where it pulls an arr header into scal. This was fixed by splitting the template metaprogram's base class into prim (and adding a test for that).
  2. Updating the make test-math-dependencies so that it:
    1. returns a non-zero exit code if there are warnings
    2. ignores references to std::vector and Eigen::Matrix within comments.
  3. Updates the Jenkinsfile so that it uses the new warnings next generation plugin for parsing some of the warnings. The parser for math-dependencies is still using the old warnings plugin (that's been deprecated) because the mechanism for adding groovy scripts to parse is no longer supported except through the web interface. I figured it's just as well that we leave it as-is.

Tests

The code for contains_std_vector.hpp has been tested with a new unit test in prim. It just makes sure the base case is correct.

For the makefile, I've been running it by hand. When there are no errors, it exits with code 0, if there are errors, it exits with a non-zero return code. I've observed the Jenkins build failing due to warnings and that's our intended effect.

Side Effects

None.

Checklist

Generable

The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
  - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
  - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@seantalts
Copy link
Member

❤️ Thanks! I wonder if now we can remove the script { node { part - that was necessary with the old, non-pipeline friendly warnings plugin to let it work on stages that executed on other nodes.

@@ -127,8 +127,7 @@ pipeline {
}
post {
always {
warnings consoleParsers: [[parserName: 'CppLint']], canRunOnFailed: true
warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you might have lost the math-dependencies tool?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two things going on:

  1. I don't know where the math-dependencies tool is? Meaning the parser for Jenkins. The make test-math-dependencies is just some fancy scripting.
  2. The format of make test-math-dependencies adheres to cpplint, so if we can parse cpplint output, we should just be able to use that. I think when I had originally set it up, that's what I did in Jenkins (just used the CppLint parser).

Is there a different place I should be looking for the math-dependencies parser? I wonder if I missed it cause it's in a different repo.

@seantalts
Copy link
Member

seantalts commented Jan 24, 2019 via email

@syclik
Copy link
Member Author

syclik commented Jan 25, 2019

It's a custom parser set up somewhere in Jenkins master config (on phone ATM or I'd try to find it). That said maybe we don't need it? I didn't add it.

Cool. Less is better than more. Let's see if we can get it done without a custom parser.

@syclik syclik force-pushed the feature/issue-1078-ci branch 2 times, most recently from 58a8f06 to 016a7ae Compare January 31, 2019 17:12
@syclik
Copy link
Member Author

syclik commented Feb 1, 2019

@seantalts, I updated the PR. Once it passes tests, it'll be ready for review.

@syclik syclik changed the title [WIP] updating Jenkinsfile warnings plugin updating make test-math-dependencies; fixing warnings Feb 1, 2019
Jenkinsfile Outdated
warnings consoleParsers: [[parserName: 'CppLint']], canRunOnFailed: true
warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true
recordIssues enabledForFailure: true, tool: cppLint()
warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true
Copy link
Member

Choose a reason for hiding this comment

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

Did you try recordIssues enabledForFailure: true, tool: math-dependencies()? Would be good to get rid of the old warnings plugin completely as I think it's going away soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had tried before. Just to make sure, I tried again. This is the doc that makes me think that we can't do it that way: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#creating-a-new-tool-in-the-user-interface

It says that you can have a Groovy parser, it just needs to be configured using the web interface. I also tried those instructions, but to no avail. (I'm sure it can't find the groovy script in the right place.)

Copy link
Member

Choose a reason for hiding this comment

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

Ah gotcha. Let me take a quick crack at it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I wasn't clear. I followed the instructions to run the Groovy script, but didn't add it via the web interface. Hopefully it does work!

Copy link
Member

@seantalts seantalts Feb 1, 2019

Choose a reason for hiding this comment

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

I added it via the web interface and pushed the change to the Jenkinsfile. Will it show up as working in this build or do we have to trigger some tests for it?

(fixing Jenkinsfile syntax - it changed a lot and apparently you can't scan the console log anymore, so we need to direct to a file).

@syclik
Copy link
Member Author

syclik commented Feb 1, 2019 via email

@seantalts
Copy link
Member

@syclik
Copy link
Member Author

syclik commented Feb 1, 2019

Nice!

@seantalts
Copy link
Member

Okay, I think I'm done messing with the branch. I think the math-dependencies are added in a decent way (though it's a little ugly to get output & exit status while logging to a file so the parser can read it, which I read was necessary but didn't experiment with).

warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true
recordIssues enabledForFailure: true, tools:
[cppLint(),
groovyScript(parserId: 'mathDependencies', pattern: '**/dependencies.log')]
Copy link
Member Author

Choose a reason for hiding this comment

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

Awesome!

@syclik
Copy link
Member Author

syclik commented Feb 2, 2019

Thanks for figuring that out! It's passed tests. When you get a chance, mind reviewing and merging if you think it's ready?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants