Giter Site home page Giter Site logo

Comments (7)

adamtkac avatar adamtkac commented on July 20, 2024

Hi @MarkEWaite could you assign me to this issue? Appreciate any initial pointers for working on this as a first time contributor. Thanks in advance.

from embeddable-build-status-plugin.

MarkEWaite avatar MarkEWaite commented on July 20, 2024

@adamtkac I'm delighted that you're willing to contribute. There is enough work on this topic that I don't bother to assign it to a single person. You can start the work and submit a pull request. See the Jenkins gitter Hacktoberfest chat channel for a recent discussion about assessing test coverage of a plugin and writing new unit tests based on that result.

The steps are:

  • Identify larger Java classes with very little test coverage from the ci.jenkins.io test coverage report (look at the line coverage report to identify the larger classes with low coverage
  • Install the necessary tools (git, Java 11, Apache Maven) as described in "Preparing for plugin development"
  • Checkout a local copy of the repository with git clone https://github.com/jenkinsci/embeddable-build-status-plugin.git
  • Build and run automated tests locally with mvn -P enable-jacoco clean install jacoco:report
  • Review the locally generated coverage report in target/site/jacoco/index.html to identify untested classes and statements
  • Use your integrated development environment (Visual Studio Code, Apache Netbeans, IntelliJ, or Eclipse) to generate test stubs for one of the untested classes
  • Add test details to one of the stubs, delete the other stubs
  • Run the test and confirm that the test compiles and that it passes
  • Submit a pull request so that it can be reviewed and improved if necessary

from embeddable-build-status-plugin.

adamtkac avatar adamtkac commented on July 20, 2024

Thank you for your answer. It is possible to divide issue to partial issues, depending on parts of code which needs to be covered first? I will start do my best as soon as I can.

from embeddable-build-status-plugin.

MarkEWaite avatar MarkEWaite commented on July 20, 2024

Thank you for your answer. It is possible to divide issue to partial issues, depending on parts of code which needs to be covered first? I will start do my best as soon as I can.

Yes, you're welcome to create additional issues that track specific classes where you are focusing implementation.

from embeddable-build-status-plugin.

wliao008 avatar wliao008 commented on July 20, 2024

mvn -P enable-jacoco clean install jacoco:report ran successfully for me once, on subsequent runs I've been getting the following error (w/o any change), mvn test also produced the same sort of error. i have java 11, macos 12.3, jenkins 2.361.4, wonder if anyone seen this before.

[ERROR] Failures:                                                                                                                [605/1944]
[ERROR]   PublicBuildStatusActionTest.testDoIconBuildAfter:104
Expected: a string containing "<svg "
     but: was "<html><body>
<h1>404 Not Found</h1>
<p>Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request
<pre>
-&gt; evaluate(&lt;hudson.model.Hudson@22513da2&gt; :hudson.model.Hudson,"/buildStatus/icon")
-&gt; evaluate(((StaplerProxy)&lt;hudson.model.Hudson@22513da2&gt;).getTarget(),"/buildStatus/icon")
-&gt; evaluate(&lt;hudson.model.Hudson@22513da2&gt;.getDynamic("buildStatus",...),"/icon")
            [email protected]("buildStatus",...)==null. Back tracking.
-&gt; evaluate(((StaplerFallback)&lt;hudson.model.Hudson@22513da2&gt;).getStaplerFallback(),"/buildStatus/icon")
-&gt; evaluate(&lt;hudson.model.AllView@65ca8da2[view/all/]&gt; :hudson.model.AllView,"/buildStatus/icon")
-&gt; evaluate(&lt;hudson.model.AllView@65ca8da2[view/all/]&gt;.getDynamic("buildStatus",...),"/icon")
            hudson.model.AllView@65ca8da2[view/all/].getDynamic("buildStatus",...)==null. Back tracking.
<font color=red>-&gt; No matching rule was found on &lt;hudson.model.AllView@65ca8da2[view/all/]&gt; for "/buildStatus/icon"</font>
</pre>
<p>&lt;hudson.model.AllView@65ca8da2[view/all/]&gt; has the following URL mappings, in the order of preference:<ol>
<li>                                                                                                                                       If path ends without '/' insert it

from embeddable-build-status-plugin.

MarkEWaite avatar MarkEWaite commented on July 20, 2024

I've not seen that failure before. I don't have access to a macOS machine, but I confirmed that the tests run as expected multiple times on a FreeBSD 13.1 machine (closest thing I have to macOS). The web response is definitely a Jenkins response. I don't know why it would report that the resource cannot be found.

from embeddable-build-status-plugin.

wliao008 avatar wliao008 commented on July 20, 2024

Thanks Mark, I thought it might be related to SECURITY-595, because I did also run into 404 with badge/text where I had to add the whitelisting to stapler-whitelist.txt for it to work:

method org.jenkinsci.plugins.badge.actions.RunBadgeAction doText

But I'm not sure where to add this while running unittest...Im gonna try couple things see if I can get it working..

from embeddable-build-status-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.