Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ca03b55

Browse files
committed
Discuss LOCALE differences as a reason for regression test failure.
1 parent 68bc848 commit ca03b55

File tree

2 files changed

+71
-25
lines changed

2 files changed

+71
-25
lines changed

doc/src/sgml/regress.sgml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/regress.sgml,v 1.16 2001/01/02 05:56:02 tgl Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/regress.sgml,v 1.17 2001/03/20 00:09:36 tgl Exp $ -->
22

33
<chapter id="regress">
44
<title id="regress-title">Regression Tests</title>
@@ -49,7 +49,7 @@
4949
<screen>
5050
<computeroutput>
5151
======================
52-
All 75 tests passed.
52+
All 76 tests passed.
5353
======================
5454
</computeroutput>
5555
</screen>
@@ -64,6 +64,7 @@
6464
If you already did the build as root, you do not have to start all
6565
over. Instead, make the regression test directory writable by
6666
some other user, log in as that user, and restart the tests.
67+
For example,
6768
<screen>
6869
<prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput>
6970
<prompt>root# </prompt><userinput>su - joeuser</userinput>
@@ -100,8 +101,9 @@
100101
<screen>
101102
<prompt>$ </prompt><userinput>gmake installcheck</userinput>
102103
</screen>
103-
The server is expected to be running on the local host with the
104-
default port number.
104+
The tests will expect to contact the server at the local host and the
105+
default port number, unless directed otherwise by PGHOST and PGPORT
106+
environment variables.
105107
</para>
106108

107109
<sect1 id="regress-evaluation">
@@ -111,8 +113,8 @@
111113
Some properly installed and fully functional
112114
<productname>PostgreSQL</productname> installations can
113115
<quote>fail</quote> some of these regression tests due to
114-
artifacts of floating point representation and time zone
115-
support. The tests are currently evaluated using a simple
116+
platform-specific artifacts such as varying floating point representation
117+
and time zone support. The tests are currently evaluated using a simple
116118
<application>diff</application> comparison against the outputs
117119
generated on a reference system, so the results are sensitive to
118120
small system differences. When a test is reported as
@@ -149,6 +151,29 @@
149151
</para>
150152
</sect2>
151153

154+
<sect2>
155+
<title>Locale differences</title>
156+
157+
<para>
158+
The tests expect to run in plain <quote>C</quote> locale. This
159+
should not cause any problems when you run the tests against a
160+
temporary installation, since the regression test driver takes care
161+
to start the server in C locale. However, if you run the tests
162+
against an already-installed server that is using non-C locale settings,
163+
you may see differences caused by varying rules for string sort order,
164+
formatting of numeric and monetary values, and so forth.
165+
</para>
166+
167+
<para>
168+
In some locales the resulting differences are small and easily checked by
169+
inspection. However, in a locale that changes the rules for formatting
170+
of numeric values (typically by swapping the usage of commas and
171+
decimal points), entry of some data values will fail, resulting in
172+
extensive differences later in the tests where the missing data values
173+
are supposed to be used.
174+
</para>
175+
</sect2>
176+
152177
<sect2>
153178
<title>Date and time differences</title>
154179

@@ -262,13 +287,14 @@ according to the letter of the SQL spec. In practice, since we are
262287
looking at the same queries being executed on the same data by the same
263288
software, we usually get the same result ordering on all platforms, and
264289
so the lack of ORDER BY isn't a problem. Some queries do exhibit
265-
cross-platform ordering differences, however.
290+
cross-platform ordering differences, however. (Ordering differences
291+
can also be triggered by non-C locale settings.)
266292
</para>
267293

268294
<para>
269295
Therefore, if you see an ordering difference, it's not something to
270-
worry about (unless the query does have an ORDER BY that your result
271-
is violating). But please report it anyway, so that we can add an
296+
worry about, unless the query does have an ORDER BY that your result
297+
is violating. But please report it anyway, so that we can add an
272298
ORDER BY to that particular query and thereby eliminate the bogus
273299
<quote>failure</quote> in future releases.
274300
</para>

