Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPMVm-0005uR-2F for pgadmin-hackers@arkaria.postgresql.org; Tue, 19 Jul 2016 04:20:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bPMVl-0000qG-Lb for pgadmin-hackers@arkaria.postgresql.org; Tue, 19 Jul 2016 04:20:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bPMVY-0000cB-62 for pgadmin-hackers@postgresql.org; Tue, 19 Jul 2016 04:19:48 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bPMVS-0004k6-Kh for pgadmin-hackers@postgresql.org; Tue, 19 Jul 2016 04:19:47 +0000 Received: by mail-lf0-x234.google.com with SMTP id b199so3982214lfe.0 for ; Mon, 18 Jul 2016 21:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dfZPk+uDxVvSTfS3r71rF+iVsI4uhd637OtlE2wiCr0=; b=R5F/dkzvHdaqZXdcJOIX73gSfb7opAt27+Z036U45g+fagT165x1zLI6rOe992zALH VuTpQJatYUvIz7Kxkjwg1cOCi7bDHq1Z3XvmFhxAzNh7kCRK4QOJJRpWwEVQlSbXn3PD A9r983B1FAZau6riWmGE9frSeeKIM7/YjUWF4R7UgX8HWaZ3TiaFVzYsvR7tfrzzIOeS tMUz3TuhW2ehh7Dn2K2uPLKFtBpji2IkQipnuXkqbfkdrkCjyuU+Q5usKBjd6D03IDuq QrUd8t2Lt1Vuy3Y5IAmVncvX4TIrVrJm8bKWzO+m60qiei/RV6GAhPnqvMTDi9TCV5cu wDng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dfZPk+uDxVvSTfS3r71rF+iVsI4uhd637OtlE2wiCr0=; b=X3pij9LKxaHTVzSqn8G4fg/J04O3e5v5i47NwCq7L+dOjJYP1E7RtyejZX/CYS7Vo9 1PYgX14yqORjozuS0/5WEv4tnOPZqSrlenvgmr6/t0v3jOW9oruP9ZzxuIcyZAHYd45/ 5RCXfoR6mBsYhzPhFU/gAmJu0Xk/2ZIASeAEo5Cgbgw9J7EV1gJz/4XpFVRXEaFIlvzY ONjdd8UUEqcSziI4XoAhKVzfBfYEOLP2EvPoZepMIS/kQKmLBN1qBgVdQzTQIOWn7mXJ WwCMJTpOAu0ukbMmKfwe5nflcJIrB2ia7++59CEKu4D1iQ9EbSD/Ijk4r35t0rlm+1yw JCBg== X-Gm-Message-State: ALyK8tIL/5SYn+OHQ8P+RFLabonFtgXhQwzUaF1Dxy7pARCdDi3LmusMrL1Ii4CaYCgGwATObevJSI7D4a3tlEK1 X-Received: by 10.46.0.17 with SMTP id 17mr15757458lja.54.1468901979322; Mon, 18 Jul 2016 21:19:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.27.75 with HTTP; Mon, 18 Jul 2016 21:19:38 -0700 (PDT) In-Reply-To: References: From: Khushboo Vashi Date: Tue, 19 Jul 2016 09:49:38 +0530 Message-ID: Subject: Re: pgAdmin IV : Unittest modular patch To: Dave Page Cc: Navnath Gadakh , pgadmin-hackers , Kanchan Mohitey Content-Type: multipart/alternative; boundary=001a1142af6cb00bac0537f564ba X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a1142af6cb00bac0537f564ba Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Navnath, I have just ran the automated test cases, I noticed that the login test-case gets called (which actually post data and gets logged-in) each time before every test case runs. I think this should not happen, user login should be done only once. Thanks, Khushboo On Mon, Jul 18, 2016 at 7:25 PM, Dave Page wrote: > Thanks - applied with some tweaks and changes, most notably: > > - "--pkg all" is the default if no command line options are given. > > - Output now goes in regression/regression.log > > - Terminal output is limited to WARNINGS from the app server. > > - The runner script is now python regression/runtests.py > > On Mon, Jul 18, 2016 at 1:45 PM, Navnath Gadakh > wrote: > > Hi Dave, > > > > Please find the revised patch for unit tests of pgAdmin4 APIs. > > > > This patch includes- > > > > test_advance_config.json(for user it=E2=80=99s test_advance_config.json= .in) for > > advance test configuration for database/server(Priyanka was working on > this) > > > > test_config.json(for user it=E2=80=99s test_config_json.in) for basic > credentials > > data for database/server > > > > From now onward we can execute test cases node wise/package wise. I hav= e > > slightly modified the way of running the testsuite. We used the command > line > > arguments(pkg) which denotes for which package testsuite going to run. > > > > > > Run the testsuite for all packages by following command > > > > Python regression/testsuite.py --pkg all > > > > Here, =E2=80=98all=E2=80=99 means for all python > > packages(i.e.browser,server_groups,server, > > > > databases etc. which are same names in > project > > directory structure) > > > > This will find the =E2=80=98tests=E2=80=99 directory in = each package & > > execute the test cases. > > > > > > > > Run the testsuite for single package by following command > > > > Python regression/testsuite.py --pkg browser (this execute the > tests > > in =E2=80=98browser=E2=80=99 package only) > > > > Python regression/testsuite.py --pkg > > browser.server_groups.servers.databases (this execute the tests in > > =E2=80=98databases=E2=80=99 package only) > > > > 4. Logger file. Which include the detailed output of the testsuite. > > Testsuite also prints the test summary on the console. > > > > 5. Previously, we set the priority to each test case. In this patc= h > > priority logic is removed as there is no need to set priority. > > > > 6. Resolution of AttributeError for attribute 'APP_ROOT'(Which is > > mentioned by you in a previous email) > > > > > > Note: You might get =E2=80=98AttributeError=E2=80=99 while running this= patch on Python > 3.4 > > (I have raised this bug in RM(#1464)), But still you can run the > testsuite. > > It will run on Python 2.7 without error. > > > > > > > > On Fri, Jul 15, 2016 at 6:23 PM, Dave Page > > wrote: > >> > >> Hi > >> > >> On Mon, Jul 11, 2016 at 2:16 PM, Navnath Gadakh > >> wrote: > >>> > >>> Hi Dave, > >>> PFA updated patch for modular API test cases. > >>> > >>> On Mon, Jul 11, 2016 at 5:11 PM, Dave Page > > >>> wrote: > >>>> > >>>> > >>>> > >>>> On Fri, Jul 8, 2016 at 2:30 PM, Navnath Gadakh > >>>> wrote: > >>>>> > >>>>> > >>>>> Hi Dave, > >>>>> > >>>>> PFA patch for modular API test cases. > >>>>> > >>>>> Kindly, review the same and let me know for any modification. > >>>> > >>>> > >>>> Please re-create the patch so that it doesn't revert various changes > >>>> made to config.py etc. over the last couple of weeks. > >>> > >>> > >>> config.py file was not updated at my end, I have updated it in the > >>> current patch. I have also added code related to advance test data > >>> configuration which was created by Priyanka (Seprated the test data > >>> configuration files). > >>> > >>>> > >>>> What is the patch for? Is it fixing issues in Priyanka's last patch, > or > >>>> something else? > >>>> This patch is for - > >>>> 1. Now we can run testsuite node/module wise(like for browser only, > for > >>>> databases only) OR for all nodes/modules > >>>> 2. I have modified the existing functionality for testsuite and all > test > >>>> case classes (Made all test cases independently runnable, removed th= e > >>>> priority logic). > >>> > >>> > >>> > >>> For more details please refer the file 'regression/README'. > >> > >> > >> When running all tests, I get: > >> > >> ... > >> ... > >> ' (HEAD, OPTIONS, GET) -> redirects.static>= , > >> ' (HEAD, OPTIONS, GET) -> backup.static>, > >> ' (HEAD, POST, OPTIONS, GET) -> > >> security.reset_password>, > >> ' (HEAD, OPTIONS, GET) -> about.static>]) > >> Traceback (most recent call last): > >> File "regression/testsuite.py", line 151, in > >> suite =3D get_suite(args, test_client) > >> File "regression/testsuite.py", line 75, in get_suite > >> TestsGeneratorRegistry.load_generators('pgadmin') > >> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/route.py", line 56= , > in > >> load_generators > >> module =3D import_module(module_name) > >> File > >> > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/i= mportlib/__init__.py", > >> line 37, in import_module > >> __import__(name) > >> File > >> > "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/data= bases/tests/test_db_add.py", > >> line 14, in > >> from regression import test_utils as utils > >> File "/Users/dpage/git/pgadmin4/web/regression/test_utils.py", line > 23, > >> in > >> def get_ids(url=3Dconfig.APP_ROOT + '/regression/parent_id.pkl'): > >> AttributeError: 'module' object has no attribute 'APP_ROOT' > >> > >> That's not overly surprising, as we don't have an APP_ROOT setting in > the > >> config (nor should we - it should be calculated dynamically). Please > fix, > >> and remember to test your patches against a clean copy of the git tree > in > >> the future! > >> > >> Thanks! > >> > >> -- > >> Dave Page > >> VP, Chief Architect, Tools & Installers > >> EnterpriseDB: http://www.enterprisedb.com > >> The Enterprise PostgreSQL Company > >> > >> Blog: http://pgsnake.blogspot.com > >> Twitter: @pgsnake > > > > > > > > > > -- > > Thanks, > > Navnath Gadakh > > Software Engineer > > EnterpriseDB Corporation > > Mobile: +91 9975389878 > > > > > > > > -- > Dave Page > VP, Chief Architect, Tools & Installers > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > > -- > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > --001a1142af6cb00bac0537f564ba Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Navnath,

I have just ran the automat= ed test cases, I noticed that the login test-case gets called (which actual= ly post data and gets logged-in) each time before every test case runs. I t= hink this should not happen, =C2=A0user login should be done only once.

Thanks,
Khushboo

On Mon, Jul 18, 2016 at 7:25 PM,= Dave Page <dave.page@enterprisedb.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">Thanks - applied with some tweaks and changes= , most notably:

- "--pkg all" is the default if no command line options are given= .

- Output now goes in regression/regression.log

- Terminal output is limited to WARNINGS from the app server.

- The runner script is now python regression/runtests.py

On Mon, Jul 18, 2016 at 1:45 PM, Navnath Gadakh
<navnath.gadakh@enterprisedb.com> wrote:
> Hi Dave,
>
>=C2=A0 =C2=A0Please find the revised patch for unit tests of pgAdmin4 A= PIs.
>
> This patch includes-
>
> test_advance_config.json(for user it=E2=80=99s test_advance_c= onfig.json.in) for
> advance test configuration for database/server(Priyanka was working on= this)
>
> test_config.json(for user it=E2=80=99s test_config_json.in) for b= asic credentials
> data for database/server
>
> From now onward we can execute test cases node wise/package wise. I ha= ve
> slightly modified the way of running the testsuite. We used the comman= d line
> arguments(pkg) which denotes for which package testsuite going to run.=
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Run the testsuite for all pack= ages by following command
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Python regressi= on/testsuite.py --pkg all
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Here, =E2=80=98all=E2=80=99 means for all py= thon
> packages(i.e.browser,server_groups,server,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0databases etc. which are same names in pr= oject
> directory structure)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 This will find = the =E2=80=98tests=E2=80=99 directory in each package &
> execute the test cases.
>
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Run the testsuite for single p= ackage by following command
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Python regression/testsuite.py --pkg browser= (this execute the tests
> in =E2=80=98browser=E2=80=99 package only)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Python regression/testsuite.py --pkg
> browser.server_groups.servers.databases (this execute the tests in
> =E2=80=98databases=E2=80=99 package only)
>
>=C2=A0 =C2=A04.=C2=A0 Logger file. Which include the detailed output of= the testsuite.
> Testsuite also prints the test summary on the console.
>
>=C2=A0 =C2=A0 =C2=A05.=C2=A0 Previously, we set the priority to each te= st case. In this patch
> priority logic is removed as there is no need to set priority.
>
>=C2=A0 =C2=A0 =C2=A06. Resolution of AttributeError for attribute '= APP_ROOT'(Which is
> mentioned by you in a previous email)
>
>
> Note: You might get =E2=80=98AttributeError=E2=80=99 while running thi= s patch on Python 3.4
> (I have raised this bug in RM(#1464)), But still you can run the tests= uite.
> It will run on Python 2.7 without error.
>
>
>
> On Fri, Jul 15, 2016 at 6:23 PM, Dave Page <dave.page@enterprisedb.com>
> wrote:
>>
>> Hi
>>
>> On Mon, Jul 11, 2016 at 2:16 PM, Navnath Gadakh
>> <navnath.gad= akh@enterprisedb.com> wrote:
>>>
>>> Hi Dave,
>>> PFA updated patch for modular API test cases.
>>>
>>> On Mon, Jul 11, 2016 at 5:11 PM, Dave Page <dave.page@enterprisedb.com>
>>> wrote:
>>>>
>>>>
>>>>
>>>> On Fri, Jul 8, 2016 at 2:30 PM, Navnath Gadakh
>>>> <nav= nath.gadakh@enterprisedb.com> wrote:
>>>>>
>>>>>
>>>>> Hi Dave,
>>>>>
>>>>> PFA patch for modular API test cases.
>>>>>
>>>>> Kindly, review the same and let me know for any modifi= cation.
>>>>
>>>>
>>>> Please re-create the patch so that it doesn't revert v= arious changes
>>>> made to config.py etc. over the last couple of weeks.
>>>
>>>
>>>=C2=A0 =C2=A0config.py file was not updated at my end, I have u= pdated it in the
>>> current patch.=C2=A0 I have also added code related to advance= test data
>>> configuration which was created by Priyanka (Seprated the test= data
>>> configuration files).
>>>
>>>>
>>>> What is the patch for? Is it fixing issues in Priyanka'= ;s last patch, or
>>>> something else?
>>>> This patch is for -
>>>> 1. Now we can run testsuite node/module wise(like for brow= ser only, for
>>>> databases only)=C2=A0 OR for all nodes/modules
>>>> 2. I have modified the existing functionality for testsuit= e and all test
>>>> case classes (Made all test cases independently runnable, = removed the
>>>> priority logic).
>>>
>>>
>>>
>>>=C2=A0 =C2=A0 =C2=A0For more details please refer the file '= ;regression/README'.
>>
>>
>> When running all tests, I get:
>>
>> ...
>> ...
>>=C2=A0 <Rule '//static/<filename>' (HEAD, OPTIONS,= GET) -> redirects.static>,
>>=C2=A0 <Rule '/backup/<filename>' (HEAD, OPTIONS, = GET) -> backup.static>,
>>=C2=A0 <Rule '/reset/<token>' (HEAD, POST, OPTIONS= , GET) ->
>> security.reset_password>,
>>=C2=A0 <Rule '/about/<filename>' (HEAD, OPTIONS, G= ET) -> about.static>])
>> Traceback (most recent call last):
>>=C2=A0 =C2=A0File "regression/testsuite.py", line 151, in= <module>
>>=C2=A0 =C2=A0 =C2=A0suite =3D get_suite(args, test_client)
>>=C2=A0 =C2=A0File "regression/testsuite.py", line 75, in = get_suite
>>=C2=A0 =C2=A0 =C2=A0TestsGeneratorRegistry.load_generators('pga= dmin')
>>=C2=A0 =C2=A0File "/Users/dpage/git/pgadmin4/web/pgadmin/utils= /route.py", line 56, in
>> load_generators
>>=C2=A0 =C2=A0 =C2=A0module =3D import_module(module_name)
>>=C2=A0 =C2=A0File
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib= /python2.7/importlib/__init__.py",
>> line 37, in import_module
>>=C2=A0 =C2=A0 =C2=A0__import__(name)
>>=C2=A0 =C2=A0File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/= servers/databases/tests/test_db_add.py",
>> line 14, in <module>
>>=C2=A0 =C2=A0 =C2=A0from regression import test_utils as utils
>>=C2=A0 =C2=A0File "/Users/dpage/git/pgadmin4/web/regression/te= st_utils.py", line 23,
>> in <module>
>>=C2=A0 =C2=A0 =C2=A0def get_ids(url=3Dconfig.APP_ROOT + '/regre= ssion/parent_id.pkl'):
>> AttributeError: 'module' object has no attribute 'APP_= ROOT'
>>
>> That's not overly surprising, as we don't have an APP_ROOT= setting in the
>> config (nor should we - it should be calculated dynamically). Plea= se fix,
>> and remember to test your patches against a clean copy of the git = tree in
>> the future!
>>
>> Thanks!
>>
>> --
>> Dave Page
>> VP, Chief Architect, Tools & Installers
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>
>
>
>
> --
> Thanks,
> Navnath Gadakh
> Software Engineer
> EnterpriseDB Corporation
> Mobile: +91 9975389878
>
>



--
Dave Page
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake


--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers=

--001a1142af6cb00bac0537f564ba--