Re: Add some regression tests for SEQUENCE

Lists: pgsql-hackers
From: robins <tharakan(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Add some regression tests for SEQUENCE
Date: 2013-03-12 16:35:05
Message-ID: CAEP4nAxjz1siRi1gQGT62h0psCgHw40-9=HA2tuBG5cQZ_udpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Attached is a small patch to test corner cases related to Sequences
(basically aimed at increasing code-coverage of sequence.sql in regression
tests).

Look forward to any and all feedback.
--
Robins
Tharakan

Attachment Content-Type Size
commit-sequence.patch application/octet-stream 4.1 KB

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "robins *EXTERN*" <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-03-13 08:19:43
Message-ID: A737B7A37273E048B164557ADEF4A58B057BDED1@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

robins wrote:
> Attached is a small patch to test corner cases related to Sequences (basically aimed at increasing
> code-coverage of sequence.sql in regression tests).
>
> Look forward to any and all feedback.

Looks ok except that the patch is backwards
(all added lines start with "-"). I found a typo:
"exit" instead of "exist".

You should add the patch to the next commitfest
(http://wiki.postgresql.org/wiki/Submitting_a_Patch).

Yours,
Laurenz Albe


From: robins <tharakan(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-03-13 10:11:53
Message-ID: CAEP4nAzKSHZ0S73jZK3Tam5pvjAo5GYgc1BK4Y5s8t3VhLP-oA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks Laurenz.

Would correct these (and readup) before submitting next patch.

--
Robins
Tharakan

On 13 March 2013 13:49, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:

> robins wrote:
> > Attached is a small patch to test corner cases related to Sequences
> (basically aimed at increasing
> > code-coverage of sequence.sql in regression tests).
> >
> > Look forward to any and all feedback.
>
> Looks ok except that the patch is backwards
> (all added lines start with "-"). I found a typo:
> "exit" instead of "exist".
>
> You should add the patch to the next commitfest
> (http://wiki.postgresql.org/wiki/Submitting_a_Patch).
>
> Yours,
> Laurenz Albe
>


From: robins <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-03-15 20:33:37
Message-ID: CAEP4nAyd78qR8Xjxjm_G4Ucm0arHn+OrKW9tvG_ABfMztf-2rA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I've added some regression tests for SEQUENCE. A cumulative patch is
attached.

Barring a (still to decipher) function seq_redo() and trying to learn how
to actually test it, this takes care of most branches of (
src/backend/commands/sequence.c) taking code-coverage (of 'make check') to
~95%.

Any feedback is more than welcome.
--
Robins
Tharakan

On 13 March 2013 15:41, robins <tharakan(at)gmail(dot)com> wrote:

> Thanks Laurenz.
>
> Would correct these (and readup) before submitting next patch.
>
> --
> Robins
> Tharakan
>
>
> On 13 March 2013 13:49, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:
>
>> robins wrote:
>> > Attached is a small patch to test corner cases related to Sequences
>> (basically aimed at increasing
>> > code-coverage of sequence.sql in regression tests).
>> >
>> > Look forward to any and all feedback.
>>
>> Looks ok except that the patch is backwards
>> (all added lines start with "-"). I found a typo:
>> "exit" instead of "exist".
>>
>> You should add the patch to the next commitfest
>> (http://wiki.postgresql.org/wiki/Submitting_a_Patch).
>>
>> Yours,
>> Laurenz Albe
>>
>
>

Attachment Content-Type Size
regress-sequence.patch application/octet-stream 15.3 KB

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-03-18 22:10:21
Message-ID: CAEP4nAyBrA2t2DJR+C8HLX-iTnVXZRdkmXeJBAoBBKO+UagjxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Please find an updated patch (reworked on the names of SEQUENCES / ROLES /
SCHEMA etc.)
Takes code-coverage of 'make check' for SEQUENCE to ~95%.

--
Robins Tharakan

On 16 March 2013 02:03, robins <tharakan(at)gmail(dot)com> wrote:

> Hi,
>
> I've added some regression tests for SEQUENCE. A cumulative patch is
> attached.
>
> Barring a (still to decipher) function seq_redo() and trying to learn how
> to actually test it, this takes care of most branches of (
> src/backend/commands/sequence.c) taking code-coverage (of 'make check')
> to ~95%.
>
> Any feedback is more than welcome.
>

Attachment Content-Type Size
regress_sequence_v2.patch application/octet-stream 16.8 KB

From: Josh Kupershmidt <schmiddy(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 some regression tests for SEQUENCE
Date: 2013-03-18 22:37:52
Message-ID: CAK3UJRGnfN4HBRFvxvwH2F3=xLpybMzcK+BEcKbWX9yAXyVd0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Mar 18, 2013 at 3:10 PM, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:
> Hi,
>
> Please find an updated patch (reworked on the names of SEQUENCES / ROLES /
> SCHEMA etc.)
> Takes code-coverage of 'make check' for SEQUENCE to ~95%.

There is a typo difference between sequence.out and sequence.sql
causing the test to fail:

+-- Should fail since seq5 shouldn't exist
...
+-- Should fail since seq5 shouldn't exit

Josh


From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-03-18 23:07:25
Message-ID: CAEP4nAxMvhEeJ2okCFqxixBJW_6Xdoz4q1AfG1AEjNB6Oqxf5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Duh. Apologies. That's what happens when you make that 1 last change.

Please find an updated patch.

--
Robins Tharakan

On 19 March 2013 04:07, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:

> On Mon, Mar 18, 2013 at 3:10 PM, Robins Tharakan <tharakan(at)gmail(dot)com>
> wrote:
> > Hi,
> >
> > Please find an updated patch (reworked on the names of SEQUENCES / ROLES
> /
> > SCHEMA etc.)
> > Takes code-coverage of 'make check' for SEQUENCE to ~95%.
>
> There is a typo difference between sequence.out and sequence.sql
> causing the test to fail:
>
> +-- Should fail since seq5 shouldn't exist
> ...
> +-- Should fail since seq5 shouldn't exit
>
> Josh
>

Attachment Content-Type Size
regress_sequence_v3.patch application/octet-stream 16.8 KB

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-05-07 22:40:11
Message-ID: CAEP4nAwsiNK_V_CPvgC-B9ejE9MDi-m6LDVu_ajAjQy6tJaU=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Have provided an updated patch as per Fabien's recent response on
Commitfest site.
Any and all feedback is appreciated.

--
Robins Tharakan

Attachment Content-Type Size
regress_sequence_v4.patch application/octet-stream 16.5 KB

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-05-08 07:55:07
Message-ID: alpine.DEB.2.02.1305080951310.2841@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> Have provided an updated patch as per Fabien's recent response on
> Commitfest site. Any and all feedback is appreciated.

Review:

This patch works for me.

It adds valuable sequence test cases, especially trying corner cases with
expected errors and permission denials.

I suggest to accept it.

--
Fabien.


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-06-28 20:53:46
Message-ID: 51CDF7DA.301@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 05/07/2013 03:40 PM, Robins Tharakan wrote:
> Hi,
>
> Have provided an updated patch as per Fabien's recent response on
> Commitfest site.
> Any and all feedback is appreciated.

The updated patch is giving a FAILURE for me:

parallel group (19 tests): limit temp plancache conversion rowtypes
prepare without_oid copy2 xml returning rangefuncs polymorphism with
domain truncate largeobject sequence alter_table plpgsql
plancache ... ok
limit ... ok
plpgsql ... ok
copy2 ... ok
temp ... ok
domain ... ok
rangefuncs ... ok
prepare ... ok
without_oid ... ok
conversion ... ok
truncate ... ok
alter_table ... ok
sequence ... FAILED

Thoughts?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-06-28 21:15:30
Message-ID: CAEP4nAwkRX+y9ioTfACbBC4tpk6M1T5kL_b7wuyZz_ronkZrhg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Seems like thats because of a recent (15th May 2013) patch
(b14206862278347a379f2bb72d92d16fb9dcea45) that changed the error message
that is printed. Its just one line of difference actually.

Let me know if this is otherwise good to go.
I'll checkout the latest revision and submit this patch again.

--
Robins Tharakan

On 28 June 2013 15:53, Josh Berkus <josh(at)agliodbs(dot)com> wrote:

> On 05/07/2013 03:40 PM, Robins Tharakan wrote:
> > Hi,
> >
> > Have provided an updated patch as per Fabien's recent response on
> > Commitfest site.
> > Any and all feedback is appreciated.
>
> The updated patch is giving a FAILURE for me:
>
> parallel group (19 tests): limit temp plancache conversion rowtypes
> prepare without_oid copy2 xml returning rangefuncs polymorphism with
> domain truncate largeobject sequence alter_table plpgsql
> plancache ... ok
> limit ... ok
> plpgsql ... ok
> copy2 ... ok
> temp ... ok
> domain ... ok
> rangefuncs ... ok
> prepare ... ok
> without_oid ... ok
> conversion ... ok
> truncate ... ok
> alter_table ... ok
> sequence ... FAILED
>
> Thoughts?
>
> --
> Josh Berkus
> PostgreSQL Experts Inc.
> http://pgexperts.com
>


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-06-28 21:22:15
Message-ID: 51CDFE87.5070402@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 06/28/2013 02:15 PM, Robins Tharakan wrote:
> Seems like thats because of a recent (15th May 2013) patch
> (b14206862278347a379f2bb72d92d16fb9dcea45) that changed the error message
> that is printed. Its just one line of difference actually.
>
> Let me know if this is otherwise good to go.
> I'll checkout the latest revision and submit this patch again.
>

I was only checking test timing, per my earlier email. I haven't looked
at the tests themselves at all.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-06-28 21:28:49
Message-ID: 51CE0011.9000607@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 06/28/2013 02:15 PM, Robins Tharakan wrote:
> Seems like thats because of a recent (15th May 2013) patch
> (b14206862278347a379f2bb72d92d16fb9dcea45) that changed the error message
> that is printed. Its just one line of difference actually.
>
> Let me know if this is otherwise good to go.
> I'll checkout the latest revision and submit this patch again.
>

I was only checking test timing, per my earlier email. I haven't looked
at the tests themselves at all.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


From: Robert Haas <robertmhaas(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>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-07-03 15:13:00
Message-ID: CA+TgmoYz-AFWqNo0WMwF_Mc+JuQd8fXo-vALNd+hsrEFEoy8MA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, May 7, 2013 at 6:40 PM, Robins Tharakan <tharakan(at)gmail(dot)com> wrote:
> Have provided an updated patch as per Fabien's recent response on Commitfest
> site.
> Any and all feedback is appreciated.

I think you should rename the roles used here to regress_rol_seq1 etc.
to match the CREATE OPERATOR patch.

And you need to update the expected output.

Setting this one to "Waiting on Author".

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


From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-07-07 13:01:51
Message-ID: CAEP4nAyZXv-nSWDxKpdKtDFXX+35G+6=dZFYxH7k0LKyH0dgdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 3 July 2013 10:13, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> I think you should rename the roles used here to regress_rol_seq1 etc.
> to match the CREATE OPERATOR patch.
>

Please find updated patch:
- 'make check' successful with recent changes
- Renamed ROLEs as per feedback

--
Robins Tharakan

Attachment Content-Type Size
regress_sequence_v5.patch application/octet-stream 16.5 KB

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-07-09 15:41:56
Message-ID: alpine.DEB.2.02.1307091740280.11644@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> Please find updated patch:
> - 'make check' successful with recent changes
> - Renamed ROLEs as per feedback

Sorry, I took the wrong thread.

I do not see any difference between both "regress_sequence_v[45].patch".
I guess you sent the earlier version.

--
Fabien.


From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-07-15 13:09:08
Message-ID: CAEP4nAxU5JijiXBUP6Xqvx7n9iP-+_ExQVqGGhbsdSwfWfpSWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 9 July 2013 08:41, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:

> I do not see any difference between both "regress_sequence_v[45].patch"**.
> I guess you sent the earlier version.
>

Thanks Fabien. This was a wrong attachment to the email.
Please find attached the updated patch (I've renamed v5 as v6 for clarity).

git reset --hard HEAD
git pull
patch -p1 < ../regress_sequence_v6.patch
patch -p1 -R < ../regress_sequence_v6.patch
patch -p1 < ../regress_sequence_v6.patch
make clean
./configure --enable-depend --enable-coverage --enable-cassert
--enable-debug
make -j3 check

--
Robins Tharakan

Attachment Content-Type Size
regress_sequence_v6.patch application/octet-stream 16.7 KB

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some regression tests for SEQUENCE
Date: 2013-07-18 11:46:11
Message-ID: alpine.DEB.2.02.1307181316250.3991@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello Robins,

> Thanks Fabien. This was a wrong attachment to the email.

This patch works for me (applied, tested).

However, some remarks:

seq4: should it check something? How do you know that OWNED BY did
anything?

regress_role_seq2: shoult check that the sequence owner is the table
owner?

seq12/seq14: is it twice the same tests??

seq13/seq15: idem??

I still do not know what "asdf" means... it is about the qwerty keyboard?
What about something explicit, like regress_seq_undefined?

seq22: remove the "syntax error" check at the end, pg people do not want
syntax error checks.

Also, here is a proposal for testing that CACHE is working:

-- check CACHE operation by resetting the sequence cache size
CREATE SEQUENCE seq31 CACHE 10;
-- 1 to 10 are preallocated
SELECT NEXTVAL('seq31');
-- reset cache, 2..10 are lost, should start again from 11
ALTER SEQUENCE seq31 CACHE 1;
SELECT NEXTVAL('seq31');
DROP SEQUENCE seq31;

--
Fabien.