Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8iPJ-00022g-PN for pgadmin-hackers@arkaria.postgresql.org; Thu, 11 May 2017 07:21:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8iPJ-0000EW-Cz for pgadmin-hackers@arkaria.postgresql.org; Thu, 11 May 2017 07:21:05 +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 1d8iP4-0007pq-99 for pgadmin-hackers@postgresql.org; Thu, 11 May 2017 07:20:50 +0000 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d8iOz-000456-Lu for pgadmin-hackers@postgresql.org; Thu, 11 May 2017 07:20:49 +0000 Received: by mail-oi0-x233.google.com with SMTP id w10so20459477oif.0 for ; Thu, 11 May 2017 00:20:45 -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=7p7xL2DrsyB/7EigMSADMOicA9qcQqHXDjTTYUGYmr0=; b=xOIs1X/yZPnGdEvuG6qHkykLbt5eLOAIyetNBB8Rf3xMuxg2GY39pgRKHE5pGhFjVd nX9UXSw7fZX5tkBYGUlibUveHtoGXmBixSg2ffJetgiUpYMAPygLCk0wepfoSylykc9q mLmMyDe5fWY9f7ta1A15S8ldVrDCOdlkOQkg3XaUhtOJdRtRLT9qsBHWYYycDJDuMSFk fWvvw0j510XDDqjbEmCHKVC2j8YiQGYV9kQMi9By+sjmVKBdEwLedxi60G253mWwmQUg RnpH9ir49dEJJUHAXDcQG85WcwilbEd9mYALPPqQiHuTmwcV86I0bqmRmmSoJBM8DA2u WxOA== 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=7p7xL2DrsyB/7EigMSADMOicA9qcQqHXDjTTYUGYmr0=; b=fMCSrYZNKzGFxDo97oc4E6ZS7lxlWxekEE8dnyVXi/W4Dg77aKARsuCaj/nSoBWZR8 GjbW5MH12utLc692hxbSY8AU18K/BLQxNklSS9v6hMbXRuyYO93WQcIMjlTcNb+ZuxTI Li0lBOMyTSedi2t/TRGIt1Pooub3WK9xsQj0XkN8oh7Yxl1EextXHA5cbt3C25OkYtL2 j0Uv0cc4Q+D8KdUXLkAnUiFrtfLgWmQbCWnFk6U3CIK8VwTUhPs+c286/Z1c6wINAjkZ RqVPwnxrmBXqRb+/Kh5ArQXlWxqFa1ozV+V+mSN6xLiv0ybflEb2ZLHy8BoVcfeAAp7l LBRw== X-Gm-Message-State: AODbwcAw1f5M9qKtg7PANWCt+kQRshkgCTcQfzxp9VEhABvjIPDmtxxj 0OLhrsMfaH7eUOWfojiKNPeH5WPjuguI X-Received: by 10.157.40.5 with SMTP id m5mr5097148otb.111.1494487243754; Thu, 11 May 2017 00:20:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.138.13 with HTTP; Thu, 11 May 2017 00:20:42 -0700 (PDT) In-Reply-To: <19B13ECE-CA6A-48E7-BF70-264F490F40B4@pgadmin.org> References: <19B13ECE-CA6A-48E7-BF70-264F490F40B4@pgadmin.org> From: Khushboo Vashi Date: Thu, 11 May 2017 12:50:42 +0530 Message-ID: Subject: Re: [patch] Dependents and Dependencies in GreenPlum To: Dave Page Cc: Akshay Joshi , Sarah McAlear , Joao Pedro De Almeida Pereira , Robert Eckhardt , Matthew Kleiman , Ashesh Vashi , pgadmin-hackers Content-Type: multipart/alternative; boundary=001a113e1b3e497bd5054f3a6d97 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 --001a113e1b3e497bd5054f3a6d97 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, May 11, 2017 at 12:03 PM, Dave Page wrote: > > > On 11 May 2017, at 07:11, Akshay Joshi > wrote: > > Hi Sarah > > On Thu, May 11, 2017 at 2:30 AM, Sarah McAlear > wrote: > >> Hi Ashkay! >> >> TestTablesNodeSql hasn't failed but TestRoleDependenciesSql failed with >>> below error: >>> .....\test_role_dependencies_sql.py\", line 41, in assertions\n >>> self.assertEqual(1, len(fetch_result))\nAssertionError: 1 !=3D 0 >> >> >> We experienced a similar problem when we started developing this patch. >> We noticed that we were connecting to the database with the super user (= the >> db owner user), which did not create the role we are expecting when a ta= ble >> is created. To ensure that this role is created, we had to create a new >> user and use it to execute all the tests. After we made this change, the >> tests passed. >> >> Can you try to create a new user and use it to execute your tests? >> > > I did that and it works. I have created new user 'test' with superuse= r > privileges and update parameter db_username=3D"test" in test_config.json > file. But still I am unable to understand why it doesn't work with > 'postgres' (default) user? > > > Agreed. That suggests something fishy is going on that should be > understood. > > We don't check role dependencies for every object. As per the code, the role dependencies are executed for columns not for the table itself. And in the test cases, the table object is trying to execute the role dependencies, so I think this test case is not correct. > >> Thanks, >> Jo=C3=A3o & Sarah >> >> On Wed, May 10, 2017 at 1:56 PM, Akshay Joshi < >> akshay.joshi@enterprisedb.com> wrote: >> >>> >>> >>> On May 10, 2017 19:07, "Sarah McAlear" wrote: >>> >>> Hi Akshay! >>> >>> Does this error occur on 9.6 or 10.0? We tested it in 9.6 and all our >>> tests pass. >>> >>> >>> On both 9.6 and 10.0. Query returned 0 rows which is compared >>> against 1 in assert statement. >>> >>> >>> Thanks! >>> Jo=C3=A3o & Sarah >>> >>> On Wed, May 10, 2017 at 2:29 AM, Akshay Joshi < >>> akshay.joshi@enterprisedb.com> wrote: >>> >>>> Hi Sarah >>>> >>>> On Tue, May 9, 2017 at 9:03 PM, Sarah McAlear >>>> wrote: >>>> >>>>> Hi Akshay! >>>>> >>>>> >>>>>> Some test file names ended with "*_sql_template.py*" do we need to >>>>>> add that string ? >>>>> >>>>> we added this suffix after moving the tests up a level to tables/test= s >>>>> to clarify what subject they applied to. we changed the suffix to "_s= ql.py" >>>>> >>>>> - Files "test_column_acl_sql_template.py" and "test_column_properties= _ >>>>>> sql_template.py" should be moved from tables->tests to >>>>>> tables->column->tests. As it's related to column. >>>>>> - Files "test_trigger_get_oid_sql_template.py" and " >>>>>> test_trigger_nodes_sql_template.py" should be moved from >>>>>> tables->tests to tables->triggers->tests. As its related to triggers= . >>>>> >>>>> these tests are related to the sql files in tables/templates/column, >>>>> not tables/column, so moving them into tables/column would be more >>>>> confusing. >>>>> >>>>> Following test cases are failing >>>>> >>>>> Thank you, fixed, see new patch. Can you confirm that >>>>> TestTablesNodeSql doesn't fail in your environment? >>>>> >>>> >>>> TestTablesNodeSql hasn't failed but TestRoleDependenciesSql failed >>>> with below error: >>>> .....\test_role_dependencies_sql.py\", line 41, in assertions\n >>>> self.assertEqual(1, len(fetch_result))\nAssertionError: 1 !=3D 0 >>>> >>>> >>>>> Thanks, >>>>> George & Sarah >>>>> >>>>> >>>> >>>> >>>> -- >>>> *Akshay Joshi* >>>> *Principal Software Engineer * >>>> >>>> >>>> >>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 >>>> 976-788-8246 <+91%2097678%2088246>* >>>> >>> >>> >>> >> > > > -- > *Akshay Joshi* > *Principal Software Engineer * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* > > --001a113e1b3e497bd5054f3a6d97 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, May 11, 2017 at 12:03 PM, Dave Page <dpage@pgadmin.org>= wrote:


