Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu8LZ-0008VH-Pu for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Mar 2018 03:05:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eu8LY-0007yW-Ju for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Mar 2018 03:05:28 +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.89) (envelope-from ) id 1eu8LY-0007yL-DK for pgadmin-hackers@lists.postgresql.org; Fri, 09 Mar 2018 03:05:28 +0000 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eu8LP-0008Hz-So for pgadmin-hackers@postgresql.org; Fri, 09 Mar 2018 03:05:27 +0000 Received: by mail-oi0-x236.google.com with SMTP id c83so6024188oib.1 for ; Thu, 08 Mar 2018 19:05:18 -0800 (PST) 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=PvtHKCNcqO2iAft66fFErZgbUCl8wH7Z5guvHeUdkwA=; b=uu3HCtPQoojtI+WIxPjc4BGFGQkStO6LrHL64zGsck4KHxNB1TkzDQL2AQ3kS5yRY6 nobT/EwvbcCs2PeyIPvQNbggc87x9v/+23ShO0zuf0aljuuWFjxtzXfEmjsBnpvEB7l/ 9T0+cyqYKVKM9EoWGQhtGzcAMMns7MwmyAWvdn5ppdy3Ly/7KzrNe5BntQY8plmKTI9l OpjFVBc6mrG8Mp/tRLC7AIJ0NiEtpg0F4lA3UQ8RYKp3ck17mpHdExxIo6SpopYdMXPc dyeU2htblQztPArW+uSg560djFtKKh3VUdcJE/l/H1ED5Jp/W7usdgFracGb+XsjYWxQ tNag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PvtHKCNcqO2iAft66fFErZgbUCl8wH7Z5guvHeUdkwA=; b=q/Ia+JD/a7vtGgGfeDeXYLmIp4FV228h+1wUOxg5pgJi1T2ndQZwPnr/WgF3Wj5X5b +MjLNEjQ1yKwXF9nzVQ3Ke4ypGIOeQNNNCZRnq464mw6pZI3M7c342GCGgfXYk2jHjbO BGDhlNNn/1IAq8BHJa/lvsVldpi2H7/VzA/ghZF5vac3enEWoaMkRDf0PNtWM2sgRTrg CvwsmtP/Br/Lv88urqVpNYseOfbfwij0VM0vtIl/TT4fRaqYdaH/f6Th47HADczqKTN7 hbcI0Udj39VlJeaZ4Gx4iJfszLKNkJ9c+OMK8S8DNpRORBVQ+ws8w+9mg/O86kzWRDsd KV5w== X-Gm-Message-State: AElRT7H/IPJPj0Cb/+25s/8Pln1ERKiWC+Seby8fq/79kJmtmdqkM7BV wfNdwK5CJFq/wkWSXP48eYVfqCPrGpHgROVCVTb1XYcp X-Google-Smtp-Source: AG47ELu7Rb5/IW01PmymECf7qjwUBBaVy0GftwoIA+Zl05JE1QAK9y1ZpnBbueyEfRt/yTZa6CyiARO/lanZnDBa1jc= X-Received: by 10.202.183.2 with SMTP id h2mr18995184oif.127.1520564717035; Thu, 08 Mar 2018 19:05:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.203.154 with HTTP; Thu, 8 Mar 2018 19:05:16 -0800 (PST) In-Reply-To: References: From: Khushboo Vashi Date: Fri, 9 Mar 2018 08:35:16 +0530 Message-ID: Subject: Re: pgAdmin 4 commit: Support EXPLAIN on Greenplum. Fixes #3097 To: Joao De Almeida Pereira Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="001a113cd336d146910566f20f96" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113cd336d146910566f20f96 Content-Type: text/plain; charset="UTF-8" Hi Joao, On Thu, Mar 8, 2018 at 7:52 PM, Joao De Almeida Pereira < jdealmeidapereira@pivotal.io> wrote: > Hello Khushboo, > Completely forgot about this python "feature"....... > Attached is the fix. > > Patch looks good to me and also passed the test cases on PY 2.7 and PY 3.5. > Just as a side question, does anyone else feel the pain of wanting to run > a single test using a IDE or the command line and not being able to? > While development, I run module wise test cases but yes as you said can't run a single test case without doing some manual work. > We an HandRolled the loader, and that as some implications. Did anyone try > to use a different launcher like pytest or nose instead of the current > runner? > I understand that testscenarios is one of the problems we have if we want > to move away from this way of running tests. > Any suggestion? > > Thanks > Joao > > Thanks, Khushboo > On Wed, Mar 7, 2018 at 11:41 PM Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> Hi Joao, >> >> In the test_start_running_query.py, 2 static methods >> (is_begin_required_for_sql_query and is_rollback_statement_required) >> of StartRunningQuery class were used directly without @patch. Due to >> this, in all the cases, the original value of them doesn't restore. >> >> To fix this, I have sent the patch in another thread, to restore its >> original state, but I wonder if we can use these methods with @patch. >> >> Thanks, >> Khushboo >> >> >> On Fri, Feb 9, 2018 at 5:24 PM, Dave Page wrote: >> >>> Support EXPLAIN on Greenplum. Fixes #3097 >>> >>> - Extract SQLEditor.execute and SQLEditor._poll into their own files >>> and add test around them >>> - Extract SQLEditor backend functions that start executing query to >>> their own files and add tests around it >>> - Move the Explain SQL from the front-end and now pass the Explain plan >>> parameters as a JSON object in the start query call. >>> - Extract the compile_template_name into a function that can be used by >>> the different places that try to select the version of the template and the >>> server type >>> >>> Branch >>> ------ >>> master >>> >>> Details >>> ------- >>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h= >>> e16a95275336529a734bf0066889e39cc8ef0662 >>> Author: Joao Pedro De Almeida Pereira >>> >>> Modified Files >>> -------------- >>> .../databases/schemas/tables/tests/test_utils.py | 0 >>> web/pgadmin/static/js/sqleditor/execute_query.js | 287 ++++ >>> .../js/sqleditor/is_new_transaction_required.js | 14 + >>> .../static/js/sqleditor/query_tool_actions.js | 33 +- >>> web/pgadmin/tools/sqleditor/__init__.py | 396 +---- >>> web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 227 +-- >>> .../sqleditor/sql/10_plus/explain_plan.sql | 23 + >>> .../sqleditor/sql/9.2_plus/explain_plan.sql | 20 + >>> .../sqleditor/sql/default/explain_plan.sql | 17 + >>> .../sqleditor/sql/gpdb_5.0_plus/explain_plan.sql | 5 + >>> web/pgadmin/tools/sqleditor/tests/__init__.py | 8 + >>> .../sqleditor/tests/test_explain_plan_templates.py | 152 ++ >>> .../test_extract_sql_from_network_parameters.py | 59 + >>> .../tools/sqleditor/tests/test_start_query_tool.py | 38 + >>> web/pgadmin/tools/sqleditor/utils/__init__.py | 14 + >>> .../sqleditor/utils/apply_explain_plan_wrapper.py | 24 + >>> .../tools/sqleditor/utils/constant_definition.py | 32 + >>> .../tools/sqleditor/utils/is_begin_required.py | 169 ++ >>> .../tools/sqleditor/utils/start_running_query.py | 172 ++ >>> .../tools/sqleditor/utils/tests/__init__.py | 8 + >>> .../utils/tests/test_apply_explain_plan_wrapper.py | 121 ++ >>> .../utils/tests/test_start_running_query.py | 445 +++++ >>> .../utils/update_session_grid_transaction.py | 18 + >>> web/pgadmin/utils/compile_template_name.py | 17 + >>> .../utils/tests/test_compile_template_name.py | 34 + >>> web/pgadmin/utils/versioned_template_loader.py | 2 +- >>> web/regression/javascript/fake_endpoints.js | 6 +- >>> .../javascript/sqleditor/execute_query_spec.js | 1702 >>> ++++++++++++++++++++ >>> .../sqleditor/is_new_transaction_required_spec.js | 65 + >>> .../sqleditor/query_tool_actions_spec.js | 141 +- >>> 30 files changed, 3670 insertions(+), 579 deletions(-) >>> >>> >> --001a113cd336d146910566f20f96 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Joao,

