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 1evOdC-0006IN-27 for pgadmin-hackers@arkaria.postgresql.org; Mon, 12 Mar 2018 14:40:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evOd9-0006PG-Id for pgadmin-hackers@arkaria.postgresql.org; Mon, 12 Mar 2018 14:40:51 +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 1evOd9-0006P6-AN for pgadmin-hackers@lists.postgresql.org; Mon, 12 Mar 2018 14:40:51 +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 1evOd3-0000Bf-5h for pgadmin-hackers@postgresql.org; Mon, 12 Mar 2018 14:40:50 +0000 Received: by mail-oi0-x236.google.com with SMTP id j79so12474317oib.12 for ; Mon, 12 Mar 2018 07:40:44 -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=KfbJkwzhrqCoWihowyzDvgGIWJ8OabHXAqmCD85DquQ=; b=QEFQuazHPrAeU1BEMBzT6U0t/QCCWq4PtmUU/a2TVKEY50wfzJ9ChBDdNstbtR4dap 4RsrFLqKqIs0Ul1cZiOFeVrO9qqv2EAVkX2W3VCm+2v5v/Pt/3zpL1uADclYc7WRFzDG leu4SpdaaaPFapoOZf44ELgUuLjuZYPyx9iYkElVoz8lkug/GAPPq5qRtk+4fFqsmJKL N73drjFKO6DL5PagV7xUJRZzr60TOZNgVccgdQZwwIfNWNe5HnmhfTidjxq0Ln6vml4B 8zjVp7fb9gXCaN8Wqz1e20gsQ3JWNuarizeQ+zNSwSDGVL9j8ls4b7mxQNg8C1ocIsRr F9hA== 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=KfbJkwzhrqCoWihowyzDvgGIWJ8OabHXAqmCD85DquQ=; b=p6K0i5Gs7KRKE8DFXYXVIJyJuk2GP+W1wuRlMdSaHse6s3ToGMLGahSYBWGEDYaUdn 6PD9+ZBYJvFrnbtbWzznKmmVcXBX7a+gS9IBDL8XfjUBxh1CzjM9MeYrXi1lymJimHyC taOBAPLiepvmXq2XaHO2DwNeO7AKIuDjkAE70xSX6klv4kzt1j2zvBos64SUb5ETZRUW 39UvyQrleKK18sgzce02vdYOIdHynVjfYyKAuNVE78pIMQUyK87QH4wmmeh8fa/tdZil pB2iCS/n6lu+PHe4XcMuLUoUTckuZuIKouAGHdZyGP4aQ1MGlhuDI7+UeaJZ5WjXyJKp f3oQ== X-Gm-Message-State: AElRT7Hd8lNSJHt+fgruN6kmvtaABu/w6aFvPmbcnprb1ueSuAg6SNEn ga/5Zcdk5HVaAt2Hav5oo1npAC2GseaS370EbppLmw== X-Google-Smtp-Source: AG47ELu6zcza8/gu8BjwWJ0+OwGUKAArEq7wxtOoNknNp9oUHDuGRwrXOCQFVRORlw2dc5wGTVqcNOrfeiLOjrovToc= X-Received: by 10.202.173.19 with SMTP id w19mr4688327oie.299.1520865642581; Mon, 12 Mar 2018 07:40:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.8.150 with HTTP; Mon, 12 Mar 2018 07:40:22 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Mon, 12 Mar 2018 20:10:22 +0530 Message-ID: Subject: Re: pgAdmin 4 commit: Support for external tables in GPDB. Fixes #3168 To: Joao De Almeida Pereira Cc: Neel Patel , pgadmin-hackers , Dave Page Content-Type: multipart/alternative; boundary="001a113ceb8460b4be05673820c3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113ceb8460b4be05673820c3 Content-Type: text/plain; charset="UTF-8" Hi Joao, Can we make tests to skip if db is not greenplum? Like we are doing for resource group "..web/pgadmin/browser/server_groups/servers/resource_groups/tests". On Mon, Mar 12, 2018 at 7:52 PM, Murtuza Zabuawala < murtuza.zabuawala@enterprisedb.com> wrote: > Hi Dave, > > Joao's patch is pending, would you please do the needful? > I also encounter similar issue on Windows while running tests. > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > > On Tue, Mar 6, 2018 at 8:25 PM, Joao De Almeida Pereira < > jdealmeidapereira@pivotal.io> wrote: > >> Hello Neel, >> >> You can find attached the corrections of the path's needed for windows. >> The fix should correct TestExternalTablesView and TestTemplateCreate but >> for the ChangePasswordTestCase I need more information to help you out. We >> need to understand what is the response that the endpoint >> /user_management/user is returning. >> >> Thanks >> Joao >> >> On Tue, Mar 6, 2018 at 2:29 AM Neel Patel >> wrote: >> >>> Hi Joao, >>> >>> I ran the testsuite in windows 10 with Python 3.4 and it fails for >>> external tables. Linux it is working fine. Let me know if I miss >>> anything. >>> >>> Please check the below logs. >>> >>> python runtests.py --pkg browser --exclude feature_tests >>> >>> ######## >>> >>> ====================================================================== >>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas. >>> tables.tests.test_template_create.TestTemplateCreate) >>> When rendering GreenPlum 5.3 template, when no distribution is present, >>> when no primary key is present, it returns "DISTRIBUTED RANDOMLY" >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\schemas\tables\tests\test_template_create.py", line 99, >>> in runTest >>> self.template_path, **self.input_parameters) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 133, in render_template >>> return _render(ctx.app.jinja_env.get_or_select_template(template_na >>> me_or_list), >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 830, in get_or_select_template >>> return self.get_template(template_name_or_list, parent, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 791, in get_template >>> return self._load_template(name, self.make_globals(globals)) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 765, in _load_template >>> template = self.loader.load(self, name, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py", >>> line 113, in load >>> source, filename, uptodate = self.get_source(environment, name) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 57, in get_source >>> return self._get_source_fast(environment, template) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 85, in _get_source_fast >>> raise TemplateNotFound(template) >>> jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql >>> >>> ====================================================================== >>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas. >>> tables.tests.test_template_create.TestTemplateCreate) >>> When rendering GreenPlum 5.3 template, when no distribution is present, >>> when primary key is present, it returns "DISTRIBUTED BY (attr_primary_key)" >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\schemas\tables\tests\test_template_create.py", line 99, >>> in runTest >>> self.template_path, **self.input_parameters) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 133, in render_template >>> return _render(ctx.app.jinja_env.get_or_select_template(template_na >>> me_or_list), >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 830, in get_or_select_template >>> return self.get_template(template_name_or_list, parent, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 791, in get_template >>> return self._load_template(name, self.make_globals(globals)) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 765, in _load_template >>> template = self.loader.load(self, name, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py", >>> line 113, in load >>> source, filename, uptodate = self.get_source(environment, name) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 57, in get_source >>> return self._get_source_fast(environment, template) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 85, in _get_source_fast >>> raise TemplateNotFound(template) >>> jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql >>> >>> ====================================================================== >>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas. >>> tables.tests.test_template_create.TestTemplateCreate) >>> When rendering GreenPlum 5.3 template, when distribution is present, it >>> returns "DISTRIBUTED BY (attr1, attr2, attr4)" >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\schemas\tables\tests\test_template_create.py", line 99, >>> in runTest >>> self.template_path, **self.input_parameters) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 133, in render_template >>> return _render(ctx.app.jinja_env.get_or_select_template(template_na >>> me_or_list), >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 830, in get_or_select_template >>> return self.get_template(template_name_or_list, parent, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 791, in get_template >>> return self._load_template(name, self.make_globals(globals)) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py", >>> line 765, in _load_template >>> template = self.loader.load(self, name, globals) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py", >>> line 113, in load >>> source, filename, uptodate = self.get_source(environment, name) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 57, in get_source >>> return self._get_source_fast(environment, template) >>> File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", >>> line 85, in _get_source_fast >>> raise TemplateNotFound(template) >>> jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql >>> >>> ====================================================================== >>> ERROR: runTest (pgadmin.browser.tests.test_ch >>> ange_password.ChangePasswordTestCase) >>> TestCase for Changing Valid_Password >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\tests\test_change_password.py", >>> line 91, in runTest >>> user_id = json.loads(response.data.decode('utf-8'))['id'] >>> KeyError: 'id' >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #nodes When retrieving the nodes and the database does not have external >>> tables, it return no child nodes and status 200 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 314, in runTest >>> self.__test_nodes() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 367, in __test_nodes >>> self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template('sql/#gpdb#803 >>> 23#/list.sql') >>> Actual call: render_template('sql/#gpdb#80323#\\list.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #nodes When retrieving the nodes and an error happens while executing >>> the query, it return an internal server error and status 500 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 314, in runTest >>> self.__test_nodes() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 367, in __test_nodes >>> self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template('sql/#gpdb#803 >>> 23#/list.sql') >>> Actual call: render_template('sql/#gpdb#80323#\\list.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #nodes When retrieving the nodes and the database has 2 external tables, >>> it return 2 child nodes and status 200 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 314, in runTest >>> self.__test_nodes() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 367, in __test_nodes >>> self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template('sql/#gpdb#803 >>> 23#/list.sql') >>> Actual call: render_template('sql/#gpdb#80323#\\list.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #node When retrieving the information about 1 external table and an >>> error happens while executing the query, it return an internal server error >>> and status 500 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 316, in runTest >>> self.__test_node() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 393, in __test_node >>> **self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#/node.sql') >>> Actual call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#\\node.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #node When retrieving the information about 1 external table and table >>> does not exist, it return an error message and status 404 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 316, in runTest >>> self.__test_node() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 393, in __test_node >>> **self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#/node.sql') >>> Actual call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#\\node.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #nodes When retrieving the information about 1 external table and the >>> table exists, it return external node information and status 200 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 316, in runTest >>> self.__test_node() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 393, in __test_node >>> **self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#/node.sql') >>> Actual call: render_template(external_table_id=11, >>> template_name_or_list='sql/#gpdb#80323#\\node.sql') >>> >>> ====================================================================== >>> FAIL: runTest (pgadmin.browser.server_groups.servers.databases.external_ >>> tables.tests.test_external_tables_view.TestExternalTablesView) >>> #properties When retrieving the properties of a external table and the >>> table exists, it return the properties and status 200 >>> ---------------------------------------------------------------------- >>> Traceback (most recent call last): >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 320, in runTest >>> self.__test_properties() >>> File "C:\Python34\Lib\unittest\mock.py", line 1142, in patched >>> return func(*args, **keywargs) >>> File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv >>> ers\databases\external_tables\tests\test_external_tables_view.py", line >>> 419, in __test_properties >>> **self.expect_render_template_called_with >>> File "C:\Python34\Lib\unittest\mock.py", line 777, in >>> assert_called_with >>> raise AssertionError(_error_message()) from cause >>> AssertionError: Expected call: render_template(template_name_ >>> or_list='sql/#gpdb#80323#/get_table_information.sql', table_oid=11) >>> Actual call: render_template(template_name_ >>> or_list='sql/#gpdb#80323#\\get_table_information.sql', table_oid=11) >>> >>> ---------------------------------------------------------------------- >>> Ran 256 tests in 77.123s >>> >>> FAILED (failures=7, errors=4, skipped=25) >>> >>> ====================================================================== >>> Test Result Summary >>> ====================================================================== >>> >>> PostgreSQL 9.6: >>> >>> 234 tests passed >>> 3 tests failed: >>> TestExternalTablesView (#node When retrieving the >>> information about 1 external table and table does not exist, it return an >>> error message and status 404, >>> #node When retrieving the >>> information about 1 external table and an error happens while executing the >>> query, it return an internal server error and status 500, >>> #nodes When retrieving the nodes >>> and the database has 2 external tables, it return 2 child nodes and status >>> 200, >>> #nodes When retrieving the >>> information about 1 external table and the table exists, it return external >>> node information and status 200, >>> #nodes When retrieving the nodes >>> and an error happens while executing the query, it return an internal >>> server error and status 500, >>> #properties When retrieving the >>> properties of a external table and the table exists, it return the >>> properties and status 200, >>> #nodes When retrieving the nodes >>> and the database does not have external tables, it return no child nodes >>> and status 200) >>> ChangePasswordTestCase (TestCase for Changing >>> Valid_Password) >>> TestTemplateCreate (When rendering GreenPlum 5.3 >>> template, when no distribution is present, when no primary key is present, >>> it returns "DISTRIBUTED RANDOMLY", >>> When rendering GreenPlum 5.3 >>> template, when distribution is present, it returns "DISTRIBUTED BY (attr1, >>> attr2, attr4)", >>> When rendering GreenPlum 5.3 >>> template, when no distribution is present, when primary key is present, it >>> returns "DISTRIBUTED BY (attr_primary_key)") >>> 19 tests skipped: >>> ResourceGroupsGetTestCase (Get resource groups) >>> TableSpaceDeleteTestCase (Check Tablespace Node) >>> ResourceGroupsDeleteTestCase (Delete resource groups) >>> SynonymDeleteTestCase (Fetch synonym Node URL) >>> TestSSLConnection (Test for SSL connection) >>> PackageAddTestCase (Fetch Package Node URL) >>> SynonymPutTestCase (Fetch synonym Node URL) >>> TablespaceGetTestCase (Check Tablespace Node) >>> SynonymAddTestCase (Default Node URL) >>> PackagePutTestCase (Fetch Package Node URL) >>> TableAddTestCase (Create Range partitioned table with 2 >>> partitions, >>> Create List partitioned table >>> with 2 partitions) >>> PackageGetTestCase (Fetch Package Node URL) >>> PackageDeleteTestCase (Fetch Package Node URL) >>> TableSpaceAddTestCase (Check Tablespace Node) >>> ResourceGroupsAddTestCase (Add resource groups) >>> SynonymGetTestCase (Fetch synonym Node URL) >>> ResourceGroupsPutTestCase (Put resource groups) >>> TableSpaceUpdateTestCase (Check Tablespace Node) >>> TableUpdateTestCase (Attach partition to existing range >>> partitioned table, >>> Detach partition from existing >>> range partitioned table, >>> Create partitions of existing >>> range partitioned table, >>> Detach partition from existing >>> list partitioned table, >>> Create partitions of existing >>> list partitioned table, >>> Attach partition to existing >>> list partitioned table) >>> >>> ====================================================================== >>> >>> ######## >>> >>> >>> Thanks, >>> Neel Patel >>> >>> On Fri, Mar 2, 2018 at 10:19 PM, Dave Page wrote: >>> >>>> Support for external tables in GPDB. Fixes #3168 >>>> >>>> Branch >>>> ------ >>>> master >>>> >>>> Details >>>> ------- >>>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdif >>>> f;h=427314cfdfeb96c3a7835eab5a4d638903bc6dc3 >>>> Author: Joao Pedro De Almeida Pereira >>>> >>>> Modified Files >>>> -------------- >>>> .../servers/databases/external_tables/__init__.py | 275 +++++++++++++ >>>> .../databases/external_tables/actions/__init__.py | 0 >>>> .../external_tables/actions/get_all_nodes.py | 4 + >>>> .../databases/external_tables/mapping_utils.py | 165 ++++++++ >>>> .../databases/external_tables/properties.py | 78 ++++ >>>> .../external_tables/reverse_engineer_ddl.py | 69 ++++ >>>> .../static/img/coll-external_table.svg | 1 + >>>> .../external_tables/static/img/external_table.svg | 1 + >>>> .../templates/sql/gpdb_5.0_plus/create.sql | 60 +++ >>>> .../templates/sql/gpdb_5.0_plus/get_columns.sql | 12 + >>>> .../sql/gpdb_5.0_plus/get_table_information.sql | 22 ++ >>>> .../templates/sql/gpdb_5.0_plus/list.sql | 6 + >>>> .../templates/sql/gpdb_5.0_plus/node.sql | 5 + >>>> .../databases/external_tables/tests/__init__.py | 0 >>>> .../tests/test_external_tables_module.py | 99 +++++ >>>> .../tests/test_external_tables_view.py | 428 >>>> +++++++++++++++++++++ >>>> .../external_tables/tests/test_mapping_utils.py | 375 >>>> ++++++++++++++++++ >>>> .../external_tables/tests/test_properties.py | 156 ++++++++ >>>> .../tests/test_reverse_engineer_ddl.py | 261 +++++++++++++ >>>> .../tests/test_sql_template_create_integration.py | 0 >>>> .../templates/table/sql/gpdb_5.0_plus/nodes.sql | 1 + >>>> web/pgadmin/static/bundle/browser.js | 1 + >>>> .../databases/external_tables/external_tables.js | 88 +++++ >>>> .../servers/databases/external_tables/index.js | 18 + >>>> web/pgadmin/tools/sqleditor/__init__.py | 1 + >>>> .../external_tables/external_tables_spec.js | 56 +++ >>>> web/webpack.config.js | 9 + >>>> web/webpack.shim.js | 3 + >>>> 28 files changed, 2194 insertions(+) >>>> >>>> >>> > --001a113ceb8460b4be05673820c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Joao,

