Re: [PATCH] Tests for reloptions

From: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: [PATCH] Tests for reloptions
Date: 2017-09-30 20:18:35
Message-ID: 1514042.nPA0zSFN5r@x200m
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Attachment Content-Type Size
relopt_tests_v2a.diff text/x-patch 29.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2017-09-30 20:20:19 Re: [PATCH] Incremental sort
Previous Message Alexander Korotkov 2017-09-30 20:17:22 Re: GSoC 2017: weekly progress reports (week 6)