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

Branch git 2.2.0 #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tschoening-ac
Copy link

Hello,

during update of our company Hudson to the 2.2 branch we found a problem with manually starting a build for a project based on a git repo when no commits were made. It seems that the current version 2.2.0 of your plugin calls changeLogResult in GitSCM.checkout with a null-changelog which changeLogResult seem to handle as an error. changeLogResult returns false, which is directly delivered to Hudson which is aborting the manually started build. From my point of view it looks like you wanted to call changeLogResult to delete the current changeLogFile, else it wouldn't make sense to call the method at all with null, because it will always return false. This doesn't seem to be a practical behaviour because building manually without any committed changes to a repo should be possible. I therefore changed changeLogResult to the intended behaviour, else it would be neccessary to not call changeLogResult in checkout on no changes at all, but always return true in this case.

The second commit is just a rename of gerRevisionToBuild because this looks like a typo.

checkout calls changeLogResult with a null-changelog, but changeLogResult handles this as an error and returns false. This false is delivered directly to Hudson which is aborting the build if it was started without any commit. We had to ways to fix this: Let checkout always return true on now changes or change changeLogResult to always return true. I preferred the latter because the intended call of changeLogResult seems like deleting the changeLogFile.
@tschoening-ac
Copy link
Author

@christ66
Copy link
Contributor

I'm sorry, I won't be able to work on the next pull release for another couple days. Currently I am working on the SVN plugin and we're preparing for another small release for hudson. I will take a look at this next week. Do you have a test unit for this also?

@tschoening-ac
Copy link
Author

Guten Tag, Steven Christou,
am Donnerstag, 23. Februar 2012 um 04:48 schrieben Sie:

I'm sorry, I won't be able to work on the next pull release for
another couple days. Currently I am working on the SVN plugin and
we're preparing for another small release for hudson. I will take a
look at this next week.

Thanks, as we have our fix know, we can wait.

Do you have a test unit for this also?

No, because I was unsure what the intended behaviour really should be
and wasn't able to run all the tests even on unchanged code
successfully, but didn't got the time to dig any further for reasons.

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning | IT Development

ART+COM AG | Kleiststr. 23-26 | 10787 Berlin | Deutschland
Fon: +49.30.21001-0 | Fax: +49.30.21001-555 | Mobil: +49.0178.89468.04
http://www.artcom.de/

HRB 68308 | Amtsgericht Charlottenburg
Vorstand: Andreas Wiek, Prof. Joachim Sauter
Aufsichtsratsvorsitzender: Volker Tietgens
USt-IdNr. DE811998328

@christ66
Copy link
Contributor

Hmm, I just branched the git plugin and found no compilation or unit test failures. What tests were failing on your branch specifically?

@tschoening-ac
Copy link
Author

Guten Tag, Steven Christou,
am Donnerstag, 23. Februar 2012 um 22:43 schrieben Sie:

Hmm, I just branched the git plugin and found no compilation or
unit test failures. What tests were failing on your branch specifically?

Hello,

I'm new to maven and maybe made a mistake on setup, so here's what I
did: Checkout the repo, install maven, made it's bin folder available
to the path, set JAVA_HOME to my jdk under
C:\Program Files (x86)\Java\jdk1.6.0_31 and run mvn clean install in
the folder of the git repo. Maven downloaded nearly the whole internet
;-), compiled successfully, run the tests and failed on some of them.
So besides the failing tests everything worked pretty easy, the
results are as follows:


T E S T S

Running hudson.plugins.git.BranchSpecEqualsHashCodeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.133 sec
Running hudson.plugins.git.browser.BrowserChooserTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.915 sec
Running hudson.plugins.git.browser.GithubWebTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running hudson.plugins.git.browser.RedmineWebTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running hudson.plugins.git.browser.ViewGitWebTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 sec
Running hudson.plugins.git.converter.ObjectIdConverterTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.05 sec
Running hudson.plugins.git.converter.RemoteConfigConverterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.005 sec
Running hudson.plugins.git.GitChangeSetTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running hudson.plugins.git.GitPublisherTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 48.805 sec <<< FAILURE!
Running hudson.plugins.git.GitRepositoryBrowserEqualsHashCodeTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.207 sec
Running hudson.plugins.git.GitRepositoryEqualsHashCodeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.125 sec
Running hudson.plugins.git.GitSCMEqualsHashCodeTest
Tests run: 60, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.73 sec
Running hudson.plugins.git.GitSCMTest
Tests run: 13, Failures: 12, Errors: 1, Skipped: 0, Time elapsed: 491.07 sec <<< FAILURE!
Running hudson.plugins.git.GitSCMUnitTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.398 sec
Running hudson.plugins.git.PreBuildMergeOptionsEqualsHashCodeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.344 sec
Running hudson.plugins.git.SubmoduleConfigEqualsHashCodeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.157 sec
Running hudson.plugins.git.TestBranchSpec
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.156 sec
Running hudson.plugins.git.util.GitUtilsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.238 sec