Can we make tests to skip if db is not greenplum?
Like we are doing for resource group "..web/pgadmin/browser/serv= er_groups/servers/resource_groups/tests".


On Mon, Mar 12, 2018 at 7:52 PM, Murtuza Zab= uawala <murtuza.zabuawala@enterprisedb.com>= wrote:
Hi Dav= e,
<= br>
= Joao's patch is pending, would you please do the needful?
I also encounter similar issue on Windows while running tests.

--
Regards,
Murtuza Zabuawala
EnterpriseDB:= =C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL = Company

=

On Tue, Mar 6, 2018 at 8:25 PM, Joao De Alme= ida Pereira <jdealmeidapereira@pivotal.io> wrote:=
Hell= o Neel,

You can find attached the corrections of the pat= h's needed for windows. The fix should correct=C2=A0TestExternalTablesView and=C2=A0TestTemplateCreate but f= or the ChangePasswordTestCase I need more information to help you out. We n= eed to understand what is the response that the endpoint /user_management/u= ser is returning.

Thanks
Joao
On Tue, Mar 6, 2018 at 2:= 29 AM Neel Patel <neel.patel@enterprisedb.com> wrote:
Hi=C2=A0Joao,

I ran the testsuite in windows 10 with Py= thon 3.4 and it fails for external tables. Linux it is working fine. Let me know if I miss anything.

