Testing tkinter on Linux
None of the linux buildbots run with X enabled. Consequently none of the tkinter (or tkinter user) gui tests are run on Linux. It was thus pointed out to me, during discussion of using ttk widgets in Idle, that we do not really know if ttk works on the variety of Linux systems (beyond the one Serhiy uses) and that I should look into this. I asked on python-list for help, by linux users running python3 -m test -ugui test_tk test_ttk_guionly test_idle Seven people did so with Debian Jessie, Debian Wheezy, Gentoo, Mint, openSUSE, and Ubuntu (x2). One machine failed once with the ttk test, and then passed. Another failed the tk test until a mis-configuration was fixed. So tkinter, and ttk in particular, seems to be working on linux. Do any of the core devs who run the test suite on Linux do so with -uall or -ugui? The gui tests above take about 10 seconds (mostly the tk test) on my machine, with some flashing boxes near the end. -- Terry Jan Reedy
On Thu, Aug 27, 2015 at 2:20 PM, Terry Reedy <tjreedy@udel.edu> wrote:
None of the linux buildbots run with X enabled. Consequently none of the tkinter (or tkinter user) gui tests are run on Linux. It was thus pointed out to me, during discussion of using ttk widgets in Idle, that we do not really know if ttk works on the variety of Linux systems (beyond the one Serhiy uses) and that I should look into this.
If it helps, my buildbot has full GUI services, so if there's a simple way to tell it to run the GUI tests every time, they should pass. ChrisA
On 8/27/2015 12:35 AM, Chris Angelico wrote:
On Thu, Aug 27, 2015 at 2:20 PM, Terry Reedy <tjreedy@udel.edu> wrote:
None of the linux buildbots run with X enabled. Consequently none of the tkinter (or tkinter user) gui tests are run on Linux. It was thus pointed out to me, during discussion of using ttk widgets in Idle, that we do not really know if ttk works on the variety of Linux systems (beyond the one Serhiy uses) and that I should look into this.
If it helps, my buildbot has full GUI services, so if there's a simple way to tell it to run the GUI tests every time, they should pass.
Somewhere your buildbot has a shell script to run that ends with a command to start the tests. The commands are echoed to the buildbot output. Here are two that I found. ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --timeout=3600 ... PCbuild\..\lib\test\regrtest.py" -uall -rwW -n --timeout 3600 (and python -m test ... should work) If the command has -ugui (included in -uall) *and* a graphics system can be initiated (X on Linux), then the gui resource is marked present and gui tests will run. -- Terry Jan Reedy
On Thu, 27 Aug 2015 14:24:36 -0400, Terry Reedy <tjreedy@udel.edu> wrote:
On 8/27/2015 12:35 AM, Chris Angelico wrote:
On Thu, Aug 27, 2015 at 2:20 PM, Terry Reedy <tjreedy@udel.edu> wrote:
None of the linux buildbots run with X enabled. Consequently none of the tkinter (or tkinter user) gui tests are run on Linux. It was thus pointed out to me, during discussion of using ttk widgets in Idle, that we do not really know if ttk works on the variety of Linux systems (beyond the one Serhiy uses) and that I should look into this.
If it helps, my buildbot has full GUI services, so if there's a simple way to tell it to run the GUI tests every time, they should pass.
Somewhere your buildbot has a shell script to run that ends with a command to start the tests. The commands are echoed to the buildbot output. Here are two that I found.
No, the master controls this.
./python ./Tools/scripts/run_tests.py -j 1 -u all -W --timeout=3600 ... PCbuild\..\lib\test\regrtest.py" -uall -rwW -n --timeout 3600 (and python -m test ... should work)
If the command has -ugui (included in -uall) *and* a graphics system can be initiated (X on Linux), then the gui resource is marked present and gui tests will run.
I believe gui depends on the existence of the DISPLAY environment variable on unix/linux (that is, TK will fail to start if DISPLAY is not set, so _is_gui_available will return False). You should be able to confirm this by looking at the text of the skip message in the buildbot output. It is possible to create a "virtual" X on an otherwise headless linux system, but I've never tried to do it myself. If someone comes up with a recipe we could add it to the devguide chapter on running a buildbot. --David
* R. David Murray <rdmurray@bitdance.com> [2015-08-27 15:00:40 -0400]:
It is possible to create a "virtual" X on an otherwise headless linux system, but I've never tried to do it myself. If someone comes up with a recipe we could add it to the devguide chapter on running a buildbot.
It's usually as easy as installing Xvfb and prepending "xvfb-run" to the command: $ export DISPLAY= $ python3 -m test -ugui test_tk test_ttk_guionly test_idle [1/3] test_tk test_tk skipped -- Tk unavailable due to TclError: couldn't connect to display "" [2/3] test_ttk_guionly test_ttk_guionly skipped -- Tk unavailable due to TclError: couldn't connect to display "" [3/3] test_idle 1 test OK. 2 tests skipped: test_tk test_ttk_guionly $ xvfb-run python3 -m test -ugui test_tk test_ttk_guionly test_idle [1/3] test_tk [2/3] test_ttk_guionly [3/3] test_idle All 3 tests OK. Florian -- http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/
On Fri, Aug 28, 2015 at 5:00 AM, R. David Murray <rdmurray@bitdance.com> wrote:
I believe gui depends on the existence of the DISPLAY environment variable on unix/linux (that is, TK will fail to start if DISPLAY is not set, so _is_gui_available will return False). You should be able to confirm this by looking at the text of the skip message in the buildbot output.
A recent buildbot log [1] shows that the GUI tests are being skipped, although I'm not seeing the message. Where do I go to set DISPLAY for the bot (which runs mostly in the background)? Note that it's all running as root, which may make a difference to the defaults, so this might have to be done more explicitly than it otherwise would. (But root is quite happy to use X; running xclock brings up a clock just fine.) [1] http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.5/builds/2... ChrisA
On Thu, Aug 27, 2015 at 4:13 PM, Chris Angelico <rosuav@gmail.com> wrote:
On Fri, Aug 28, 2015 at 5:00 AM, R. David Murray <rdmurray@bitdance.com> wrote:
I believe gui depends on the existence of the DISPLAY environment variable on unix/linux (that is, TK will fail to start if DISPLAY is not set, so _is_gui_available will return False). You should be able to confirm this by looking at the text of the skip message in the buildbot output.
A recent buildbot log [1] shows that the GUI tests are being skipped, although I'm not seeing the message. Where do I go to set DISPLAY for the bot (which runs mostly in the background)?
Note that it's all running as root, which may make a difference to the defaults, so this might have to be done more explicitly than it otherwise would. (But root is quite happy to use X; running xclock brings up a clock just fine.)
I just set up a buildslave building with X available [1]. I don't know if the way I did it is strictly correct, but my slave is set up with Xvfb set to start at boot, and I hacked the buildbot.tac file to add 'os.environ["DISPLAY"] = ":100"' (which is what Xvfb starts on) as that was the simplest way I could figure out to do it. It seems to work; an initial test build of 2.7 passed all the Tcl/Tk tests [2]. For those interested, the slave has Tcl/Tk 8.5.17 installed (which is the latest "stable" release in portage). [1] http://buildbot.python.org/all/buildslaves/ware-gentoo-x86 [2] http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%... -- Zach
participants (5)
-
Chris Angelico
-
Florian Bruhin
-
R. David Murray
-
Terry Reedy
-
Zachary Ware