Re: [HACKERS] [PATCH] Tests for reloptions - Mailing list pgsql-hackers

From Nikolay Shaplov
Subject Re: [HACKERS] [PATCH] Tests for reloptions
Date
Msg-id 1514042.nPA0zSFN5r@x200m
Whole thread Raw
In response to [HACKERS] [PATCH] Tests for reloptions  (Nikolay Shaplov <dhyan@nataraj.su>)
Responses Re: [HACKERS] [PATCH] Tests for reloptions
List pgsql-hackers
While working with reloptions refactoring patch, I've written series of tests 
that triggers reloptions related code in all access methods. (I needed it to 
make sure I did not break anything while coding)

I've included these tests to that patch.

Meanwhile Alvaro suggested to commit these tests before the main patch, in 
order to make sure, that this patch does not change usual behavior.

So these tests separated from reloptions patch is in the attachment.

I've removed tests that check functionality that were introduced only in my 
patch, and kept those that checks things that are already in postgres.

I also compared test coverage before and after applying this patch 
(You can also compare, I put coverage results online
http://lj.nataraj.su/2017/reloptions_fix/coverage-master/
http://lj.nataraj.su/2017/reloptions_fix/coverage-patched/ )

Tests adds almost 600 lines to the test covered code (but see note at the end 
of the letter)

src/backend/access/common/reloptions.c get only 7 lines, it was quite covered 
by existing test, but all most of the access methods gets some coverage 
increase:

src/backend/access/brin        1268 -> 1280 (+18)
src/backend/access/gin        2924 -> 2924 (0)
src/backend/access/gist        1673 -> 2108 (+435)
src/backend/access/hash    1580 -> 1638 (+58)
src/backend/access/heap    2863 -> 2866 (+3) 
src/backend/access/nbtree    2565 -> 2647 (+82)
src/backend/access/spgist    2066 -> 2068 (+2)

Though I should say that incredible coverage boost for gist, is the result of 
not steady results of test run. The real value should be much less...

Nevertheless tests touches the reloptions related code, checks for proper 
error handling, and it is good.

I think we should commit it.







  

 

-- 
Do code for fun. Can do it for money (Perl & C/C++ ~10h/week)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] [PATCH] Incremental sort