Please check the below logs.

python runt= ests.py --pkg browser --exclude feature_tests

= ########

=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
ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schem= as.tables.tests.test_template_create.TestTemplateCreate)
When rendering GreenPlum 5.3 template, when no distribution is present, w= hen no primary key is present, it returns "DISTRIBUTED RANDOMLY"<= /div>
------------------------------------------------------------= ----------
Traceback (most recent call last):
=C2= =A0 File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\= servers\databases\schemas\tables\tests\test_template_create.py&qu= ot;, line 99, in runTest
=C2=A0 =C2=A0 self.template_path, *= *self.input_parameters)
=C2=A0 File "C:\Projects\venv_pgadmi= n4_py_3_4\lib\site-packages\flask\templating.py", line 133, = in render_template
=C2=A0 =C2=A0 return _render(ctx.app.jinja_env= .get_or_select_template(template_name_or_list),
=C2=A0 = File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\e= nvironment.py", line 830, in get_or_select_template
=C2= =A0 =C2=A0 return self.get_template(template_name_or_list, parent, glo= bals)
=C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4\lib= \site-packages\jinja2\environment.py", line 791, in get_template<= /div>
=C2=A0 =C2=A0 return self._load_template(name, self.make_globals(= globals))
=C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4= \lib\site-packages\jinja2\environment.py", line 765, in _load_tem= plate
=C2=A0 =C2=A0 template =3D self.loader.load(self, name, glo= bals)
=C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4\lib= \site-packages\jinja2\loaders.py", line 113, in load
= =C2=A0 =C2=A0 source, filename, uptodate =3D self.get_source(environment, n= ame)
=C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4\lib\= site-packages\flask\templating.py", line 57, in get_source
<= div>=C2=A0 =C2=A0 return self._get_source_fast(environment, template)<= /div>
=C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-= packages\flask\templating.py", line 85, in _get_source_fast
=
=C2=A0 =C2=A0 raise TemplateNotFound(template)
jinja2.except= ions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql

=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
ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas.tables.tests.test_template_create.Tes= tTemplateCreate)
When rendering GreenPlum 5.3 template, when no d= istribution is present, when primary key is present, it returns "DISTR= IBUTED BY (attr_primary_key)"
------------------------------= ----------------------------------------
Traceback (mos= t recent call last):
=C2=A0 File "C:\Projects\pgadmin4\web\p= gadmin\browser\server_groups\servers\databases\schemas\tables\tests\test_template_create.py", line 99, in runTest
= =C2=A0 =C2=A0 self.template_path, **self.input_parameters)
=C2=A0= File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\t= emplating.py", line 133, in render_template
=C2=A0 =C2= =A0 return _render(ctx.app.jinja_env.get_or_select_template(template_n= ame_or_list),
=C2=A0 File "C:\Projects\venv_pgadmin4_py= _3_4\lib\site-packages\jinja2\environment.py", line 830, in = get_or_select_template
=C2=A0 =C2=A0 return self.get_template(tem= plate_name_or_list, parent, globals)
=C2=A0 File "C:\Pr= ojects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.= py", line 791, in get_template
=C2=A0 =C2=A0 return self._lo= ad_template(name, self.make_globals(globals))
=C2=A0 File "C= :\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environm= ent.py", line 765, in _load_template
=C2=A0 =C2=A0 template = =3D self.loader.load(self, name, globals)
=C2=A0 File "C:\Pr= ojects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py&q= uot;, line 113, in load
=C2=A0 =C2=A0 source, filename, uptodate = =3D self.get_source(environment, name)
=C2=A0 File "C:\Proje= cts\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py&qu= ot;, line 57, in get_source
=C2=A0 =C2=A0 return self._get_source= _fast(environment, template)
=C2=A0 File "C:\Projects\v= env_pgadmin4_py_3_4\lib\site-packages\flask\templating.py", = line 85, in _get_source_fast
=C2=A0 =C2=A0 raise TemplateNotFound= (template)
jinja2.exceptions.TemplateNotFound: table\sql\gpd= b_5.0_plus\create.sql

=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
ERROR: runTest= (pgadmin.browser.server_groups.servers.databases.schemas.tables.= tests.test_template_create.TestTemplateCreate)
When renderin= g GreenPlum 5.3 template, when distribution is present, it returns "DI= STRIBUTED BY (attr1, attr2, attr4)"
------------------------= ----------------------------------------------
Tracebac= k (most recent call last):
=C2=A0 File "C:\Projects\pgadmin4= \web\pgadmin\browser\server_groups\servers\databases\schemas\tabl= es\tests\test_template_create.py", line 99, in runTest
=
=C2=A0 =C2=A0 self.template_path, **self.input_parameters)
= =C2=A0 File "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\f= lask\templating.py", line 133, in render_template
=C2= =A0 =C2=A0 return _render(ctx.app.jinja_env.get_or_select_template(tem= plate_name_or_list),
=C2=A0 File "C:\Projects\venv_pgad= min4_py_3_4\lib\site-packages\jinja2\environment.py", line 8= 30, in get_or_select_template
=C2=A0 =C2=A0 return self.get_templ= ate(template_name_or_list, parent, globals)
=C2=A0 File &quo= t;C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\envir= onment.py", line 791, in get_template
=C2=A0 =C2=A0 return s= elf._load_template(name, self.make_globals(globals))
=C2=A0 File = "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\e= nvironment.py", line 765, in _load_template
=C2=A0 =C2=A0 te= mplate =3D self.loader.load(self, name, globals)
=C2=A0 File &quo= t;C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loade= rs.py", line 113, in load
=C2=A0 =C2=A0 source, filename, up= todate =3D self.get_source(environment, name)
=C2=A0 File "C= :\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templatin= g.py", line 57, in get_source
=C2=A0 =C2=A0 return self._get= _source_fast(environment, template)
=C2=A0 File "C:\Pro= jects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py&= quot;, line 85, in _get_source_fast
=C2=A0 =C2=A0 raise TemplateN= otFound(template)
jinja2.exceptions.TemplateNotFound: table\= sql\gpdb_5.0_plus\create.sql

=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
ERROR: r= unTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
TestCase for Changing Valid_Password
--------= --------------------------------------------------------------
Traceback (most recent call last):
=C2=A0 File "C:\P= rojects\pgadmin4\web\pgadmin\browser\tests\test_change_password.p= y", line 91, in runTest
=C2=A0 =C2=A0 user_id =3D json.loads= (response.data.decode('utf-8'))['id']
KeyErr= or: 'id'

=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.bro= wser.server_groups.servers.databases.external_tables.tests.test_e= xternal_tables_view.TestExternalTablesView)
#nodes When= retrieving the nodes and the database does not have external tables, it re= turn no child nodes and status 200
------------------------------= ----------------------------------------
Traceback (mos= t recent call last):
=C2=A0 File "C:\Python34\Lib\unittest\m= ock.py", line 1142, in patched
=C2=A0 =C2=A0 return fun= c(*args, **keywargs)
=C2=A0 File "C:\Projects\pgadmin4\web\p= gadmin\browser\server_groups\servers\databases\external_tables\tests\test_external_tables_view.py", line 314, in runTest
=C2=A0 =C2=A0 self.__test_nodes()
=C2=A0 File "C:\Pyth= on34\Lib\unittest\mock.py", line 1142, in patched
=C2= =A0 =C2=A0 return func(*args, **keywargs)
=C2=A0 File "C:\Pr= ojects\pgadmin4\web\pgadmin\browser\server_groups\servers\databas= es\external_tables\tests\test_external_tables_view.py", line= 367, in __test_nodes
=C2=A0 =C2=A0 self.expect_render_template_c= alled_with
=C2=A0 File "C:\Python34\Lib\unittest\mock.py", line 777, in assert_called_with
=C2=A0 =C2=A0 raise= AssertionError(_error_message()) from cause
AssertionError:= Expected call: render_template('sql/#gpdb#80323#/list.sql')
Actual call: render_template('sql/#gpdb#80323#\\list.sql&= #39;)

=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.ser= ver_groups.servers.databases.external_tables.tests.test_external_= tables_view.TestExternalTablesView)
#nodes When retriev= ing the nodes and an error happens while executing the query, it return an = internal server error and status 500
----------------------------= ------------------------------------------
Traceback (m= ost recent call last):
=C2=A0 File "C:\Python34\Lib\unittest= \mock.py", line 1142, in patched
=C2=A0 =C2=A0 return f= unc(*args, **keywargs)
=C2=A0 File "C:\Projects\pgadmin4\web= \pgadmin\browser\server_groups\servers\databases\external_tables\= tests\test_external_tables_view.py", line 314, in runTest
=C2=A0 =C2=A0 self.__test_nodes()
=C2=A0 File "C:\Py= thon34\Lib\unittest\mock.py", line 1142, in patched
=C2= =A0 =C2=A0 return func(*args, **keywargs)
=C2=A0 File "C:\Pr= ojects\pgadmin4\web\pgadmin\browser\server_groups\servers\databas= es\external_tables\tests\test_external_tables_view.py", line= 367, in __test_nodes
=C2=A0 =C2=A0 self.expect_render_template_c= alled_with
=C2=A0 File "C:\Python34\Lib\unittest\mock.py", line 777, in assert_called_with
=C2=A0 =C2=A0 raise= AssertionError(_error_message()) from cause
AssertionError:= Expected call: render_template('sql/#gpdb#80323#/list.sql')
Actual call: render_template('sql/#gpdb#80323#\\list.sql&= #39;)

=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.ser= ver_groups.servers.databases.external_tables.tests.test_external_= tables_view.TestExternalTablesView)
#nodes When retriev= ing the nodes and the database has 2 external tables, it return 2 child nod= es and status 200
------------------------------------------= ----------------------------
Traceback (most recent call las= t):
=C2=A0 File "C:\Python34\Lib\unittest\mock.py"= , line 1142, in patched
=C2=A0 =C2=A0 return func(*args, **keywar= gs)
=C2=A0 File "C:\Projects\pgadmin4\web\pgadmin\brows= er\server_groups\servers\databases\external_tables\tests\test_ext= ernal_tables_view.py", line 314, in runTest
=C2=A0 =C2= =A0 self.__test_nodes()
=C2=A0 File "C:\Python34\Lib\unittes= t\mock.py", line 1142, in patched
=C2=A0 =C2=A0 return = func(*args, **keywargs)
=C2=A0 File "C:\Projects\pgadmin4\we= b\pgadmin\browser\server_groups\servers\databases\external_tables= \tests\test_external_tables_view.py", line 367, in __test_no= des
=C2=A0 =C2=A0 self.expect_render_template_called_with
=C2=A0 File "C:\Python34\Lib\unittest\mock.py", line= 777, in assert_called_with
=C2=A0 =C2=A0 raise AssertionError(_e= rror_message()) from cause
AssertionError: Expected call: re= nder_template('sql/#gpdb#80323#/list.sql')
Actual ca= ll: render_template('sql/#gpdb#80323#\\list.sql')
=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.server_groups.se= rvers.databases.external_tables.tests.test_external_tables_view.T= estExternalTablesView)
#node When retrieving the information= about 1 external table and an error happens while executing the query, it = return an internal server error and status 500
------------------= ----------------------------------------------------
Tr= aceback (most recent call last):
=C2=A0 File "C:\Python34\Li= b\unittest\mock.py", line 1142, in patched
=C2=A0 =C2= =A0 return func(*args, **keywargs)
=C2=A0 File "C:\Projects\= pgadmin4\web\pgadmin\browser\server_groups\servers\databases\exte= rnal_tables\tests\test_external_tables_view.py", line 316, i= n runTest
=C2=A0 =C2=A0 self.__test_node()
=C2=A0 File = "C:\Python34\Lib\unittest\mock.py", line 1142, in patched
=C2=A0 =C2=A0 return func(*args, **keywargs)
=C2=A0 File = "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv= ers\databases\external_tables\tests\test_external_tables_view.py&= quot;, line 393, in __test_node
=C2=A0 =C2=A0 **self.expect_rende= r_template_called_with
=C2=A0 File "C:\Python34\Lib\uni= ttest\mock.py", line 777, in assert_called_with
=C2=A0 = =C2=A0 raise AssertionError(_error_message()) from cause
Ass= ertionError: Expected call: render_template(external_table_id=3D11, te= mplate_name_or_list=3D'sql/#gpdb#80323#/node.sql')
A= ctual call: render_template(external_table_id=3D11, template_name_or_l= ist=3D'sql/#gpdb#80323#\\node.sql')