On Thu, Mar 8, 2018 at 7:52 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:
Hello Khushboo,
Completely forgot abou= t this python "feature".......
Attached is the fix.

Patch looks good to me and also pa= ssed the test cases on PY 2.7 and PY 3.5.=C2=A0
Just as a side question, does any= one else feel the pain of wanting to run a single test using a IDE or the c= ommand line and not being able to?
While devel= opment, I run module wise test cases but yes as you said can't run a si= ngle test case without doing some manual work.=C2=A0
We an HandRolled the loader, and that a= s some implications. Did anyone try to use a different launcher like pytest= or nose instead of the current runner?=C2=A0
I understand that testscena= rios is one of the problems we have if we want to move away from this way o= f running tests.
Any suggestion?

Thanks<= /div>
Joao
<= /span>

Thanks= ,
Khushboo=C2=A0
On = Wed, Mar 7, 2018 at 11:41 PM Khushboo Vashi <khushboo.vashi@enterprisedb.= com> wrote:
Hi Joao,

In the=C2=A0test_start_running= _query.py, 2 static methods (is_begin_required_= for_sql_query and is_rollback_statement_re= quired)
of StartRun= ningQuery class were used directly without @patch. D= ue to this, in all the cases, the original value of them doesn't restor= e.

T= o fix this, I have sent the patch in another thread, to restore its origina= l state, but I wonder if we can use these methods with @patch.
=