Results :

Failed tests:

Tests in error:

Tests run: 128, Failures: 13, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:22.279s
[INFO] Finished at: Fri Feb 24 12:14:54 CET 2012
[INFO] Final Memory: 29M/74M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8.1:test (default-test) on project git: There are test failures.
[ERROR]
[ERROR] Please refer to D:\Users\tschoening\Documents\Repositories\Git\Hudson-CI\git-plugin\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning | IT Development

ART+COM AG | Kleiststr. 23-26 | 10787 Berlin | Deutschland
Fon: +49.30.21001-0 | Fax: +49.30.21001-555 | Mobil: +49.0178.89468.04
http://www.artcom.de/

HRB 68308 | Amtsgericht Charlottenburg
Vorstand: Andreas Wiek, Prof. Joachim Sauter
Aufsichtsratsvorsitzender: Volker Tietgens
USt-IdNr. DE811998328

@christ66
Copy link
Contributor

I will try your modifications on my local branch to see if changes you made would break those junits. It could be the version of git you are using. You wouldn't happen to know the version of git that you are running would you?

Maven downloaded nearly the whole internet ;-)
Totally true!

@tschoening-ac
Copy link
Author

Guten Tag, Steven Christou,
am Freitag, 24. Februar 2012 um 23:12 schrieben Sie:

It could be the version of git
you are using. You wouldn't happen to know the version of git that
you are running would you?

Good point, I didn't thought of that. I have MsysGit 1.7.8, Cygwin
with git 1.7.9, TortoiseGit 1.7.7.0 and EGit 1.3.0(?) for Eclipse
Indigo SR1 installed, all at the same time. But in cmd.exe, where I
ran the maven commands, none of those installations are available. So
I ran my version of the plugin and your current HEAD in Msys and
Cygwin, with the following results. Every not mentioned test passed
successfully.

Msys my version:

Running hudson.plugins.git.GitSCMTest
Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 383.185 sec <<< FAILURE!

Msys your HEAD:

no failures

Cygwin my version:

Running hudson.plugins.git.GitPublisherTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 45.186 sec <<< FAILURE!
[...]
Running hudson.plugins.git.GitSCMTest
Tests run: 13, Failures: 13, Errors: 0, Skipped: 0, Time elapsed: 412.482 sec <<< FAILURE!

Cygwin your HEAD:

Running hudson.plugins.git.GitExcludeIncludeTest
Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 99.322 sec <<< FAILURE!
Running hudson.plugins.git.GitPublisherTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 30.773 sec <<< FAILURE!
[...]
Running hudson.plugins.git.GitSCMTest
Tests run: 11, Failures: 11, Errors: 0, Skipped: 0, Time elapsed: 327.279 sec <<< FAILURE!

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning | IT Development

ART+COM AG | Kleiststr. 23-26 | 10787 Berlin | Deutschland
Fon: +49.30.21001-0 | Fax: +49.30.21001-555 | Mobil: +49.0178.89468.04
http://www.artcom.de/

HRB 68308 | Amtsgericht Charlottenburg
Vorstand: Andreas Wiek, Prof. Joachim Sauter
Aufsichtsratsvorsitzender: Volker Tietgens
USt-IdNr. DE811998328

@wjprakash
Copy link
Member

What decision take on this pull request?

gilbode pushed a commit to gilbode/git-plugin that referenced this pull request Dec 17, 2014
[FIXES JENKINS-10131] (for simple cases)
Poll changes without workspace using git ls-remote
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.

3 participants