[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#847555: marked as done (tracker.debian.org: Functional testing suite seems broken)



Your message dated Sat, 10 Dec 2016 21:43:28 +0100
with message-id <20161210204328.cnd35klzxi6sfo4q@home.ouaza.com>
and subject line Re: Bug#847555: tracker.debian.org: Functional testing suite seems broken
has caused the Debian Bug report #847555,
regarding tracker.debian.org: Functional testing suite seems broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
847555: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847555
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: tracker.debian.org
Severity: normal
Tags: patch

Dear Maintainer,

I wanted to work on some fixes for tracker.d.o. so i setup a stable kvm for better isolation but the functional
test suite seemed broken. Also the docs were missing the reference
to the driver.

I looked for the driver but it was not on stable/main so went for chromedriver. And the situation improved considireously. Then realized that improper method was used for closing the driver, leading to undesired spwaning of driver processes.

bests,

efkin.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From fb1098e4f74ef5a225b0dfc5fd206b06a8b33d21 Mon Sep 17 00:00:00 2001
From: efkin <efkin@riseup.net>
Date: Fri, 9 Dec 2016 11:44:00 +0100
Subject: [PATCH 1/2] Use chromedriver instead of firefoxdriver

The testing suite should be executable from within
debian stable.
---
 docs/setup/setup.rst      | 5 ++++-
 functional_tests/tests.py | 7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/docs/setup/setup.rst b/docs/setup/setup.rst
index eb0d116..9a4810c 100644
--- a/docs/setup/setup.rst
+++ b/docs/setup/setup.rst
@@ -24,6 +24,9 @@ Distro Tracker currently depends on the following Debian packages:
 - python-soappy (optional)
 - python-ldap (optional)
 - python-tox (for development only)
+- python-selenium (for development only)
+- chromedriver (for development only)
+- chromium (for development only)
 
 For Python2.7, the following additional packages are required:
 
@@ -32,7 +35,7 @@ For Python2.7, the following additional packages are required:
 
 Here is the list of required packages for development on Debian Jessie::
 
- $ sudo aptitude install python-django python-requests python-django-jsonfield python-django-debug-toolbar python-debian python-apt python-gpgme python-yaml python-bs4 python-soappy python-ldap python-pyinotify python-tox python-mock python-lzma python3-django python3-requests python3-django-jsonfield python3-django-debug-toolbar python3-debian python3-apt python3-gpgme python3-yaml python3-bs4 python3-pyinotify
+ $ sudo aptitude install python-django python-requests python-django-jsonfield python-django-debug-toolbar python-debian python-apt python-gpgme python-yaml python-bs4 python-soappy python-ldap python-pyinotify python-tox python-mock python-lzma python-selenium python3-django python3-requests python3-django-jsonfield python3-django-debug-toolbar python3-debian python3-apt python3-gpgme python3-yaml python3-bs4 python3-pyinotify python3-selenium chromium chromedriver
 
 .. _database_setup:
 
diff --git a/functional_tests/tests.py b/functional_tests/tests.py
index 5f60290..734fd67 100644
--- a/functional_tests/tests.py
+++ b/functional_tests/tests.py
@@ -46,9 +46,10 @@ class SeleniumTestCase(LiveServerTestCase):
     """
     def setUp(self):
         os.environ['NO_PROXY'] = 'localhost,127.0.0.1,127.0.1.1'
-        fp = webdriver.FirefoxProfile()
-        fp.set_preference('network.proxy.type', 0)
-        self.browser = webdriver.Firefox(firefox_profile=fp)
+
+        chromedriver = "/usr/lib/chromium/chromedriver"
+        os.environ["webdriver.chrome.driver"] = chromedriver
+        self.browser = webdriver.Chrome(chromedriver)
         self.browser.implicitly_wait(3)
         self.browser.set_page_load_timeout(3)
         self.browser.set_script_timeout(3)
-- 
2.1.4

>From c74e362d9168a80d58ad2d1d20e1a3e4844c1945 Mon Sep 17 00:00:00 2001
From: efkin <efkin@riseup.net>
Date: Fri, 9 Dec 2016 11:46:48 +0100
Subject: [PATCH 2/2] Selenium spawning too many driver's processes

According to documentation .quit() is the proper method
to close all existing tabs and exit the process.
---
 functional_tests/tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functional_tests/tests.py b/functional_tests/tests.py
index 734fd67..85689aa 100644
--- a/functional_tests/tests.py
+++ b/functional_tests/tests.py
@@ -55,7 +55,7 @@ class SeleniumTestCase(LiveServerTestCase):
         self.browser.set_script_timeout(3)
 
     def tearDown(self):
-        self.browser.close()
+        self.browser.quit()
 
     def get_page(self, relative):
         """
-- 
2.1.4


--- End Message ---
--- Begin Message ---
On Sat, 10 Dec 2016, efkin wrote:
> Thx! I'm attaching new patches in different order.

I merged your patch, except for the fourth which I fixed by not trying to
click on non-existing list items instead of adding the missing items. It's
not at all required to select architectures when we create a new
repository... the fixture just to add those architectures was a bit too
much for my taste and the other solution (serialized_rollback = True)
did not work out in the end either.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

--- End Message ---

Reply to: