Chapter 14. Regression テスト

Table of Contents
Regression 環境
ディレクトリの配置
Regression テストの手順
Regression 結果の解析

Regression test instructions and analysis.

Regression テストの説明と解析

The PostgreSQL regression tests are a comprehensive set of tests for the SQL implementation embedded in PostgreSQL developed by Jolly Chen and Andrew Yu. It tests standard SQL operations as well as the extended capabilities of PostgreSQL.

PostgreSQL の regression テストは Jolly Chen と Andrew Yu により開発 された PostgreSQL に組み込み実装されている SQL の包括的なテストの一式です。 regression は標準的な SQL 操作に加え PostgreSQL で拡張された機能もテストし ます。

These tests have recently been revised by Marc Fournier and Thomas Lockhart and are now packaged as functional units which should make them easier to run and easier to interpret. From PostgreSQL v6.1 onward the regression tests are current for every official release.

一連のテストは最近 Marc Fournier と Thomas Lockhart によって改訂され より使いやすくまたより理解しやすい機能的な編成としてまとめられました。 PostgreSQL v6.1 以降 regression テストは 公式リリース版に含まれています。

Some properly installed and fully functional PostgreSQL installations can fail some of these regression tests due to artifacts of floating point representation and time zone support. The current tests are evaluated using a simple "diff" algorithm, and are sensitive to small system differences. For apparently failed tests, examining the differences may reveal that the differences are not significant.

適正に導入されかつ全ての機能が使用できる PostgreSQL であっても、 浮動小数点の表現構造と時間帯のサポートの関係でテストのいくつかに 失敗することがあります。 現在のテストは単純な "diff" アルゴリズムにもとづいて検証を行っているため システムのちょっとした違いにも神経質です。明らかに失敗したテストで あってもどこが異なるのかを調査することによってそれらの差異が重大では ないことが判明することもあります。

The regression testing notes below assume the following (except where noted):

下記の regression テストは(注意書きがある箇所を除外して)以下のことを前提と しています。

Regression 環境

The regression test is invoked by the make command which compiles a C program into a shared library in the current directory. Localized shell scripts are also created in the current directory. The output file templates are massaged into the ./expected/*.out files. The localization replaces macros in the source files with absolute pathnames and user names.

regression テストは C プログラムをコンパイルし カレントディレクトリの共有ライブラリに格納する make コマンドで起動します。カレントディレクトリには環境に適化されたシェルス クリプトも生成されます。出力ファイルのテンプレートは ./expected/*.out ファイルに出されます。 適化された環境でソースファイルのマクロが絶対パス名とユーザ名に 置き換えます。

Normally, the regression test should be run as the pg_superuser since the 'src/test/regress' directory and sub-directories are owned by the pg_superuser. If you run the regression test as another user the 'src/test/regress' directory tree should be writeable to that user.

通常 regression テストは 'src/test/regress' ディレクトリとその サブディレクトリの所有者が pg_superuser によることから pg_superuser によって行われなければなりません。他のユーザとして regression テストを実行する場合は 'src/test/regress' ディレクトリツリー がそのユーザから書き込み可能になっていなければなりません。

It was formerly necessary to run the postmaster with system time zone set to PST, but this is no longer required. You can run the regression tests under your normal postmaster configuration. The test script will set the PGTZ environment variable to ensure that timezone-dependent tests produce the expected results. However, your system must provide library support for the PST8PDT time zone, or the timezone-dependent tests will fail. To verify that your machine does have this support, type the following:

    setenv TZ PST8PDT
    date

以前はシステムの時間帯を PST に設定して postmaster を走らせ る必要がありましたが、現在その必要はありません。 regression テストはそのままの postmaster 構成で行えます。 テストスクリプトは時間帯に依存するテストが正しい結果をもたらすよう PGTZ 環境変数を設定します。 とはいっても、システムが PST8PDT 時間帯をサポートするライブラリを 持っていない場合時間帯に依存するテストは失敗に終ります。 システムがこのサポートをしているか確かめるためには

    setenv TZ PST8PDT
    date
と入力します。

The "date" command above should have returned the current system time in the PST8PDT time zone. If the PST8PDT database is not available, then your system may have returned the time in GMT. If the PST8PDT time zone is not available, you can set the time zone rules explicitly:

    setenv PGTZ PST8PDT7,M04.01.0,M10.05.03
      

上記の "date" コマンドは PST8PDT 時間帯における現在のシステムの 時刻を返していなければなりません。 PST8PDT データベースが使えない場合 GMT 時刻を返すことがあります。 もし PST8PDT データベースが使えないことが判明した時は、明示的に 時間帯ルールを以下のようにして設定します。

    setenv PGTZ PST8PDT7,M04.01.0,M10.05.03