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

[Feature Request] Update diff with Linter and Unit Test information #34

Closed
lavahot opened this issue Jun 12, 2015 · 11 comments
Closed

[Feature Request] Update diff with Linter and Unit Test information #34

lavahot opened this issue Jun 12, 2015 · 11 comments
Assignees

Comments

@lavahot
Copy link

lavahot commented Jun 12, 2015

Not sure if this is what the Phabricator workflow should be used for, but I think I'd like the option to publish the results of linting and unit tests performed on Jenkins as a part of a Differential build to that differential build in the lint and unit test sections of that diff.

@ascandella
Copy link
Contributor

Thanks for the request, and I'll leave this open as this is something we want as well.

The reality is that currently harbormaster is in early beta, (not even v1 yet), and currently only supports pass/fail. There are many tasks to track improvements to this, such as being able to report lint/unit results over harbormaster (https://secure.phabricator.com/T8097 https://secure.phabricator.com/T8095 https://secure.phabricator.com/T6139) but those aren't there yet.

To work around this, we currently provide a "comment" option, documented https://github.com/uber/phabricator-jenkins-plugin#additional-comments -- it's pretty rudimentary, but we use it to provide reasons for build failures in our jobs. So for example, my Go project might have a test script that looks like:

#!/bin/bash
set -ex -o pipefail

PHABRICATOR_COMMENT=".phabricator-comment"
gofmt -s -e -d . | tee -a $PHABRICATOR_COMMENT
golint ./... | tee -a $PHABRICATOR_COMMENT

go build ./... | tee -a $PHABRICATOR_COMMENT

That way, the failure of any one of those commands gets reported back by jenkins:

image

I know it's kinda hacky, but maybe could be useful in the interim until Harbormaster is more mature?

@ascandella
Copy link
Contributor

By the way, I realize now that I forgot to document this on the Jenkins wiki page. It's now there under https://wiki.jenkins-ci.org/display/JENKINS/Phabricator+Plugin#PhabricatorPlugin-PostingResultstoPhabricator -- feel free to edit if you find this useful / see any issues.

@ascandella ascandella added this to the Harbormaster v1 milestone Jun 12, 2015
@ascandella ascandella self-assigned this Jun 12, 2015
@ascandella
Copy link
Contributor

Looks like this just landed in https://secure.phabricator.com/D13380 -- will look at updating this soon.

@ascandella
Copy link
Contributor

@lavahot what format are your test results in? We use jUnit at Uber, want to make sure that will cover your case as well.

@ChaitanyaPramod
Copy link
Contributor

We have a similar requirement for our project. We also use jUnit.

@cburroughs
Copy link
Contributor

https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin knows how to transform most things into junit-esque format for jenkins. It's possible there is something re-usable there.

@ascandella
Copy link
Contributor

Just underwent some heavy refactoring in #60 -- once that's landed, we should be clear to add unit/lint/coverage results. I'll probably target jUnit initially, since that's going to be a hard requirement at Uber, but leave it open to extensibility.

I won't have time to work on this for a few days though, so if somebody else wants to take a look, feel free.

@ascandella
Copy link
Contributor

Refactor is landed and released. Next up is this task. I'm out of town this weekend so will start looking at this early next week.

@ascandella
Copy link
Contributor

I started sketching this out in https://github.com/uber/phabricator-jenkins-plugin/tree/junit-test-results (d7a0221)

I have a ton of work this week so I may not be able to look at this for a little bit.

@ascandella
Copy link
Contributor

Started work on using the new Harbormaster APIs in #90

ascandella added a commit to jenkinsci/phabricator-plugin that referenced this issue Sep 8, 2015
ascandella added a commit that referenced this issue Sep 8, 2015
ascandella added a commit that referenced this issue Sep 8, 2015
ascandella added a commit that referenced this issue Sep 8, 2015
@ascandella
Copy link
Contributor

This was released today in version 1.8.0 of the plugin

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

No branches or pull requests

4 participants