New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced bootstrap.min.css and bootstrap.min.js files with version 4. #397
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sphinx 3.0.x's advice for how to resolve the duplication is misleading here. There are actually two instances of get_root
that get pulled into the rendered docs, one of which does not have a link to it.
There are at least three ways to resolve the error, each of which has its own impacts.
- Remove the duplicate entries
.. automethod:: translate
and.. automethod:: get_root
on lines 20 and 22. I prefer this option because it preserves the index entries and links to the methods, removes the duplicates from the rendered docs, and sorts all methods alphabetically. - Add the methods to their class's
:exclude-members: get_root, translate
options. This option has the same affect as option 1, except it preserves relative importance of the listing of methods. It's the best option if you don't care about alphabetic sorting, and prefer some logical or "importance sorting". :noindex:
merely removes the link to and index entry of the duplicate item, leaving it duplicated in the rendered docs. This is definitely not the correct option.
Also assuming you are hitting the other warnings:
deform/field.py:docstring of deform.Field:87: WARNING: term resource registry not found in case sensitive match.made a reference to Resource registry instead.
You can solve this with -D suppress_warnings=ref.term
in tox.ini
. See discussion at Pylons/pyramid#3577 (comment). IOW, I want to see those specific warnings when I do make html
, but not when building in tox or CI. This type of warning is only important if you care about things like MySQL
the database versus mysql
the command and each term and its definition should be unique in the Glossary. We don't have anything like that in any of our docs, so it is OK to suppress the warning when building the docs, but it is helpful for the developer in case there is some typographical conflict.
As far as those two failing tests, I'm not entirely sure how to fix them. Sometimes a |
@stevepiercy I have removed both get_root and translate from api.rst. https://travis-ci.org/github/Pylons/deform/jobs/680376151#L327 No source for code: '/home/travis/build/Pylons/deform/deform/checkbox_32bb822ccaed554768253405d5135c00.py'. suggested fix is adding -i, but to which line ? |
I just saw a similar error in pyramid_zcml in the past week, but that suggested fix is not quite right. The best fix is to put into In this case, |
After some research, apparently coverage error 'No source for code' is related to a deleted file and related left oever .pyc, either in local repository, or in travis docker test environment server. |
Got link to research? I don't think it is a |
There is a duplicate entry in renderer
A function which accepts a logical template name and a set of
keywords, with the signature ``(template_name, **kw)``, and
which returns the rendering of a deform widget template. |
Try copying the |
Replaced the renderer as you suggested, but there is bigger problem in rebuilding the doc. term resource registry not found in case sensitive match. How about ignoring the warnings instead of considering it error ? And there are random missing files started to show up under the coverage. |
Actually we might now need to specify the source for running coverage on deform. Example from pyramid_zcml:
By the way, are you running |
See earlier comment: #397 (review)
That will have no effect on the actual failures, as it is merely an output format. See coverage docs and coverage summary. |
What is going on with that coverage failure? 😕 Note that the file name changes between runs.
I think my earlier suggestion, try to fix with |
Omit is correct, but more files are showing up and since they are in deform directory can not use wild card on directory. not sure if test procedure is creating them or they are simply left over .pyc from last build. |
That's why I suggest specifying source per the example above. I don't think |
Actually, why are we even bothering to cover Python 2.7? Let's drop it. Then we don't have to merge py27 with py36 coverage for overall coverage, and can just look at py36. Problem solved! Compare the branches |
Removed python 2.7 and basepython and passed the test. |
A test needs to be written in For |
@stevepiercy it's time to upgrade Firefox version 43 to newest version: Developers won't be able to duplicate this environment on their local server, since Firefox version 43 can't be started on newer versions of Debian. wondering what OS version are you using to start Firefox 43 ? Tests are throwing errors unrelated to upgrading bootstrap, mostly timing issues, like option is not clickable, There is wait for findid, but not for options within select, and there is problem running tests within tox due to version mismatch between Firefox, geckodriver and Tox. |
Using Python Mock library, to replace the default template with Jinja2, and test if variable or expression syntax works using Jinja2, or even if the new template directory shows up in template search path ? |
@sydoluciani for Firefox v43, I know there is some history behind it but I don't recall what it was. I agree that it should be upgraded, if possible. Perhaps @miohtama @ericof @domenkozar has knowledge of this? I asked in the web sauna Gitter channel, too. |
For overriding the default templates, we can use Chameleon. It's not as easy as Jinja2 syntax, but it is not awful and it would be consistent. Otherwise, I think that would be a good way to test the override. |
According to #305 it seems like it could be bumped. |
Thanks @domenkozar. That nudged me forward for Travis. It also jogged my memory to look in https://github.com/Pylons/deform/blame/master/CONTRIBUTING.rst#L50 (who wrote that?) 😝 . @sydoluciani try downloading the latest Firefox Extended Support Release (ESR), and following the rest of the instructions in CONTRIBUTING.rst. If it works for both you and me, then we can update that doc. |
I tried downloading the FF ESR latest, setting This answer on SO looks promising. It looks like several requirements need to be updated to get it to work. I've used up my open source time for the day. I'll try to pick this up later, but if anyone definitively fixes it, I'd appreciate it.
|
@stevepiercy Selenium version installed in tox environment was different to what it was installed in other virtual environment. .tox/functional3/bin/pip list | grep -i selenium Changing selenium<3 to selenium>3 in two files and rerun the test is a success: If Xvfb is being used, tests still might fail due to exceeding speed on running all tests against pserve server. pserve server become unresponsive due to number of requests it receives, but I didn't have such problem using Xwindows, since tests are running slower in Xwindows environment. |
Yes, That is a quick guide to install all required software to start Firefox with Selenium webdriver, however FIREFOX_PATH needs to be pointed to firefox executable as well. And geckodriver can be extracted to different directory instead of moving it to /usr/local/bin/, then add the directory to the PATH, so it cant be found and setting WEBDRIVER to geckodriver to executable file.
|
@stevepiercy I have updated the CONTRIBUTING.rst with debian version, can you please go over the installation and see if there is any step missed in procedure. |
Hey, instead of trying to make a local browser work, why not update the tests to instead use the Selenium Remote protocol and use a docker container that contains the browser, pre-packed with Selenium server? For example: https://hub.docker.com/r/selenium/standalone-firefox I used this successfully in the past to build a package for use with What it did is start up a Selenium docker image, then had the test suite connect to said Selenium and do the thing. The same principle applies here. Spin up the selenium docker container (which will work nicely in CI too), connect to it, and run tests. |
Wrap it all nicely into a docker-compose for the functional tests, even better. |
And other Pylon projects can use the same Selenium image for their testing. very good idea. |
@sydoluciani is the Docker container something you can work on? I have no idea how to implement @bertjwregeer's suggestion. I'll hold off on my review of the CONTRIBUTING.rst docs revision for now. |
We have to fix the failed tests regardless of current setup or using Selenium server. Currently there is 9 failures and 5 errors which is consistent with previous tests, and I can use your help to fix them. Let's continue with current setup and upgrade the firefox which is the easier task, then fix the failed tests to merge your branch with master and use bootstrap 4 wihch is the priority. |
Selenium docker can be started on demand within Travis CI before tests start. Then functional tests has to be modified to instantiate webdriver.Remote instead of webdriver.Firefox to send the tests to remote Selenium-Firefox that just started instead of testing on local Selenium-Firefox. https://gist.github.com/dzitkowskik/0fc641cf59af0dc3de62#remote-selenium-server Now the advantage of such setup is having a ready to use Selenium driver and browser, but to take full advantage, one has to setup a Selenium server as a hub, and different selenium nodes to run different browser on different OS to be able to run tests against them, which at that point one would want to have dedicated docker rather than on demand, to run all Pylons projects web tests against the hub instead of individual Selenium setup. Check out these links: These are on top of fixing current failed tests that needs to be fixed regardless. |
No, we don't need to set up selenium server or anything along those lines. We can spin up docker containers inside CI, and run tests. Whether that remote is Firefox or Chrome won't matter, that's the beauty of it. I have no interest in managing a selenium anything. Just avoiding the mess we have right now. |
@sydoluciani I followed your guidance in your version of CONTRIBUTING.rst but for macOS. I got it to work for me. Good work! And it is reasonably fast. I don't have Linux Debian except in VMs, so I cannot easily verify it, but... ...note that we now put "how to contribute" stuff into contributing.md for Pylons Project projects. I will update that in a separate PR for both macOS and Linux, collecting both of our notes into one file for review. Now when I run |
@stevepiercy thats great. I get the same result either using Xvfb or Xwindows: FAILED (errors=5, failures=9) , no skiped though. I am working on errors and stuck with first one since yesterday, you can start with failures. With a quick pick at failures, it might be just as simple as number arrow keys being sent too many, too few or maybe not being sent at all, and that can be easily verified by viewing at browser. |
I just did a quick test, and number of left arraw keys being sent is correct, but some how the sent number being lost in first position, it works in other positions. FAIL: test_type_bad_input (deformdemo.test.TextInputMaskTests) And FAIL: test_submit_filled (deformdemo.test.MoneyInputWidgetTests) |
The good news is, this pull requests is using Bootstrap 4, and getting the same number of errors your pull request generated, so once we fix functional tests then the deform upgrade is done. The bad news is, from looking at the errors or failures, problem mainly is Selenium and how it is dealing with browser. everything works when working with actual browser. @stevepiercy would you like to complete test against deform/schema.py and push your pull request, by then I might find solution to some of the functional tests as it seems most of them follow the same pattern, and we have to find a work around. Thanks |
I have fixed 7 of the 9 functional test failures. Had to send a new pull request to Deformdemo to reflect changes in Deform functional tests. https://github.com/sydoluciani/deformdemo/blob/bootstrap4_test/deformdemo/test.py#L84 @stevepiercy Deformdemo tests are using Firefox 45, and they are failing to start xvfb. |
@sydoluciani I think we need to bring deformdemo up to the same environment as deform, per the change in how xvfb is started in Travis since Jan 2019. We also need to drop Python 2 from deformdemo to align with deform. |
Will be completed in #403. |
#355
First step in upgrading bootstrap 3 to bootstrp 4.
Replaced bootstrap.min.css and bootstrap.min.js files with version 4.