src/test/regress/README

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ user-defined trigger functions, and then run the test driver
3131
script. At the end you should see something like
3232

3333
======================
34-
All 75 tests passed.
34+
All 76 tests passed.
3535
======================
3636

3737
or otherwise a note about what tests failed. See the section called
@@ -42,7 +42,7 @@ Test Evaluation below for more.
4242
root). If you already did the build as root, you do not have to
4343
start all over. Instead, make the regression test directory
4444
writable by some other user, log in as that user, and restart the
45-
tests.
45+
tests. For example,
4646

4747
root# chmod -R a+w src/test/regress
4848
root# su - joeuser
@@ -67,21 +67,23 @@ the server, then type
6767

6868
$ gmake installcheck
6969

70-
The server is expected to be running on the local host with the
71-
default port number.
70+
The tests will expect to contact the server at the local host and the
71+
default port number, unless directed otherwise by PGHOST and PGPORT
72+
environment variables.
7273

7374
Test Evaluation
7475

7576
Some properly installed and fully functional PostgreSQL installations
76-
can "fail" some of these regression tests due to artifacts of floating
77-
point representation and time zone support. The tests are currently
78-
evaluated using a simple diff comparison against the outputs generated
79-
on a reference system, so the results are sensitive to small system
80-
differences. When a test is reported as "failed", always examine the
81-
differences between expected and actual results; you may well find
82-
that the differences are not significant. Nonetheless, we still strive
83-
to maintain accurate reference files across all supported platforms,
84-
so it can be expected that all tests pass.
77+
can "fail" some of these regression tests due to platform-specific
78+
artifacts such as varying floating point representation and time zone
79+
support. The tests are currently evaluated using a simple diff
80+
comparison against the outputs generated on a reference system, so the
81+
results are sensitive to small system differences. When a test is
82+
reported as "failed", always examine the differences between expected
83+
and actual results; you may well find that the differences are not
84+
significant. Nonetheless, we still strive to maintain accurate reference
85+
files across all supported platforms, so it can be expected that all
86+
tests pass.
8587

8688
The actual outputs of the regression tests are in files in the
8789
src/test/regress/results directory. The test script uses diff to
@@ -99,6 +101,23 @@ messages may vary between platforms, but should reflect similar
99101
information. These differences in messages will result in a "failed"
100102
regression test which can be validated by inspection.
101103

104+
Locale differences
105+
106+
The tests expect to run in plain "C" locale. This should not cause any
107+
problems when you run the tests against a temporary installation, since
108+
the regression test driver takes care to start the server in C locale.
109+
However, if you run the tests against an already-installed server that
110+
is using non-C locale settings, you may see differences caused by
111+
varying rules for string sort order, formatting of numeric and monetary
112+
values, and so forth.
113+
114+
In some locales the resulting differences are small and easily checked by
115+
inspection. However, in a locale that changes the rules for formatting
116+
of numeric values (typically by swapping the usage of commas and
117+
decimal points), entry of some data values will fail, resulting in
118+
extensive differences later in the tests where the missing data values
119+
are supposed to be used.
120+
102121
Date and time differences
103122

104123
Most of the date and time results are dependent on the time zone
@@ -177,11 +196,12 @@ according to the letter of the SQL spec. In practice, since we are
177196
looking at the same queries being executed on the same data by the same
178197
software, we usually get the same result ordering on all platforms, and
179198
so the lack of ORDER BY isn't a problem. Some queries do exhibit
180-
cross-platform ordering differences, however.
199+
cross-platform ordering differences, however. (Ordering differences
200+
can also be triggered by non-C locale settings.)
181201

182202
Therefore, if you see an ordering difference, it's not something to
183-
worry about (unless the query does have an ORDER BY that your result
184-
is violating). But please report it anyway, so that we can add an
203+
worry about, unless the query does have an ORDER BY that your result
204+
is violating. But please report it anyway, so that we can add an
185205
ORDER BY to that particular query and thereby eliminate the bogus
186206
"failure" in future releases.
187207

0 commit comments

Comments
 (0)