= =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.server_groups.servers.databases.= external_tables.tests.test_external_tables_view.TestExternalTable= sView)
#node When retrieving the information about 1 externa= l table and table does not exist, it return an error message and status 404=
-----------------------------------------------------------= -----------
Traceback (most recent call last):
=C2= =A0 File "C:\Python34\Lib\unittest\mock.py", line 1142, in p= atched
=C2=A0 =C2=A0 return func(*args, **keywargs)
=C2= =A0 File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\= servers\databases\external_tables\tests\test_external_tables_view.py", line 316, in runTest
=C2=A0 =C2=A0 self.__test_no= de()
=C2=A0 File "C:\Python34\Lib\unittest\mock.py"= ;, line 1142, in patched
=C2=A0 =C2=A0 return func(*args, **keywa= rgs)
=C2=A0 File "C:\Projects\pgadmin4\web\pgadmin\brow= ser\server_groups\servers\databases\external_tables\tests\test_ex= ternal_tables_view.py", line 393, in __test_node
=C2=A0= =C2=A0 **self.expect_render_template_called_with
=C2=A0 Fil= e "C:\Python34\Lib\unittest\mock.py", line 777, in assert_ca= lled_with
=C2=A0 =C2=A0 raise AssertionError(_error_message(= )) from cause
AssertionError: Expected call: render_template(exte= rnal_table_id=3D11, template_name_or_list=3D'sql/#gpdb#80323#= /node.sql')
Actual call: render_template(external_table_= id=3D11, template_name_or_list=3D'sql/#gpdb#80323#\\node.sql')=