On 11 May 2017, at 07:11, Akshay= Joshi <akshay.joshi@enterprisedb.com> wrote:

Hi Sarah

On Thu, May 11,= 2017 at 2:30 AM, Sarah McAlear <smcalear@pivotal.io> wrot= e:
Hi= Ashkay!

TestTablesNodeSql hasn= 't failed but TestRoleDependenciesSql failed with below error:
=C2= =A0 =C2=A0 .....\test_role_dependencies_sql.py\", line 41, in assertions\n=C2=A0self.assertEqual(1, len(fetch_result))\n= AssertionError: 1 !=3D 0

We experienced a similar problem when we started dev= eloping this patch. We noticed that we were connecting to the database with= the super user (the db owner user), which did not create the role we are e= xpecting when a table is created. To ensure that this role is created, we h= ad to create a new user and use it to execute all the tests. After we made = this change, the tests passed.=C2=A0

Can you try t= o create a new user and use it to execute your tests?

=C2=A0 =C2=A0 I did that and it works. I have create= d new user 'test' with superuser privileges and update parameter db= _username=3D"test" in test_config.json file. But still I am unabl= e to understand why it doesn't work with 'postgres' (default) u= ser? =C2=A0

Agreed. That suggests something fishy is going on that should be unde= rstood.

=

