On 29 Mar 2019, at 10:33, Simon Urli
<simon.urli(a)xwiki.com> wrote:
Hi Vincent,
On 29/03/2019 10:27, Vincent Massol wrote:
Hi devs,
I'd like to discuss about introducing a checker in the tests to fail the test if
there's a warning message about a deprecated APIs being used in scripts.
For example:
```
23:59:28.308 [main] INFO org.xwiki.test.ui.TestDebugger -
GroupIT-addUserAndSubgroupToGroup started
23:59:32.593 [Exec Stream Pumper] ERROR o.x.t.i.XWikiLogOutputStream - 2019-03-28
23:59:32,593
[
http://localhost:8080/xwiki/bin/view/XWiki/XWikiPreferences?xpage=getgroups…]
WARN o.x.v.i.DefaultVelocityEngine - Deprecated usage of method
[com.xpn.xwiki.plugin.rightsmanager.RightsManagerPluginApi.countAllMembersNamesForGroup]
in 21:/templates/getgroups.vm@62,37
23:59:35.824 [Exec Stream Pumper] ERROR o.x.t.i.XWikiLogOutputStream - 2019-03-28
23:59:35,824
[
http://localhost:8080/xwiki/bin/view/XWiki/XWikiPreferences?xpage=getgroups…]
WARN o.x.v.i.DefaultVelocityEngine - Deprecated usage of method
[com.xpn.xwiki.plugin.rightsmanager.RightsManagerPluginApi.countAllMembersNamesForGroup]
in 18:/templates/getgroups.vm@62,37
23:59:41.349 [Exec Stream Pumper] ERROR o.x.t.i.XWikiLogOutputStream - 2019-03-28
23:59:41,348
[
http://localhost:8080/xwiki/bin/view/XWiki/XWikiPreferences?xpage=getgroups…]
WARN o.x.v.i.DefaultVelocityEngine - Deprecated usage of method
[com.xpn.xwiki.plugin.rightsmanager.RightsManagerPluginApi.countAllMembersNamesForGroup]
in 21:/templates/getgroups.vm@62,37
23:59:58.503 [main] INFO org.xwiki.test.ui.TestDebugger -
GroupIT-addUserAndSubgroupToGroup passed
```
Rationale:
* This adds warnings in the xwiki logs when users navigate to those pages which isn’t
nice.
* It also helps reducing the number of deprecated methods we use (I have the feeling this
is not reducing) and helps us move towards being able to move the deprecated code to
legacy.
WDYT?
Is it possible to start by doing this in a specific job and see the result?
If there's not much to fix then we can fix them and add this to the main build.
I'm a bit afraid that we reproduce what happens with wcag: lots of failing test
coming and not much bandwidth to fix them all so starting to "accept" failing
tests where we shouldn’t.
We can do what we usually do for checks: we have the ability to enable/disable them per
module. So the strategy is:
* Enable the check by default
* Set it to not execute for all modules
* Check which modules pass when it’s enabled and remove the property from their pom.xml.
This allows to no longer have deprecation regressions in that module.
* Then start fixing the deprecations module per module and remove the property there too.
But first, we need to decide if we agree about doing this. Do you agree?
Thanks
-Vincent
Simon
Thanks
-Vincent
--
Simon Urli
Software Engineer at XWiki SAS
simon.urli(a)xwiki.com
More about us at
http://www.xwiki.com