You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2017/03/09 07:41:04 UTC

JSR223 Test Element compilation feature

Hello,
I have implemented a menu option (in Help that can be moved somewhere else)
that allows compilation of JSR223 Test Elements.

It visits the test plan tree and compiles any Test Element.
If compilation fails it set the node in red and logs the compilation
failure.

This allows detecting some errors without running test plan but not all
errors like invalid variable usage.

Do you think it should be added to core (It changes JSR223TestElement
(compile method) and add 1 class for menu) ?
Thanks
Regards

Re: JSR223 Test Element compilation feature

Posted by sebb <se...@gmail.com>.
On 9 March 2017 at 12:11, Philippe Mouawad <ph...@gmail.com> wrote:
> On Thu, Mar 9, 2017 at 11:59 AM, sebb <se...@gmail.com> wrote:
>
>> What happens if the source contains values that are not yet defined?
>> These may affect the compilation result.
>>
> No, there will not be an error for that.

Are you sure?

Since variables can be used to replace any text in a script, there's
no way of knowing if it will affect compilation or not.

>> It would be annoying to have the test element flagged as failed just
>> because the variable is not defined.
>>
>> Equally, if compilation succeeds, it's possible for it to fail at
>> run-time because of the actual variable value.
>>
> As explained in my initial message, compilation will not detect those.
> It's a first check but unfortunately it will not fail in this case.
>
>>
>> If the feature is added, the docs need to make such restrictions clear.

This is still true.

>>
>>
>> On 9 March 2017 at 10:04, Antonio Gomes Rodrigues <ra...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > +1
>> >
>> > But I think we need to rename it "Validate" and add it to icon menu +
>> > somewhere in the menu but not in Help.
>> >
>> > We can add more verification (check anti pattern...) later
>> >
>> > Antonio
>> >
>> > 2017-03-09 9:39 GMT+01:00 Maxime Chassagneux <
>> maxime.chassagneux@gmail.com>:
>> >
>> >> Hello,
>> >>
>> >> For me this option is really interesting as I use a lot of JSR233
>> script.
>> >>
>> >> +1 for add it !
>> >>
>> >> --
>> >> Max
>> >>
>> >> 2017-03-09 8:41 GMT+01:00 Philippe Mouawad <philippe.mouawad@gmail.com
>> >:
>> >>
>> >> > Hello,
>> >> > I have implemented a menu option (in Help that can be moved somewhere
>> >> else)
>> >> > that allows compilation of JSR223 Test Elements.
>> >> >
>> >> > It visits the test plan tree and compiles any Test Element.
>> >> > If compilation fails it set the node in red and logs the compilation
>> >> > failure.
>> >> >
>> >> > This allows detecting some errors without running test plan but not
>> all
>> >> > errors like invalid variable usage.
>> >> >
>> >> > Do you think it should be added to core (It changes JSR223TestElement
>> >> > (compile method) and add 1 class for menu) ?
>> >> > Thanks
>> >> > Regards
>> >> >
>> >>
>>
>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: JSR223 Test Element compilation feature

Posted by Philippe Mouawad <ph...@gmail.com>.
On Thu, Mar 9, 2017 at 11:59 AM, sebb <se...@gmail.com> wrote:

> What happens if the source contains values that are not yet defined?
> These may affect the compilation result.
>
No, there will not be an error for that.

> It would be annoying to have the test element flagged as failed just
> because the variable is not defined.
>
> Equally, if compilation succeeds, it's possible for it to fail at
> run-time because of the actual variable value.
>
As explained in my initial message, compilation will not detect those.
It's a first check but unfortunately it will not fail in this case.

>
> If the feature is added, the docs need to make such restrictions clear.
>
>
> On 9 March 2017 at 10:04, Antonio Gomes Rodrigues <ra...@gmail.com>
> wrote:
> > Hi,
> >
> > +1
> >
> > But I think we need to rename it "Validate" and add it to icon menu +
> > somewhere in the menu but not in Help.
> >
> > We can add more verification (check anti pattern...) later
> >
> > Antonio
> >
> > 2017-03-09 9:39 GMT+01:00 Maxime Chassagneux <
> maxime.chassagneux@gmail.com>:
> >
> >> Hello,
> >>
> >> For me this option is really interesting as I use a lot of JSR233
> script.
> >>
> >> +1 for add it !
> >>
> >> --
> >> Max
> >>
> >> 2017-03-09 8:41 GMT+01:00 Philippe Mouawad <philippe.mouawad@gmail.com
> >:
> >>
> >> > Hello,
> >> > I have implemented a menu option (in Help that can be moved somewhere
> >> else)
> >> > that allows compilation of JSR223 Test Elements.
> >> >
> >> > It visits the test plan tree and compiles any Test Element.
> >> > If compilation fails it set the node in red and logs the compilation
> >> > failure.
> >> >
> >> > This allows detecting some errors without running test plan but not
> all
> >> > errors like invalid variable usage.
> >> >
> >> > Do you think it should be added to core (It changes JSR223TestElement
> >> > (compile method) and add 1 class for menu) ?
> >> > Thanks
> >> > Regards
> >> >
> >>
>