We don't check role dependencies for e= very object. As per the code, the role dependencies are executed for column= s not for the table itself.
And in the test cases, the table obje= ct is trying to execute the role dependencies, so I think this test case is= not correct.

Thanks,
Jo=C3=A3o & Sarah

On Wed, May 10, 2017 at 1:56 PM, Akshay Joshi <<= a href=3D"mailto:akshay.joshi@enterprisedb.com" target=3D"_blank">akshay.jo= shi@enterprisedb.com> wrote:


On May 10, 2017 19:07, "Sara= h McAlear" <smcalear@pivotal.io> wrote:
Hi Akshay!

=
Does this error occur on 9.6 or 10.0? We tested it in 9.6 = and all our tests pass.

=C2=A0 =C2=A0 On both 9.6 and 1= 0.0. Query returned 0 rows which is compared against 1 in assert statement.= =C2=A0

Thanks!
Jo=C3=A3o & Sarah

On Wed, May 10, 2017 at 2:29 AM, Akshay Joshi <<= a href=3D"mailto:akshay.joshi@enterprisedb.com" target=3D"_blank">akshay.jo= shi@enterprisedb.com> wrote:
Hi Sarah

On Tue, May 9, 2017 at 9:03 PM, Sar= ah McAlear <smcalear@pivotal.io> wrote:
Hi Akshay!
=C2=A0<= /div>
Some test file names en= ded with "_sql_temp= late.py" do we need= to add that string ?=C2=A0
we added this su= ffix after moving the tests up a level to tables/tests to clarify what subj= ect they applied to. we changed the suffix to "_sql.py"

- Files "test_column_ac= l_sql_template.py" and "test_column_properties_sql_template.py" should be moved from tables->tests to tables->column= ->tests. As it's related to column.
- Files "test_trigger_get_oid_sql_template.<= span id=3D"gmail-m_3359070155544194339gmail-m_-3884119776391541776m_-814715= 9490417204725m_49393127707594913m_-452370693477769833gmail-m_32228059804928= 65171gmail-m_-2993543217916664024:34c.46">py" and "
= test_trigger_nodes_sql_template.py" should be moved from tables->tests to tables->triggers->= tests. As its related to triggers.
these tests are = related to the sql files in tables/templates/column, not tables/column, so = moving them into tables/column would be more confusing.=C2=A0

Following test= cases are failing
Thank you, fixed, see new= patch. Can you confirm that TestTablesNodeSql doesn't fail in your env= ironment?
=C2=A0 =C2=A0
=C2= =A0 =C2=A0 TestTablesNodeSql hasn't failed but TestRoleDependenciesSql = failed with below error:
=C2=A0 =C2=A0 .....\test_role_d= ependencies_sql.py\", line 41, in= assertions\n self.assertEqual(1, len(fe= tch_result))\nAssertionError: 1 !=3D 0=


Thanks,
G= eorge & Sarah




--
Akshay = Joshi
Principal Software Engineer=C2=A0
=
=






--
=
=
Akshay Joshi
Principal Software Engineer=C2=A0


Phone: +91 20-3058-9517
Mobile: +91 976-7= 88-8246

--001a113e1b3e497bd5054f3a6d97--