Re: Add regression tests for SET xxx

Lists: pgsql-hackers
From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Add regression tests for SET xxx
Date: 2013-05-26 17:56:29
Message-ID: CAEP4nAy+TAjgWhcGEPcYx3UFnd2Yp1i4r_BjH-gryFtkTd8Mvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Please find attached a patch to take code-coverage of SET (SESSION / SEED /
TRANSACTION / DATESTYLE / TIME ZONE) (src/backend/commands/variable.c) from
65% to 82%.

Any and all feedback is welcome.
--
Robins Tharakan

Attachment Content-Type Size
regress_variable.patch application/octet-stream 10.4 KB

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-17 11:59:43
Message-ID: CAFjNrYtUEOcohYCYz4S6vj5BnY+YSUuiEQWGykTgtq8AnSha+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 26 May 2013 19:56, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:

> Hi,
>
> Please find attached a patch to take code-coverage of SET (SESSION / SEED
> / TRANSACTION / DATESTYLE / TIME ZONE) (src/backend/commands/variable.c)
> from 65% to 82%.
>
> Any and all feedback is welcome.
> --
> Robins Tharakan
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
Hi,
the patch applies cleanly on code from trunk, however there are failing
tests, diff attached.

regards
Szymon

Attachment Content-Type Size
regression.diffs application/octet-stream 1.5 KB

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Szymon Guz <mabewlun(at)gmail(dot)com>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 00:33:35
Message-ID: CAEP4nAx07zHF_3n0gPzYF4Yve3Tna3=oMZ=KnrEKCqMvTAWi0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks !

PFA the updated patch. Also remove a trailing whitespace at the end of SQL
script.

--
Robins Tharakan

On 17 June 2013 17:29, Szymon Guz <mabewlun(at)gmail(dot)com> wrote:

> On 26 May 2013 19:56, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:
>
>> Hi,
>>
>> Please find attached a patch to take code-coverage of SET (SESSION / SEED
>> / TRANSACTION / DATESTYLE / TIME ZONE) (src/backend/commands/variable.c)
>> from 65% to 82%.
>>
>> Any and all feedback is welcome.
>> --
>> Robins Tharakan
>>
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>>
>>
> Hi,
> the patch applies cleanly on code from trunk, however there are failing
> tests, diff attached.
>
> regards
> Szymon
>

Attachment Content-Type Size
regress_variable_v3.patch application/octet-stream 10.5 KB

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 10:01:09
Message-ID: CAFjNrYtMg3cxn9Zx5rXfpRmMbVAuCkuy-1xU4WhSnEQBtDmsww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 18 June 2013 02:33, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:

> Thanks !
>
> PFA the updated patch. Also remove a trailing whitespace at the end of SQL
> script.
>
> --
> Robins Tharakan
>
>
> On 17 June 2013 17:29, Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
>
>> On 26 May 2013 19:56, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:
>>
>>> Hi,
>>>
>>> Please find attached a patch to take code-coverage of SET (SESSION /
>>> SEED / TRANSACTION / DATESTYLE / TIME ZONE) (
>>> src/backend/commands/variable.c) from 65% to 82%.
>>>
>>> Any and all feedback is welcome.
>>> --
>>> Robins Tharakan
>>>
>>>
>>> --
>>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-hackers
>>>
>>>
>> Hi,
>> the patch applies cleanly on code from trunk, however there are failing
>> tests, diff attached.
>>
>> regards
>> Szymon
>>
>
>
Hi,
I've checked the patch. Applies cleanly. Tests pass this time :)

Could you add me as a reviewer to commitfest website, set this patch a
reviewed and add this email to the patch history?
I cannot login to the commitfest app, there is some bug with that.

thanks,
Szymon Guz


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Szymon Guz <mabewlun(at)gmail(dot)com>
Cc: Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 11:10:26
Message-ID: CAB7nPqT2LrVhF85GgCRtKrJwpAzPG-r2YSnM44MCPE68XJN9Yw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 18, 2013 at 7:01 PM, Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
> Could you add me as a reviewer to commitfest website, set this patch a
> reviewed and add this email to the patch history?
> I cannot login to the commitfest app, there is some bug with that.
You should be able to do it yourself by creating a community account
in postgresql.org.
--
Michael


From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 11:24:27
Message-ID: CAFjNrYsE9tLnJO5-CJ2eDfmrJfhQ_ByakkB_GuXPdWqGt92Uog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 18 June 2013 13:10, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:

> On Tue, Jun 18, 2013 at 7:01 PM, Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
> > Could you add me as a reviewer to commitfest website, set this patch a
> > reviewed and add this email to the patch history?
> > I cannot login to the commitfest app, there is some bug with that.
> You should be able to do it yourself by creating a community account
> in postgresql.org.
> --
> Michael
>

