Re: ignore $PostgreSQL lines in regression tests?

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: ignore $PostgreSQL lines in regression tests?
Date: 2008-05-18 17:42:47
Message-ID: 48306A97.4000003@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Recently while adding $PostgreSQL markers to a bunch of .c and .h files
I ran into trouble with the ecpg regression tests and had to revert the
change for a handful of files. However, it occurred to me that we could
have pg_regress tell diff to ignore such lines, by passing it the
arguments "-I '\$PostgreSQL:' ", which would tell it to ignore
additions or deletions of lines matching that regex.

That would probably also allow us to add such markers as comments in
results files, which mightn't be a bad thing either.

I'm a bit unsure how portable this is, though. Linux, Windows and OSX
should be ok, but they are the only OSs I run so I don't know about others.

Would this be a good thing to do?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ignore $PostgreSQL lines in regression tests?
Date: 2008-05-18 17:46:01
Message-ID: 10482.1211132761@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Recently while adding $PostgreSQL markers to a bunch of .c and .h files
> I ran into trouble with the ecpg regression tests and had to revert the
> change for a handful of files. However, it occurred to me that we could
> have pg_regress tell diff to ignore such lines, by passing it the
> arguments "-I '\$PostgreSQL:' ", which would tell it to ignore
> additions or deletions of lines matching that regex.

> Would this be a good thing to do?

I'm inclined to think not. It's easy to think of scenarios where such
a switch would mask errors.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ignore $PostgreSQL lines in regression tests?
Date: 2008-05-18 18:45:26
Message-ID: 48307946.6000800@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Recently while adding $PostgreSQL markers to a bunch of .c and .h files
>> I ran into trouble with the ecpg regression tests and had to revert the
>> change for a handful of files. However, it occurred to me that we could
>> have pg_regress tell diff to ignore such lines, by passing it the
>> arguments "-I '\$PostgreSQL:' ", which would tell it to ignore
>> additions or deletions of lines matching that regex.
>>
>
>
>> Would this be a good thing to do?
>>
>
> I'm inclined to think not. It's easy to think of scenarios where such
> a switch would mask errors.
>
>
>

OK.

cheers

andrew


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ignore $PostgreSQL lines in regression tests?
Date: 2008-05-19 12:58:22
Message-ID: 20080519125822.GL5505@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > Recently while adding $PostgreSQL markers to a bunch of .c and .h files
> > I ran into trouble with the ecpg regression tests and had to revert the
> > change for a handful of files. However, it occurred to me that we could
> > have pg_regress tell diff to ignore such lines, by passing it the
> > arguments "-I '\$PostgreSQL:' ", which would tell it to ignore
> > additions or deletions of lines matching that regex.
>
> > Would this be a good thing to do?
>
> I'm inclined to think not. It's easy to think of scenarios where such
> a switch would mask errors.

I tend to agree with this, though if people decide they want it, you
could almost certainly tighten up the regexp some to reduce the chance
of it masking things (eg: I assume a starting anchor ('^') would be
correct here, and you could almost certainly add the rest of the columns
which are included in the $Id$ format using appropriately-typed
wildcards, etc...).

Thanks,

Stephen