[QGIS-Developer] [Qgis-community-team] QGIS documentation build is failing and is making me crazy. Heeellp!!!!

DelazJ delazj at gmail.com
Tue Jun 25 21:36:26 PDT 2019


Hi,

Would we not end up with a code in the code? That is, if we add layers, we
add fields, we rename fields for a chapter purpose, we'd need to have a
testcleanup section in which we revert each of the changes? Or do I
misunderstand what a testcleanup should look like?

I've seen that a file has been added when the framework was set up. What I
thought at that time is that it would be a file tests would call (if
needed) and process with and at the end of the page, it's reverted to its
initial state (and so are data), maybe within a testcleanup (should be a
smaller "same" code, right?) or a configuration in the framework (we
initialize the file before/after running each group/file). But i don't know
if that's possible, I'm not sure there's a code that uses it and I don't
know how accessible is this file from the test codes. Does anyone remember
what this file was created for?

Harrissou

Le mar. 25 juin 2019 à 17:17, Alexandre Neto <senhor.neto at gmail.com> a
écrit :

> On Tue, Jun 25, 2019 at 3:20 PM DelazJ <delazj at gmail.com> wrote:
>
>> How do we do this sanitization?
>>
>
> Deleting all variables in the end of each pycookbook file? or in the
> begining?  in a testcleanup directive.
>
> That would make sure no variable is reused on other tests.
>
> Alex
>
> On Tue, Jun 25, 2019 at 3:20 PM DelazJ <delazj at gmail.com> wrote:
>
>> Hi Alex,
>>
>> Thanks for checking
>>
>> Le mar. 25 juin 2019 à 16:02, Alexandre Neto <senhor.neto at gmail.com> a
>> écrit :
>>
>>> Hi,
>>>
>>> I have tried locally, and I got no failures on the 51 tests.
>>>
>>> There error is:
>>>
>>> Document: docs/pyqgis_developer_cookbook/cheat_sheet
>>> ----------------------------------------------------
>>> Application path not initialized
>>> **********************************************************************
>>> File "docs/pyqgis_developer_cookbook/cheat_sheet.rst", line 297, in default
>>> Failed example:
>>>     layers_names = []
>>>     for layer in QgsProject.instance().mapLayers().values():
>>>         layers_names.append(layer.name())
>>>     print("layers TOC = {}".format(layers_names))
>>> Expected:
>>>     layers TOC = ['layer name you like']
>>> Got:
>>>     layers TOC = ['Companies', 'layer name you like']
>>> **********************************************************************
>>> File "docs/pyqgis_developer_cookbook/cheat_sheet.rst", line 327, in default
>>> Failed example:
>>>     layers_names = [layer.name() for layer in QgsProject.instance().mapLayers().values()]
>>>     print("layers TOC = {}".format(layers_names))
>>> Expected:
>>>     layers TOC = ['layer name you like']
>>> Got:
>>>     layers TOC = ['Companies', 'layer name you like']
>>>
>>>
>>> It seems that the 'Companies' layer is added to the TOC in
>>> https://github.com/qgis/QGIS-Documentation/blob/6234bdcece8d5d94eb5acf7802dac13b289d65db/source/docs/pyqgis_developer_cookbook/expressions.rst#L151
>>>
>>> I bet the reason why sometimes it fails, and sometimes it doesn't is
>>> because doctest may not always follow the same order. Since we only want to
>>> test RST by RST, I think we should do some kind of sanitization at the end
>>> of each file.
>>>
>>> How do we do this sanitization?
>> In the commit you mention, which aimed to fix that issue (PR with
>> discussion at https://github.com/qgis/QGIS-Documentation/pull/3869), I
>> put the codes in a .. testcode:: group, thinking that will bound the
>> 'Companies' layer creation to that group only. Obviously a fail (though the
>> build succeeded locally and failed on travis the first time before
>> succeeding two times after close/reopen steps).
>> What's the purpose of group, then (
>> https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html)?
>> The order of doctest may indeed be random since providing the suggested
>> fix also fails (https://github.com/qgis/QGIS-Documentation/pull/3880)
>> with suggesting the current situation. :mad:
>>
>> Harrissou
>>
>>> Alex
>>>
>>>
>>> On Tue, Jun 25, 2019 at 11:58 AM DelazJ <delazj at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> For days now, master in QGIS-Documentation is failing [0]. For the same
>>>> reason, which has nothing to do with the writing system but the testing
>>>> framework for pyQGIS code. Issue is that the failure does not seeem to be
>>>> constantly reproducible.
>>>> In the link above, havatv-climbalongline and havatv-pointtolayer are
>>>> both based on master HEAD and none provides changes to code testing. One is
>>>> passing and the other one is failing. Actually both are reported failing in
>>>> doc repository [1]
>>>> The fixFailingTest2 branch, also based on master, provides a fix based
>>>> on the suggestion in Travis message. But it failed, and the suggested
>>>> solution would be ..... the current master state.
>>>>
>>>> I'm getting crazy so if someone wants to give it a look and bring the
>>>> repository to green, it would be nice.
>>>>
>>>> [0] https://travis-ci.org/qgis/QGIS-Documentation/branches
>>>> [1]
>>>> https://github.com/qgis/QGIS-Documentation/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc
>>>>
>>>> Thanks,
>>>> Harrissou
>>>> _______________________________________________
>>>> Qgis-community-team mailing list for organizing community resources
>>>> such as documentation, translation etc..
>>>> Qgis-community-team at lists.osgeo.org
>>>> https://lists.osgeo.org/mailman/listinfo/qgis-community-team
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190626/03f7ad12/attachment-0001.html>


More information about the QGIS-Developer mailing list