=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.server_gr= oups.servers.databases.external_tables.tests.test_external_t= ables_view.TestExternalTablesView)
#nodes When retrieving th= e information about 1 external table and the table exists, it return extern= al node information and status 200
------------------------------= ----------------------------------------
Traceback (mos= t recent call last):
=C2=A0 File "C:\Python34\Lib\unittest\m= ock.py", line 1142, in patched
=C2=A0 =C2=A0 return fun= c(*args, **keywargs)
=C2=A0 File "C:\Projects\pgadmin4\web\p= gadmin\browser\server_groups\servers\databases\external_tables\tests\test_external_tables_view.py", line 316, in runTest
=C2=A0 =C2=A0 self.__test_node()
=C2=A0 File "C:\Pytho= n34\Lib\unittest\mock.py", line 1142, in patched
=C2=A0= =C2=A0 return func(*args, **keywargs)
=C2=A0 File "C:\Proje= cts\pgadmin4\web\pgadmin\browser\server_groups\servers\databases\= external_tables\tests\test_external_tables_view.py", line 39= 3, in __test_node
=C2=A0 =C2=A0 **self.expect_render_template_called_with
=C2=A0 File "C:\Python34\Lib\unittest\mock.py", line 777, in assert_called_with
=C2=A0 =C2=A0 raise A= ssertionError(_error_message()) from cause
AssertionError: E= xpected call: render_template(external_table_id=3D11, template_name_or= _list=3D'sql/#gpdb#80323#/node.sql')
Actual call: re= nder_template(external_table_id=3D11, template_name_or_list=3D'sql= /#gpdb#80323#\\node.sql')