Yea, I know. Unfortunately there is a bug and currently you cannot login to
commitfest using a new account, or old, if you changed password like I did.
I've got a bug confirmation from Magnus on pgsql-www list.

thanks,
Szymon


From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Szymon Guz <mabewlun(at)gmail(dot)com>, Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 15:29:31
Message-ID: 1371569371.42823.YahooMailNeo@web162904.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Szymon Guz <mabewlun(at)gmail(dot)com> wrote:

> I've checked the patch. Applies cleanly. Tests pass this time :)

> Could you add me as a reviewer to commitfest website, set this
> patch a reviewed and add this email to the patch history?
> I cannot login to the commitfest app, there is some bug with
> that.

It sounded like you felt this was Ready for Committer, so I set it
that way.  Let me know if you don't think it's to that point yet.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-06-18 15:32:04
Message-ID: CAFjNrYvMre5Gmaq8yPhA9GaZuRFQ-Dn0doY_rWkpLD8v-cs5LA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 18 June 2013 17:29, Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:

> Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
>
> > I've checked the patch. Applies cleanly. Tests pass this time :)
>
> > Could you add me as a reviewer to commitfest website, set this
> > patch a reviewed and add this email to the patch history?
> > I cannot login to the commitfest app, there is some bug with
> > that.
>
> It sounded like you felt this was Ready for Committer, so I set it
> that way. Let me know if you don't think it's to that point yet.
>

Hi Kevin,
yes, that's what I was thinking about.

Thanks,
Szymon


From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Szymon Guz <mabewlun(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-07-07 17:15:48
Message-ID: CAEP4nAwfKjxPZkJPu0AghB3+WcewjtRA9wcO_ms_bcn+ihCwug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 18 June 2013 05:01, Szymon Guz <mabewlun(at)gmail(dot)com> wrote:

> I've checked the patch. Applies cleanly. Tests pass this time :)

Updated the patch:
- Updated ROLE names as per Robert's feedback (regress_xxx)
- Added test to serial_schedule

--
Robins Tharakan

Attachment Content-Type Size
regress_variable_v5.patch application/octet-stream 11.5 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: Szymon Guz <mabewlun(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add regression tests for SET xxx
Date: 2013-07-15 17:20:44
Message-ID: CA+TgmoYXvFLdqqCoUkPyLpTbnCdnZz=_ENJvsDWKjWG=qwjNJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jul 7, 2013 at 1:15 PM, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:
> Updated the patch:
> - Updated ROLE names as per Robert's feedback (regress_xxx)
> - Added test to serial_schedule

Please see my comments on the LOCK tests related to these points and
update accordingly.

+BEGIN TRANSACTION;
+INVALID_COMMAND;
+ERROR: syntax error at or near "INVALID_COMMAND"
+LINE 1: INVALID_COMMAND;
+ ^
+SET SESSION AUTHORIZATION regress_role_var1;
+ERROR: current transaction is aborted, commands ignored until end of
transaction block

We have a test for this error message in the "transactions" test, so I
don't think we need another one here. This error is thrown at a very
high level in e.g. exec_simple_query. The only dependence on the
particular command is in IsTransactionExitStmt() - IOW, there's
nothing special about SET, and if we're going to test this for SET
ROLE and SET SESSION AUTHORIZATION, then why not for every single
command we have?

+SET DATESTYLE = ISO, SQL;
+ERROR: invalid value for parameter "DateStyle": "iso, sql"
+DETAIL: Conflicting "datestyle" specifications.
+SET DATESTYLE = SQL, ISO;
+ERROR: invalid value for parameter "DateStyle": "sql, iso"
+DETAIL: Conflicting "datestyle" specifications.
+SET DATESTYLE = ISO, POSTGRES;
+ERROR: invalid value for parameter "DateStyle": "iso, postgres"
+DETAIL: Conflicting "datestyle" specifications.
+SET DATESTYLE = POSTGRES, ISO;

...et cetera, ad nauseum. While there's something to be said for
completeness, the chances that future maintainers of this code will
update these regression tests with all the new permutations every time
new options are added seem low. I recommend testing a representative
sample of three of these, or so, and skipping the rest.

+SET TIME ZONE INTERVAL '1 month +05:30' HOUR TO MINUTE;
+ERROR: invalid value for parameter "TimeZone": "INTERVAL '@ 1 mon 5
hours 30 mins'"

Wow, what a terrible error message. This is not your patch's fault,
but maybe we should look at improving that?

I am inclined to think that these tests should be split up and moved
into the files where similar things are being tested already. The SET
TIME ZONE tests probably belong in horology.sql, the SET DATESTYLE
tests with the related tests in interval.sql, and much of the other
stuff in transactions.sql.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company