Page 1 of 1

Detecting servoy errors / warnings

PostPosted: Mon Nov 13, 2017 11:27 am
by robrecht
Hi

Is it possible to check if an active servoy solution contains errors / warnings ?
I would like to use such a method to let the unit tests fail when there are errors or warnings.

Thanks
Robrecht

Re: Detecting servoy errors / warnings

PostPosted: Mon Nov 13, 2017 1:11 pm
by Andrei Costescu
You are talking here about automated unit tests right?

The solution exporter used for that already fails for Servoy build errors.
However it doesn't have an option to fail exporting for warning markers as well nor does it run the DLTK/JS build to check for scripting errors.
If you want/need any of the two above that you should create a case or cases.

Re: Detecting servoy errors / warnings

PostPosted: Mon Nov 13, 2017 1:26 pm
by robrecht
Yes I mean the automated test.
But I was thinking about a method to get all warnings/errors with a description so we could use this information to send an e-mail or print an overview
You think that might be possible? Then I'd be happy to create a change request

Thanks

Re: Detecting servoy errors / warnings

PostPosted: Mon Nov 13, 2017 4:17 pm
by Andrei Costescu
The exporter (build output will contain this) lists those after "Found error markers in solution (...)" or "Found warning markers in projects for solution (...)".
So if the exporter would fail sending that last part of the build output would also include those.

Or do you have something else in mind?

Re: Detecting servoy errors / warnings

PostPosted: Thu Nov 16, 2017 1:53 pm
by pbakker
Robrecht,

Are you talking about errors in the log after the testrun while the test in which it occurred didn't fail?

We used to use Jenkins where you have log parser plugins what you can instruct to find all log entries based on certain patterns and depending on the pattern fail the build.

Currently we are using GitLab CI where we unfortunately don't have such a mechanism yet

Re: Detecting servoy errors / warnings

PostPosted: Thu Nov 16, 2017 2:29 pm
by Andrei Costescu
I am talking about lines of text in the console of the job (so what is in Jenkins under the job run's "Console output"). So not in the developer .log or app. server servoy_log.txt but really the output of the job.
Those already appear like that for Servoy build errors and warnings, but currently only errors can fail the export (warnings are just logged but don't fail) and there is no check for javascript errors as I already mentioned. If you want the possibility to fail export - so job - even for warnings and also check for JS errors you should make a case.

Not sure where the equivalent of "Console output" appears in GitLab CI. But the basic idea should be the same.

What I was suggesting was that you don't even parse that output - just send the email with that output when job fails; at least that was easy to do in Jenkins. Of course if you can parse it as you used to and show problems nicer it's a plus...
That was my question: are you thinking of a nicer way to report these? Is it worth it?

PS: If you want to fail your job for warning markers - without any case to change Servoy then yes you'd need to parse the output and search for warnings yourself...