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

Match TestSwarm API version 1.0.0-alpha #3

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

Match TestSwarm API version 1.0.0-alpha #3

wants to merge 2 commits into from

Conversation

gmoulin
Copy link

@gmoulin gmoulin commented Jul 13, 2012

Changed addjob request to match api (using post, parsing json return to get job id).
Changed test results gathering to match api (parsing json).
Also changed the thresold to get a sucessfull build (if all browsers tests were not ran).
Finaly cleaned the <select> of non present browsers sets.

Java is not my forte so the changes should definitely be checked and improved.
I leaved the old code commented as a reference.

One thing to note, i use the testswarm server url without checking for a tailing slash.

@jzaefferer
Copy link
Contributor

Could you update this to actually remove the commented code? Its all versioned, there's no reason to keep it around. Thanks.

@gmoulin
Copy link
Author

gmoulin commented Jul 13, 2012

Done

<option value="beta">Upcoming alphas/betas of popular browsers</option>
<option value="popularbeta">Popular browsers and their upcoming alphas/betas</option>
<option value="default">All available browsers</option>
<option value="currentDesktop">Current release of all major desktop browsers</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense anymore - should just convert it to a text input, as the browserSets are now easily customizable for each instance.

@memphis85th
Copy link

Hello, i hope i'm not wrong here with my question. I experience problems in getting the plugin correctly run. The compilation and integration into jenkins worked without bigger problems. Build completed, 4 of 4 Tests without failure.
But i can't select a test suite if i choose the Testswarm Integration build step because there is nothing to select from. What am i doing wrong? how can i fix this issue? My Testswarm and jenkins installations are working properly as far i can say.

Here is my specific build setup:

TestSwarm Server URL: http://localhost/testswarm
Job Name: jenkins driven test
Your Username: root
Your Auth Token: .................
Number of Runs: 3
Choose Browsers: All available browsers
Polling Interval (in secs): 10
Timeout Period(in mins): 2
Test Suite: Nothing to choose here!

What i get as a result by clicking save or apply (obviously because no test suite was selected):

Exception: java.lang.RuntimeException: Failed to instantiate class com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder from {"authToken":"8b8a66accaf7dfc8585cc6e3b7346a94f5f7c806","chooseBrowsers":"all","jobName":"Jenkins driven test","kind":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","maxRuns":"3","pollingIntervalInSecs":"10","stapler-class":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","testswarmServerUrl":"http://localhost/testswarm","timeOutPeriodInMins":"2","userName":"root"}
Stacktrace:
javax.servlet.ServletException: java.lang.RuntimeException: Failed to instantiate class com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder from {"authToken":"8b8a66accaf7dfc8585cc6e3b7346a94f5f7c806","chooseBrowsers":"all","jobName":"Jenkins driven test","kind":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","maxRuns":"3","pollingIntervalInSecs":"10","stapler-class":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","testswarmServerUrl":"http://localhost/testswarm","timeOutPeriodInMins":"2","userName":"root"}
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:616)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
    at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:162)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
    at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
    at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215)
    at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.RuntimeException: Failed to instantiate class com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder from {"authToken":"8b8a66accaf7dfc8585cc6e3b7346a94f5f7c806","chooseBrowsers":"all","jobName":"Jenkins driven test","kind":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","maxRuns":"3","pollingIntervalInSecs":"10","stapler-class":"com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder","testswarmServerUrl":"http://localhost/testswarm","timeOutPeriodInMins":"2","userName":"root"}
    at hudson.model.Descriptor.newInstance(Descriptor.java:575)
    at com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder$DescriptorImpl.newInstance(TestSwarmIntegrationBuilder.java:503)
    at com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder$DescriptorImpl.newInstance(TestSwarmIntegrationBuilder.java:450)
    at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:912)
    at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:899)
    at hudson.util.DescribableList.rebuildHetero(DescribableList.java:203)
    at hudson.model.Project.submit(Project.java:202)
    at hudson.model.Job.doConfigSubmit(Job.java:990)
    at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:699)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
    ... 39 more
Caused by: java.lang.NullPointerException
    at com.appendto.hudson.testswarm.TestSwarmIntegrationBuilder.<init>(TestSwarmIntegrationBuilder.java:109)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:424)
    at org.kohsuke.stapler.RequestImpl.access$300(RequestImpl.java:76)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:631)
    at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:377)
    at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:373)
    at hudson.model.Descriptor.newInstance(Descriptor.java:566)
    ... 57 more

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