=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: ru= nTest (pgadmin.browser.server_groups.servers.databases.external_t= ables.tests.test_external_tables_view.TestExternalTablesView)
#properties When retrieving the properties of a external table and t= he table exists, it return the properties and status 200
--------= --------------------------------------------------------------
Traceback (most recent call last):
=C2=A0 File "C:\P= ython34\Lib\unittest\mock.py", line 1142, in patched
= =C2=A0 =C2=A0 return func(*args, **keywargs)
=C2=A0 File "C:= \Projects\pgadmin4\web\pgadmin\browser\server_groups\servers\data= bases\external_tables\tests\test_external_tables_view.py", l= ine 320, in runTest
=C2=A0 =C2=A0 self.__test_properties()
<= div>=C2=A0 File "C:\Python34\Lib\unittest\mock.py", line 114= 2, in patched
=C2=A0 =C2=A0 return func(*args, **keywargs)
<= div>=C2=A0 File "C:\Projects\pgadmin4\web\pgadmin\browser\server_= groups\servers\databases\external_tables\tests\test_external_tabl= es_view.py", line 419, in __test_properties
=C2=A0 =C2= =A0 **self.expect_render_template_called_with
=C2=A0 File &q= uot;C:\Python34\Lib\unittest\mock.py", line 777, in assert_called= _with
=C2=A0 =C2=A0 raise AssertionError(_error_message()) f= rom cause
AssertionError: Expected call: render_template(template= _name_or_list=3D'sql/#gpdb#80323#/get_table_information.sql&#= 39;, table_oid=3D11)
Actual call: render_template(template_name_<= wbr>or_list=3D'sql/#gpdb#80323#\\get_table_information.sql', t= able_oid=3D11)

------------------------------= ----------------------------------------
Ran 256 tests in 77= .123s

FAILED (failures=3D7, errors=3D4, skipped=3D= 25)

=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
Test Result Summary
=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

PostgreSQL 9.6:

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 234 tests passed
=C2=A0 =C2=A0 =C2=A0 =C2=A0 3 tests f= ailed:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Te= stExternalTablesView (#node When retrieving the information about 1 externa= l table and table does not exist, it return an error message and status 404= ,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 #node When retrieving the information about 1 external table and an err= or happens while executing the query, it return an internal server error an= d status 500,
=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=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 #nodes When retrieving the nodes and the database has 2 e= xternal tables, it return 2 child nodes and status 200,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #nodes When ret= rieving the information about 1 external table and the table exists, it ret= urn external node information and status 200,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #nodes When retrieving the= nodes and an error happens while executing the query, it return an interna= l server error and status 500,
=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=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #properties When retrieving the properties = of a external table and the table exists, it return the properties and stat= us 200,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 #nodes When retrieving the nodes and the database does not have = external tables, it return no child nodes and status 200)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ChangePasswordTestCase (Te= stCase for Changing Valid_Password)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 TestTemplateCreate (When rendering GreenPlum 5.= 3 template, when no distribution is present, when no primary key is present= , it returns "DISTRIBUTED RANDOMLY",
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 When rendering GreenPlum 5= .3 template, when distribution is present, it returns "DISTRIBUTED BY = (attr1, attr2, attr4)",
=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=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 When rendering GreenPlum 5.3 template, when= no distribution is present, when primary key is present, it returns "= DISTRIBUTED BY (attr_primary_key)")
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 19 tests skipped:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ResourceGroupsGetTestCase (Get resource groups)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TableSpaceDeleteTestCa= se (Check Tablespace Node)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ResourceGroupsDeleteTestCase (Delete resource groups)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SynonymDelet= eTestCase (Fetch synonym Node URL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 TestSSLConnection (Test for SSL connection)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PackageAddTe= stCase (Fetch Package Node URL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 SynonymPutTestCase (Fetch synonym Node URL)
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TablespaceGetTe= stCase (Check Tablespace Node)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 SynonymAddTestCase (Default Node URL)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PackagePutTestCase (Fe= tch Package Node URL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 TableAddTestCase (Create Range partitioned table with 2 parti= tions,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 Create List partitioned table with 2 partitions)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PackageGetTestCase (Fe= tch Package Node URL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 PackageDeleteTestCase (Fetch Package Node URL)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TableSpaceAddTestCase = (Check Tablespace Node)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 ResourceGroupsAddTestCase (Add resource groups)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SynonymGetTestCase = (Fetch synonym Node URL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ResourceGroupsPutTestCase (Put resource groups)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TableSpaceUpdateTe= stCase (Check Tablespace Node)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 TableUpdateTestCase (Attach partition to existing ran= ge partitioned table,
=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=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 Detach partition from existing range partitioned t= able,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 Create partitions of existing range partitioned table,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Detach parti= tion from existing list partitioned table,
=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create partitions of existing= list partitioned table,
=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=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 Attach partition to existing list partitioned t= able)

=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

########


Thanks,
N= eel Patel

On Fri, Mar 2, 2018 at 10:19 PM, Dave Page <= ;dpage@pgadmin.org> wrote:
S= upport for external tables in GPDB. Fixes #3168

Branch
------
master

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

Modified Files
--------------
.../servers/databases/external_tables/__init__.py=C2=A0 | 275 ++++++++= +++++
.../databases/external_tables/actions/__init__.py=C2=A0 |=C2=A0 =C2=A0= 0
.../external_tables/actions/get_all_nodes.py=C2=A0 =C2=A0 =C2=A0 =C2= =A0|=C2=A0 =C2=A04 +
.../databases/external_tables/mapping_utils.py=C2=A0 =C2=A0 =C2=A0| 16= 5 ++++++++
.../databases/external_tables/properties.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 78 ++++
.../external_tables/reverse_engineer_ddl.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 69 ++++
.../static/img/coll-external_table.svg=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0|=C2=A0 =C2=A01 +
.../external_tables/static/img/external_table.svg=C2=A0 |=C2=A0 =C2=A0= 1 +
.../templates/sql/gpdb_5.0_plus/create.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 60 +++
.../templates/sql/gpdb_5.0_plus/get_columns.sql=C2=A0 =C2=A0 |=C2=A0 1= 2 +
.../sql/gpdb_5.0_plus/get_table_information.sql=C2=A0 =C2=A0 |=C2=A0 2= 2 ++
.../templates/sql/gpdb_5.0_plus/list.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 =C2=A06 +
.../templates/sql/gpdb_5.0_plus/node.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 =C2=A05 +
.../databases/external_tables/tests/__init__.py=C2=A0 =C2=A0 |=C2=A0 = =C2=A00
.../tests/test_external_tables_module.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 99 +++++
.../tests/test_external_tables_view.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| 428 +++++++++++++++++++++
.../external_tables/tests/test_mapping_utils.py=C2=A0 =C2=A0 | 375 +++= +++++++++++++++
.../external_tables/tests/test_properties.py=C2=A0 =C2=A0 =C2=A0 =C2= =A0| 156 ++++++++
.../tests/test_reverse_engineer_ddl.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| 261 +++++++++++++
.../tests/test_sql_template_create_integration.py=C2=A0 |=C2=A0 =C2=A0= 0
.../templates/table/sql/gpdb_5.0_plus/nodes.sql=C2=A0 =C2=A0 |=C2=A0 = =C2=A01 +
web/pgadmin/static/bundle/browser.js=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A01 +
.../databases/external_tables/external_tables.js=C2=A0 =C2=A0|=C2=A0 8= 8 +++++
.../servers/databases/external_tables/index.js=C2=A0 =C2=A0 =C2=A0|=C2= =A0 18 +
web/pgadmin/tools/sqleditor/__init__.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 =C2=A01 +
.../external_tables/external_tables_spec.js=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 56 +++
web/webpack.config.js=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=A0 |=C2=A0 =C2=A09 +
web/webpack.shim.js=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=A0 =C2=A0 |=C2=A0 =C2=A03 + 28 files changed, 2194 insertions(+)




--001a113ceb8460b4be05673820c3--