Add some regression tests for SEQUENCE

Started by Robins Tharakanabout 13 years ago18 messageshackers
Jump to latest
#1Robins Tharakan
tharakan@gmail.com

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

Attachments:

commit-sequence.patchapplication/octet-stream; name=commit-sequence.patchDownload+0-105
#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Robins Tharakan (#1)
Re: Add some regression tests for SEQUENCE

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Robins Tharakan
tharakan@gmail.com
In reply to: Laurenz Albe (#2)
Re: Add some regression tests for SEQUENCE

Thanks Laurenz.

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

--
Robins
Tharakan

On 13 March 2013 13:49, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:

Show quoted text

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

#4Robins Tharakan
tharakan@gmail.com
In reply to: Robins Tharakan (#3)
Re: Add some regression tests for SEQUENCE

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@gmail.com> wrote:

Show quoted text

Thanks Laurenz.

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

--
Robins
Tharakan

On 13 March 2013 13:49, Albe Laurenz <laurenz.albe@wien.gv.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

Attachments:

regress-sequence.patchapplication/octet-stream; name=regress-sequence.patchDownload+465-1
#5Robins Tharakan
tharakan@gmail.com
In reply to: Robins Tharakan (#4)
Re: Add some regression tests for SEQUENCE

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@gmail.com> wrote:

Show quoted text

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.

Attachments:

regress_sequence_v2.patchapplication/octet-stream; name=regress_sequence_v2.patchDownload+517-1
#6Josh Kupershmidt
schmiddy@gmail.com
In reply to: Robins Tharakan (#5)
Re: Add some regression tests for SEQUENCE

On Mon, Mar 18, 2013 at 3:10 PM, Robins Tharakan <tharakan@gmail.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Robins Tharakan
tharakan@gmail.com
In reply to: Josh Kupershmidt (#6)
Re: Add some regression tests for SEQUENCE

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@gmail.com> wrote:

Show quoted text

On Mon, Mar 18, 2013 at 3:10 PM, Robins Tharakan <tharakan@gmail.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

Attachments:

regress_sequence_v3.patchapplication/octet-stream; name=regress_sequence_v3.patchDownload+517-1
#8Robins Tharakan
tharakan@gmail.com
In reply to: Robins Tharakan (#7)
Re: Add some regression tests for SEQUENCE

Hi,

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

--
Robins Tharakan

Attachments:

regress_sequence_v4.patchapplication/octet-stream; name=regress_sequence_v4.patchDownload+520-0
#9Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Robins Tharakan (#8)
Re: Add some regression tests for SEQUENCE

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.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#10Josh Berkus
josh@agliodbs.com
In reply to: Robins Tharakan (#1)
Re: Add some regression tests for SEQUENCE

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Robins Tharakan
tharakan@gmail.com
In reply to: Josh Berkus (#10)
Re: Add some regression tests for SEQUENCE

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@agliodbs.com> wrote:

Show quoted text

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

#12Josh Berkus
josh@agliodbs.com
In reply to: Robins Tharakan (#1)
Re: Add some regression tests for SEQUENCE

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Josh Berkus
josh@agliodbs.com
In reply to: Robins Tharakan (#1)
Re: Add some regression tests for SEQUENCE

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#14Robert Haas
robertmhaas@gmail.com
In reply to: Robins Tharakan (#8)
Re: Add some regression tests for SEQUENCE

On Tue, May 7, 2013 at 6:40 PM, Robins Tharakan <tharakan@gmail.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#15Robins Tharakan
tharakan@gmail.com
In reply to: Robert Haas (#14)
Re: Add some regression tests for SEQUENCE

On 3 July 2013 10:13, Robert Haas <robertmhaas@gmail.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

Attachments:

regress_sequence_v5.patchapplication/octet-stream; name=regress_sequence_v5.patchDownload+520-0
#16Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Robins Tharakan (#15)
Re: Add some regression tests for SEQUENCE

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.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#17Robins Tharakan
tharakan@gmail.com
In reply to: Fabien COELHO (#16)
Re: Add some regression tests for SEQUENCE

On 9 July 2013 08:41, Fabien COELHO <coelho@cri.ensmp.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

Attachments:

regress_sequence_v6.patchapplication/octet-stream; name=regress_sequence_v6.patchDownload+520-0
#18Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Robins Tharakan (#17)
Re: Add some regression tests for SEQUENCE

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.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers