Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUAQM-00007w-SI for pgadmin-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 10:26:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bUAQL-0004Zy-Mp for pgadmin-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 10:26:17 +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 1bUAQJ-0004Yz-Qi for pgadmin-hackers@postgresql.org; Mon, 01 Aug 2016 10:26:15 +0000 Received: from mail-it0-x22a.google.com ([2607:f8b0:4001:c0b::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bUAQA-0007J1-VF for pgadmin-hackers@postgresql.org; Mon, 01 Aug 2016 10:26:15 +0000 Received: by mail-it0-x22a.google.com with SMTP id f6so166298132ith.0 for ; Mon, 01 Aug 2016 03:26:06 -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:content-transfer-encoding; bh=WRRg/+8p2+IkfF23DRG1cEBwtsHY8qwLWwThExE90Xg=; b=ATFgS/26NWF8MkXQQTBsqOQtJulWKFysQy4KtAHUS/ItOAgAh83pT7J5MF9qRjq2Bd vILUKNGBk0ko3DbOHWpeKw2VNo3u7hcKyrAIkXbdZyDNYyaF47v4S+Ox7Gql0uxiHy5K UqxJitWk125f/da/3GUUB9TNR9RAIw0QESVdgdwMp4mXs2IORgStmSmzOkHcnvltS1Sx y5obn57KiYeRTiipqXXRn9hCve5Vgi/KQGC4zdsV0QD/WTu/0+nVlM2nduUMrz5R7pQL cC/zCB55aEF8y78Zsk9txqq3m4yg0CrtKUCCkb3eHKhlTcLF9VpNhugJolZ9BUNru60b BJgw== 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:content-transfer-encoding; bh=WRRg/+8p2+IkfF23DRG1cEBwtsHY8qwLWwThExE90Xg=; b=TPZjP9VHfOV+eNU60cywNLfK04k68C/Mn+4LdXlmBAgL8UeHCifjNEq3bxwts50o8B Z304P8Piv5ghcUfc8R0feD9JdPJx3DG8qIZCXaS7bXrYxkFrcKwDSSZQUH6AInXBEc9a 9y1pTNgGcwIGEPmuHM1sa1gPF6/nr0q61DK4HDwoBQJVizonFjxjp387gFd5vK9eGeFW JsSbM+pJc5w2amKrkNFEtKZZh7JSon1d8t2QqdWqWzK1uFx1TCnYdMPmZCRTU/ityMad ZYzvyC/HNQ5H0BK9lH8TfDxwsORwCKjP2XNG6v6Cezs48ZXvNXRI4qu/wWCuG31pFsWW 3XJQ== X-Gm-Message-State: AEkooutyaiBS1Hjk9tod6wzAHOKzEDIlJkwHUkHcsWEv9Jtx85rDBtXt5VMlbxFAZA6oAiilobOIUpPxDN3ROGn5GlmUCDgFncuelXtjlWztYOWDLsVTMtAs385wOC2WMQswwW9U7o+6i4ElPT3E/MJTv1nrIFG8AhnGQS82cvg7uRJHHZYdfblm/7fQNi8Fa2R9vWLovA== X-Received: by 10.36.0.6 with SMTP id 6mr12212634ita.15.1470047164417; Mon, 01 Aug 2016 03:26:04 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id o5sm7524099ith.20.2016.08.01.03.26.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 03:26:03 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id j8so37778668itb.1 for ; Mon, 01 Aug 2016 03:26:03 -0700 (PDT) X-Received: by 10.36.103.214 with SMTP id u205mr12937983itc.88.1470047163153; Mon, 01 Aug 2016 03:26:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.208.97 with HTTP; Mon, 1 Aug 2016 03:26:01 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Mon, 1 Aug 2016 11:26:01 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pgAdmin IV : Unittest modular patch To: Navnath Gadakh Cc: pgadmin-hackers , Kanchan Mohitey Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Hi On Mon, Aug 1, 2016 at 10:54 AM, Navnath Gadakh wrote: > Hi Dave, > > On Mon, Aug 1, 2016 at 3:17 PM, Dave Page wr= ote: >> On Thu, Jul 28, 2016 at 8:12 AM, Navnath Gadakh >> wrote: >>> Thanks Dave! >>> >>> On Wed, Jul 27, 2016 at 8:12 PM, Dave Page = wrote: >>>> Ahh, that explains it. Nice catch! It's working in both server and >>>> desktop modes now :-). >>>> >>>> I've committed the patch, but can you please look at the following iss= ues: >>>> >>>> 1) When testing SMTP, the encoded password used to connect to the >>>> server is displayed in both the logs and stdout (the "send: 'AUTH >>>> PLAIN ....'" lines). Can you catch that, and replace it with *'s >>>> please? Sooner or later someone will reveal a password otherwise. > Could you please send me your's regression.log file. While > testing SMTP I didn't see encoded password displayed on both logs and > stdout. Here's an extract from stdout (with the encoded password replaced with xxxxxx). I don't actually see the same in regression.log, but that may be because of the log settings I'm using - we should filter the same from there though to be safe: ... This function checks reset password functionality. (TestCase for Validating Valid_Email) ... send: 'ehlo piranha.ox.uk.enterprisedb.com\r\n' reply: '250-smtp.gmail.com at your service, [194.73.70.210]\r\n' reply: '250-SIZE 35882577\r\n' reply: '250-8BITMIME\r\n' reply: '250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH\r= \n' reply: '250-ENHANCEDSTATUSCODES\r\n' reply: '250-PIPELINING\r\n' reply: '250-CHUNKING\r\n' reply: '250 SMTPUTF8\r\n' reply: retcode (250); Msg: smtp.gmail.com at your service, [194.73.70.210] SIZE 35882577 8BITMIME AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH ENHANCEDSTATUSCODES PIPELINING CHUNKING SMTPUTF8 send: 'AUTH PLAIN xxxxxx\r\n' reply: '235 2.7.0 Accepted\r\n' reply: retcode (235); Msg: 2.7.0 Accepted send: u'mail FROM: size=3D1122\r\n' reply: '250 2.1.0 OK v26sm44372678pfi.41 - gsmtp\r\n' reply: retcode (250); Msg: 2.1.0 OK v26sm44372678pfi.41 - gsmtp send: u'rcpt TO:\r\n' reply: '250 2.1.5 OK v26sm44372678pfi.41 - gsmtp\r\n' reply: retcode (250); Msg: 2.1.5 OK v26sm44372678pfi.41 - gsmtp send: 'data\r\n' reply: '354 Go ahead v26sm44372678pfi.41 - gsmtp\r\n' reply: retcode (354); Msg: Go ahead v26sm44372678pfi.41 - gsmtp data: (354, 'Go ahead v26sm44372678pfi.41 - gsmtp') send: 'Content-Type: multipart/mixed; boundary=3D"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D594734060983746810= 5=3D=3D"\r\nMIME-Version: 1.0\r\nSubject: Password reset instructions for pgAdmin 4\r\nFrom: no-reply@localhost\r\nTo: dpage@pgadmin.org\r\nDate: Mon, 01 Aug 2016 11:18:01 +0100\r\nMessage-ID: <20160801101758.1954.48817@piranha.ox.uk.enterprisedb.com>\r\n\r\n--=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D5947340609837468105=3D=3D\r\nContent= -Type: multipart/alternative;\r\n boundary=3D"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D457364555723615424= 4=3D=3D"\r\nMIME-Version: 1.0\r\n\r\n--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D45736455572361542= 44=3D=3D\r\nContent-Type: text/plain; charset=3D"utf-8"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: 7bit\r\n\r\nClick the link below to reset your password:\r\n\r\nhttp://localhost/reset/WyIxIiwiYTY2ODY0ZTY0Nzlm= MzM1NTNhYTc0NzUwYzEwNDc5ZmQiXQ.CoCzVg.FE0MhiGBwOgVWTcX8mB3Xgq54yw\r\n--=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D4573645557236154244=3D=3D\r\nCont= ent-Type: text/html; charset=3D"utf-8"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: 7bit\r\n\r\n

Click here to reset your password

\r\n--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D45736455= 57236154244=3D=3D--\r\n\r\n--=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D5= 947340609837468105=3D=3D--\r\n.\r\n' reply: '250 2.0.0 OK 1470046685 v26sm44372678pfi.41 - gsmtp\r\n' reply: retcode (250); Msg: 2.0.0 OK 1470046685 v26sm44372678pfi.41 - gsmtp data: (250, '2.0.0 OK 1470046685 v26sm44372678pfi.41 - gsmtp') send: 'quit\r\n' reply: '221 2.0.0 closing connection v26sm44372678pfi.41 - gsmtp\r\n' reply: retcode (221); Msg: 2.0.0 closing connection v26sm44372678pfi.41 - g= smtp ok runTest (pgadmin.browser.server_groups.servers.tests.test_server_put.Server= UpdateTestCase) ... These are the relevant settings I'm using: # Debug mode DEBUG =3D True # App mode SERVER_MODE =3D True # Log CONSOLE_LOG_LEVEL =3D DEBUG FILE_LOG_LEVEL =3D DEBUG # Mail server settings MAIL_SERVER =3D 'smtp.gmail.com' MAIL_PORT =3D 465 MAIL_USE_SSL =3D True MAIL_USERNAME =3D 'dave.page@enterprisedb.com' MAIL_PASSWORD =3D 'xxxxxx' >>>> >>>> 2) Is the test count in the summary correct when you have multiple >>>> servers? I think it might be resetting between servers. >>> In the current code runTest() function calls only one time for >>> single/multiple server/s that's why it's showing same count for both >>> (single & multiple). >>> Question: What exactly we are looking for, only count? Or we need >>> any more logs like for adding database, it should display in which >>> server (PG/PPAS) its adding database if this is the case we need a >>> feasibility check. >> >> Right now I would like to see the summary updated so it outputs useful >> (and correct) information - for example, it could say something like: >> >> =3D=3D=3D=3D=3D >> Testing completed: >> >> PostgreSQL 9.4: 23 tests passed, 0 tests failed >> EPAS 9.5: 25 tests passed, 2 tests failed (foo_test, bar_test) >> =3D=3D=3D=3D=3D >> >> where PostgreSQL 9.4 and EPAS 9.5 are the two servers configured in >> test_config.py and foo_test and bar_test are the names of the tests >> that failed. > Thanks for additional info. >> >>>> 3) Please ensure that test databases that are created are also dropped >>>> again. I'm getting tired of deleting them manually! >>> I already added delete databases in tearDown () function, But >>> yeah, I found two test cases where this code missed. I will add this >>> in the next patch. >> >> Thanks. >> >>>> >>>> Thanks, Dave. >>>> >>>> On Wed, Jul 27, 2016 at 1:19 PM, Navnath Gadakh >>>> wrote: >>>>> Hi Dave, >>>>> We have reproduced the issue you mentioned in the previous >>>>> email. We need to skip the login related test cases when SERVER_MODE = =3D >>>>> False in the web/config_local.py. >>>>> >>>>> Please find the revised patch for the same. >>>>> >>>>> Thanks! >>>>> >>>>> >>>>> On Fri, Jul 22, 2016 at 9:48 PM, Dave Page wrote: >>>>>> Hi >>>>>> >>>>>> On Fri, Jul 22, 2016 at 2:22 PM, Navnath Gadakh >>>>>> wrote: >>>>>>> Hi Dave, >>>>>>> >>>>>>> Please find the attached patch for pgAdmin4 unittest(Support of = API >>>>>>> testing with different servers i.e. PG and PPAS). >>>>>>> >>>>>>> This patch includes- >>>>>>> >>>>>>> Test framework support API testing with multiple server for this we= need to >>>>>>> modify test_config.json(for user it=E2=80=99s test_config.json.in) = and >>>>>>> test_advanced_config.json(for user it=E2=80=99s test_advanced_confi= g.json.in). >>>>>>> Server details of PG and PPAS are included in both .in files. >>>>>>> >>>>>>> Removed the logic of logging in the test client on each test scena= rio(As >>>>>>> per Khushboo's comment in previous email). We need this logic in t= est cases >>>>>>> under =E2=80=98browser/tests/=E2=80=99 as for test scenarios like c= hange password and >>>>>>> invalid login test cases as test client should be logged out first.= So, as >>>>>>> per this the code is slightly modified in =E2=80=98browser/tests/= =E2=80=99. >>>>>> >>>>>> OK in principle, but it doesn't seem to work: >>>>>> >>>>>> This function will add the server under default server group. (Defau= lt >>>>>> Server Node url) ... ok >>>>>> >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>> FAIL: runTest (pgadmin.browser.tests.test_reset_password.ResetPasswo= rdTestCase) >>>>>> This function checks reset password functionality. (TestCase for >>>>>> Validating Empty Email) >>>>>> --------------------------------------------------------------------= -- >>>>>> Traceback (most recent call last): >>>>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/tests/test_res= et_password.py", >>>>>> line 44, in runTest >>>>>> 'utf-8')) >>>>>> AssertionError: 'Recover pgAdmin 4 Password' not found in u'>>>>> HTML PUBLIC "-//W3C//DTD HTML 3.2 >>>>>> Final//EN">\nRedirecting...\n

Redirecting...

\= n

You >>>>>> should be redirected automatically to target URL: /. >>>>>> If not click the link.' >>>>>> >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>> FAIL: runTest (pgadmin.browser.tests.test_reset_password.ResetPasswo= rdTestCase) >>>>>> This function checks reset password functionality. (TestCase for >>>>>> Validating Invalid_Email) >>>>>> --------------------------------------------------------------------= -- >>>>>> Traceback (most recent call last): >>>>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/tests/test_res= et_password.py", >>>>>> line 44, in runTest >>>>>> 'utf-8')) >>>>>> AssertionError: 'Recover pgAdmin 4 Password' not found in u'>>>>> HTML PUBLIC "-//W3C//DTD HTML 3.2 >>>>>> Final//EN">\nRedirecting...\n

Redirecting...

\= n

You >>>>>> should be redirected automatically to target URL: /. >>>>>> If not click the link.' >>>>>> >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>> FAIL: runTest (pgadmin.browser.tests.test_reset_password.ResetPasswo= rdTestCase) >>>>>> This function checks reset password functionality. (TestCase for >>>>>> Validating Valid_Email) >>>>>> --------------------------------------------------------------------= -- >>>>>> Traceback (most recent call last): >>>>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/tests/test_res= et_password.py", >>>>>> line 44, in runTest >>>>>> 'utf-8')) >>>>>> AssertionError: 'Recover pgAdmin 4 Password' not found in u'>>>>> HTML PUBLIC "-//W3C//DTD HTML 3.2 >>>>>> Final//EN">\nRedirecting...\n

Redirecting...

\= n

You >>>>>> should be redirected automatically to target URL: /. >>>>>> If not click the link.' >>>>>> >>>>>> --------------------------------------------------------------------= -- >>>>>> Ran 26 tests in 30.109s >>>>>> >>>>>> FAILED (failures=3D3) >>>>>> >>>>>> It's very far from obvious what's wrong here (/reset looks just fine >>>>>> to me). How can we get more useful info out of the framework? >>>>>> >>>>>> -- >>>>>> 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 >>> >>> >>> >>> -- >>> 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 > > > > -- > Thanks, > Navnath Gadakh > Software Engineer > EnterpriseDB Corporation > Mobile: +91 9975389878 --=20 Dave Page VP, Chief Architect, Tools & Installers EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company Blog: http://pgsnake.blogspot.com Twitter: @pgsnake --=20 Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers