How to generate the new expected out file.

Started by jian heabout 3 years ago5 messages
#1jian he
jian.universality@gmail.com

Hi.

I changed the src/test/regress/sql/interval.sql, How can I generate the new
src/test/regress/expected/interval.out file.

#2Amit Kapila
amit.kapila16@gmail.com
In reply to: jian he (#1)
Re: How to generate the new expected out file.

On Thu, Jan 5, 2023 at 4:12 PM jian he <jian.universality@gmail.com> wrote:

Hi.

I changed the src/test/regress/sql/interval.sql, How can I generate the new src/test/regress/expected/interval.out file.

You can run the tests and copy the required changes from
src/test/regress/output/interval.out to
src/test/regress/expected/interval.out

--
With Regards,
Amit Kapila.

#3Andres Freund
andres@anarazel.de
In reply to: Amit Kapila (#2)
Re: How to generate the new expected out file.

Hi,

On 2023-01-05 16:22:01 +0530, Amit Kapila wrote:

On Thu, Jan 5, 2023 at 4:12 PM jian he <jian.universality@gmail.com> wrote:

Hi.

I changed the src/test/regress/sql/interval.sql, How can I generate the new src/test/regress/expected/interval.out file.

You can run the tests and copy the required changes from
src/test/regress/output/interval.out to
src/test/regress/expected/interval.out

Wonder if we should have a bit of content about that in doc/src/sgml/regress.sgml?

Greetings,

Andres Freund

#4Amit Kapila
amit.kapila16@gmail.com
In reply to: Andres Freund (#3)
Re: How to generate the new expected out file.

On Thu, Jan 12, 2023 at 4:39 AM Andres Freund <andres@anarazel.de> wrote:

On 2023-01-05 16:22:01 +0530, Amit Kapila wrote:

On Thu, Jan 5, 2023 at 4:12 PM jian he <jian.universality@gmail.com> wrote:

Hi.

I changed the src/test/regress/sql/interval.sql, How can I generate the new src/test/regress/expected/interval.out file.

You can run the tests and copy the required changes from
src/test/regress/output/interval.out to
src/test/regress/expected/interval.out

Wonder if we should have a bit of content about that in doc/src/sgml/regress.sgml?

Yeah, I think it could be useful, especially for new people. The other
option could be to add some information in src/test/regress/README/

--
With Regards,
Amit Kapila.

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#4)
Re: How to generate the new expected out file.

Amit Kapila <amit.kapila16@gmail.com> writes:

On Thu, Jan 12, 2023 at 4:39 AM Andres Freund <andres@anarazel.de> wrote:

On 2023-01-05 16:22:01 +0530, Amit Kapila wrote:

You can run the tests and copy the required changes from
src/test/regress/output/interval.out to
src/test/regress/expected/interval.out

Wonder if we should have a bit of content about that in doc/src/sgml/regress.sgml?

Yeah, I think it could be useful, especially for new people. The other
option could be to add some information in src/test/regress/README/

Yeah, regress.sgml is more aimed at consumers of the regression tests
than developers. I could see expanding the README to include some
developer tips.

In this case I can think of another important tip, which is to be
sure to update all of the variant expected-files when a test has
more than one of them. If you are not in a position to reproduce
all of the variants directly (say, there's a Windows-specific
expected-file and you're not on Windows) it often works to take
the diff you have for one variant and apply it to the other(s).
If that's not quite right, well, the cfbot or buildfarm will
help you out eventually.

regards, tom lane