Giter VIP home page Giter VIP logo

Comments (11)

zipleen avatar zipleen commented on May 29, 2024

Hi

It looks like when requesting /projects/ID/commits/SHA-1/status.json , the response you should get is:

{"id":5,"sha":"c3202889d89d8d7ab70cd2c5adf9b721bcec85b6","status":"failed","coverage":42.0}

It seems it's just a matter of adding the additional "coverage" to the json response.

I think it's fair to assume that if we add here https://github.com/DABSquared/gitlab-plugin/blob/8a9468afebda30d668f437810b2e3067861b5872/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java#L225 object.put("coverage", the_float_percentage) we will get that code coverage number.

I don't know how to get this "percentage" though =) Gitlab CI gives them a regular expression to extract this value, which they'll pass as a float.

from gitlab-plugin.

bassrock avatar bassrock commented on May 29, 2024

Hmm it would seem we would need to calculate the percentage of successful builds correct?

from gitlab-plugin.

zipleen avatar zipleen commented on May 29, 2024

I think this "coverage" is for the "code coverage results".
I just installed Cobertura and I have these values in jenkins: "Packages 83% Files 24% Classes 25% Methods 28% Lines 27% Conditionals 28%"
Problem is how to get these results and what result should be considered. For me I could use the percentage of "Lines", but I'm guessing the user should be able to specify which "code coverage" percentage (s)he wants to use.

from gitlab-plugin.

zipleen avatar zipleen commented on May 29, 2024

Just to be clear, this is related to "code coverage for the unit tests".

In GitLab we now see:
screen shot 2015-02-03 at 18 31 53
That "coverage" value comes from gitlab ci. We can see it here:
screen shot 2015-02-03 at 18 32 04
And this was fed from a regexp that the user needs to build, against the whole output of the command that was run.
You specify it in the settings of gitlab ci:
screen shot 2015-02-03 at 18 32 11

Then you'll get the "code coverage" value shown in the first screenshot...

from gitlab-plugin.

bobey avatar bobey commented on May 29, 2024

This feature would be a major enhancement to the plugin. With jenkins, the cobertura plugin give some good metrics.
I will take a look tomorrow to see if I find a way to get these metrics via the API.

from gitlab-plugin.

bassrock avatar bassrock commented on May 29, 2024

We should also see what other metric plugins this could be used for or develop our own. For instance most of my projects are Obj-C?/Swift and and PHP

from gitlab-plugin.

zipleen avatar zipleen commented on May 29, 2024

screen shot 2015-02-09 at 11 28 26

If you hover the "health report", in the healthReportDetails we have lines that represent the various values of stability. They all have a global percentage.

We could have an option in the gitlab-plugin specifying which plugin name to get this percentage and publish it in the coverage number. I'm guessing via this way you would support any plugin.

Is this possible? Unfortunately I have no idea on how to do this =)

from gitlab-plugin.

zipleen avatar zipleen commented on May 29, 2024

I'm probably completely out of my depth here, but this seems to work: zipleen@0621f9a
There's a lot of "health reports" so we need to specify which build report we want, mine is "CoberturaBuildAction". Can you add this as a settings per project? Is this acceptable ?

from gitlab-plugin.

omehegan avatar omehegan commented on May 29, 2024

I don't see a good way to support this feature, if it even still exists in GitLab. It requires an optional dependency on other Jenkins plugins which can provide code coverage, and we'd have to code various methods to extract that result from them and return it to GitLab.

from gitlab-plugin.

tomfun avatar tomfun commented on May 29, 2024

Will be some movement in this direction? Some groovy function like updateGitlabCommitStatus?

from gitlab-plugin.

thatsIch avatar thatsIch commented on May 29, 2024

I think we should split the concerns. Providing a means to set the coverage is different than automatically calculating the coverage. For many, the first option would be more relevant because this would allow independent calculations of which coverage is relevant for them.

from gitlab-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.