-- 
Cordialement.
Philippe Mouawad.

Re: JSR223 Test Element compilation feature

Posted by sebb <se...@gmail.com>.
What happens if the source contains values that are not yet defined?
These may affect the compilation result.
It would be annoying to have the test element flagged as failed just
because the variable is not defined.

Equally, if compilation succeeds, it's possible for it to fail at
run-time because of the actual variable value.

If the feature is added, the docs need to make such restrictions clear.


On 9 March 2017 at 10:04, Antonio Gomes Rodrigues <ra...@gmail.com> wrote:
> Hi,
>
> +1
>
> But I think we need to rename it "Validate" and add it to icon menu +
> somewhere in the menu but not in Help.
>
> We can add more verification (check anti pattern...) later
>
> Antonio
>
> 2017-03-09 9:39 GMT+01:00 Maxime Chassagneux <ma...@gmail.com>:
>
>> Hello,
>>
>> For me this option is really interesting as I use a lot of JSR233 script.
>>
>> +1 for add it !
>>
>> --
>> Max
>>
>> 2017-03-09 8:41 GMT+01:00 Philippe Mouawad <ph...@gmail.com>:
>>
>> > Hello,
>> > I have implemented a menu option (in Help that can be moved somewhere
>> else)
>> > that allows compilation of JSR223 Test Elements.
>> >
>> > It visits the test plan tree and compiles any Test Element.
>> > If compilation fails it set the node in red and logs the compilation
>> > failure.
>> >
>> > This allows detecting some errors without running test plan but not all
>> > errors like invalid variable usage.
>> >
>> > Do you think it should be added to core (It changes JSR223TestElement
>> > (compile method) and add 1 class for menu) ?
>> > Thanks
>> > Regards
>> >
>>

Re: JSR223 Test Element compilation feature

Posted by Antonio Gomes Rodrigues <ra...@gmail.com>.
Hi,

+1

But I think we need to rename it "Validate" and add it to icon menu +
somewhere in the menu but not in Help.

We can add more verification (check anti pattern...) later

Antonio

2017-03-09 9:39 GMT+01:00 Maxime Chassagneux <ma...@gmail.com>:

> Hello,
>
> For me this option is really interesting as I use a lot of JSR233 script.
>
> +1 for add it !
>
> --
> Max
>
> 2017-03-09 8:41 GMT+01:00 Philippe Mouawad <ph...@gmail.com>:
>
> > Hello,
> > I have implemented a menu option (in Help that can be moved somewhere
> else)
> > that allows compilation of JSR223 Test Elements.
> >
> > It visits the test plan tree and compiles any Test Element.
> > If compilation fails it set the node in red and logs the compilation
> > failure.
> >
> > This allows detecting some errors without running test plan but not all
> > errors like invalid variable usage.
> >
> > Do you think it should be added to core (It changes JSR223TestElement
> > (compile method) and add 1 class for menu) ?
> > Thanks
> > Regards
> >
>

Re: JSR223 Test Element compilation feature

Posted by Vladimir Sitnikov <si...@gmail.com>.
Philippe> Do you think it should be added to core (It changes
JSR223TestElement
Philippe> (compile method) and add 1 class for menu) ?

I think test plan validation is an interesting idea in general.
Something like a single "check test plan" menu entry might be better than
having lots of entries like "compile JSR223 elements", "check if HTTP
samplers are configured", ...

Vladimir

Re: JSR223 Test Element compilation feature

Posted by Maxime Chassagneux <ma...@gmail.com>.
Hello,

For me this option is really interesting as I use a lot of JSR233 script.

+1 for add it !

--
Max

2017-03-09 8:41 GMT+01:00 Philippe Mouawad <ph...@gmail.com>:

> Hello,
> I have implemented a menu option (in Help that can be moved somewhere else)
> that allows compilation of JSR223 Test Elements.
>
> It visits the test plan tree and compiles any Test Element.
> If compilation fails it set the node in red and logs the compilation
> failure.
>
> This allows detecting some errors without running test plan but not all
> errors like invalid variable usage.
>
> Do you think it should be added to core (It changes JSR223TestElement
> (compile method) and add 1 class for menu) ?
> Thanks
> Regards
>