You may need to add a test dependency on the workflow class (or classes)
which provide that descriptor.

I added pipeline tests to a fork of the hello-world-plugin
<https://github.com/MarkEWaite/hello-world-plugin/blob/af704cc5b944d5a2bcddfe878578aee2d113ea54/pom.xml#L129>
and had to add several test dependencies.

Mark Waite

On Fri, Aug 25, 2017 at 10:56 AM Shaun Thompson <[email protected]> wrote:

> I'm currently trying to create Workflow job from my plugin using the
> following code.
>
> Jenkins.getInstance().createProject(WorkflowJob.class, SomeClass.class.
> getSimpleName());
>
> It fails to find the descriptor when running the following
>
> public Descriptor getDescriptor(Class<? extends Describable> type) {
>         for( Descriptor d : getExtensionList(Descriptor.class) )
>             if(d.clazz==type)
>                 return d;
>         return null;
>     }
>
> What's seems odd to me is that the tests supplied with the workflow plugin
> show the same issue when I run it locally.
>
> https://github.com/jenkinsci/workflow-job-plugin
>
> Any idea on what's going on?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/a762da27-0cf3-4dd7-98d2-09df23bff997%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/a762da27-0cf3-4dd7-98d2-09df23bff997%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAO49JtEBssuVj-iL9tCJhq3pdYzbNRdJirrawPEfSFuCVQ%3DDdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to