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

Make it possible to submit a new external job per CLI #5

Merged
merged 1 commit into from
Aug 29, 2013

Conversation

davido
Copy link
Contributor

@davido davido commented Aug 28, 2013

With this command external job submission is possible per CLI.
Per pipe gzipped log file can be transported. No wrapper scripts are needed
it can be easily done from the command line:

cat log.gz | ssh jenkins set-external-build-result --job b --result 0 --log -

With this command external job submission is possible per CLI.
Per pipe gzipped log file can be transported. No wrapper scripts are needed
it can be easily done from the command line:

 cat log.gz | ssh jenkins set-external-build-result --job b --result 0 --log -
@buildhive
Copy link

Jenkins » external-monitor-job-plugin #16 SUCCESS
This pull request looks good
(what's this?)

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@jglick
Copy link
Member

jglick commented Aug 29, 2013

Originally #2.

jglick added a commit that referenced this pull request Aug 29, 2013
Make it possible to submit a new external job per CLI
@jglick jglick merged commit 00443b2 into jenkinsci:master Aug 29, 2013
jglick added a commit that referenced this pull request Aug 29, 2013
…itten.

A CLI option can be TopLevelItem, not a subclass (apparently).
Also some other fixups:
Need not be serializable.
Printing to System.out is useless; you need to use CLICommand.stdout.
A meta var for --dump-build-number is meaningless since it takes no arguments.
Making --result be successful by default.
Fixing documentation of --display.
@davido
Copy link
Contributor Author

davido commented Aug 30, 2013

Thanks, for fixing it! I need to adjust LibreOffice code. May be we can put that part from out buildbot-plugin code as JUnit or contrib example?

@davido
Copy link
Contributor Author

davido commented Aug 30, 2013

@jglick
Copy link
Member

jglick commented Aug 30, 2013

Sorry, thought my comment was inserted twice so I deleted the second, but that was the only one.

Yes you can try taking code similar to that, and making it into a JenkinsRule-based test (use 1.480.3 parent POM). Just need to replace exitValue() with out to get build number.

@davido
Copy link
Contributor Author

davido commented Aug 31, 2013

So we probably don't want to introduce the GIT dependency (URLish) to jenkins. I wonder how could i conduct a JUnit test for new introduce CLI command? I found these info:

https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test
https://wiki.jenkins-ci.org/display/JENKINS/Extension+points
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI

but it is not obvious to me how to call CLI command from a standard JenkinsRule unit test. Any thoughts?

Thanks.

@davido
Copy link
Contributor Author

davido commented Aug 31, 2013

Okay, found how to invoke CLI so far, With latest published parent pom 1.529 it seems to be really easy to do. I am getting NPE exception while trying to create ExternalJob instance. here is the code:

http://pastebin.com/ZCpJJ5y3

Any clue?

@davido
Copy link
Contributor Author

davido commented Aug 31, 2013

Seems to be general problem with that version: Old style unit test doesn't work either:

public class ExternalRunTest extends HudsonTestCase {
public void test1() throws Exception {
ExternalJob p = hudson.createProject(ExternalJob.class, "test");

has the same NPE. With the parent pom version that you suggested 1.480.3 the old unit test seems to ork. However the new classes CLICommandInvoker are missing in this version. That why i was trying to make it work with new new one.

@davido
Copy link
Contributor Author

davido commented Aug 31, 2013

Ok, bibisect helps: tried all version and it was broken in the version 1.512.
1.511 is the lat version it works. So would base my test on it. Unfortunately without CLICommandInvoker then ...

@davido
Copy link
Contributor Author

davido commented Aug 31, 2013

Just uploaded a new pull request: CLI command is failing: argument parsing still broken. any ideas?

Thanks

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