Thanks,
Khushboo


On Fri, Feb 9, 2018 at 5:= 24 PM, Dave Page <dpage@pgadmin.org> wrote:
Support EXPLAIN on Greenplum. Fixes #3097

=C2=A0- Extract SQLEditor.execute and SQLEditor._poll into their own files = and add test around them
=C2=A0- Extract SQLEditor backend functions that start executing query to t= heir own files and add tests around it
=C2=A0- Move the Explain SQL from the front-end and now pass the Explain pl= an parameters as a JSON object in the start query call.
=C2=A0- Extract the compile_template_name into a function that can be used = by the different places that try to select the version of the template and = the server type

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=3Dpgadmin4.git;a=3Dcommitdiff;h=3De16a95275336529a734bf0066889e39cc8ef0662
Author: Joao Pedro De Almeida Pereira <jdealmeidapereira@pivotal.io>

Modified Files
--------------
.../databases/schemas/tables/tests/test_utils.py=C2=A0 =C2=A0|=C2=A0 = =C2=A0 0
web/pgadmin/static/js/sqleditor/execute_query.js=C2=A0 =C2=A0|=C2=A0 2= 87 ++++
.../js/sqleditor/is_new_transaction_required.js=C2=A0 =C2=A0 |=C2=A0 = =C2=A014 +
.../static/js/sqleditor/query_tool_actions.js=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A033 +-
web/pgadmin/tools/sqleditor/__init__.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 396 +----
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |=C2=A0 227 +--
.../sqleditor/sql/10_plus/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A023 +
.../sqleditor/sql/9.2_plus/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A020 +
.../sqleditor/sql/default/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A017 +
.../sqleditor/sql/gpdb_5.0_plus/explain_plan.sql=C2=A0 =C2=A0|=C2=A0 = =C2=A0 5 +
web/pgadmin/tools/sqleditor/tests/__init__.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A0 8 +
.../sqleditor/tests/test_explain_plan_templates.py |=C2=A0 152 ++
.../test_extract_sql_from_network_parameters.py=C2=A0 =C2=A0 |=C2=A0 = =C2=A059 +
.../tools/sqleditor/tests/test_start_query_tool.py |=C2=A0 =C2=A038 +<= br> web/pgadmin/tools/sqleditor/utils/__init__.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A014 +
.../sqleditor/utils/apply_explain_plan_wrapper.py=C2=A0 |=C2=A0 =C2=A0= 24 +
.../tools/sqleditor/utils/constant_definition.py=C2=A0 =C2=A0|=C2=A0 = =C2=A032 +
.../tools/sqleditor/utils/is_begin_required.py=C2=A0 =C2=A0 =C2=A0|=C2= =A0 169 ++
.../tools/sqleditor/utils/start_running_query.py=C2=A0 =C2=A0|=C2=A0 1= 72 ++
.../tools/sqleditor/utils/tests/__init__.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A0 8 +
.../utils/tests/test_apply_explain_plan_wrapper.py |=C2=A0 121 ++
.../utils/tests/test_start_running_query.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 445 +++++
.../utils/update_session_grid_transaction.py=C2=A0 =C2=A0 =C2=A0 =C2= =A0|=C2=A0 =C2=A018 +
web/pgadmin/utils/compile_template_name.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A017 +
.../utils/tests/test_compile_template_name.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A034 +
web/pgadmin/utils/versioned_template_loader.py=C2=A0 =C2=A0 =C2=A0|=C2= =A0 =C2=A0 2 +-
web/regression/javascript/fake_endpoints.js=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A0 6 +-
.../javascript/sqleditor/execute_query_spec.js=C2=A0 =C2=A0 =C2=A0| 17= 02 ++++++++++++++++++++
.../sqleditor/is_new_transaction_required_spec.js=C2=A0 |=C2=A0 =C2=A0= 65 +
.../sqleditor/query_tool_actions_spec.js=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 141 +-
30 files changed, 3670 insertions(+), 579 deletions(-)



--001a113cd336d146910566f20f96--