In this sectionこのセクションの内容:
Table of Contents | ||
---|---|---|
|
...
はじめに
Environment Manager is an interface in は、テスト環境のインスタンスを迅速に構成およびプロビジョニングするための Parasoft Continuous Testing Platform (CTP) for rapidly configuring and provisioning instances of your test environments. The Environment Manager Plugin for Jenkins enables you configure various actions needed for automated, continuous testing across your software delivery pipeline. You can configure build steps for:
- Provisioning environments into the specific states needed for automated testing
- Replicating environments and associated assets to different Virtualize servers, including servers dynamically-provisioned from Docker or other container technologies
- Executing Parasoft test scenario jobs (tests suites that execute vs. specific environment configurations)
- Destroying "dirtied" test environments to ensure that subsequent tests always begin with a clean slate
- Disconnecting a Virtualize server from CTP to remove unnecessary connections
- Publishing test execution results to Parasoft DTP.
...
のインターフェイスです。Jenkins 用の Environment Manager プラグインを使用すると、ソフトウェア デリバリー パイプライン全体の中で、自動化された継続的テストを行うために必要なさまざまなアクションを構成できます。以下を行うビルド ステップを設定できます。
- 自動テストに必要な特定の状態に環境をセットアップする
- 環境および関連するアセットを別の Virtualize サーバー (Docker などのコンテナー技術によって動的にセットアップされたサーバーを含む) にレプリケートする
- Parasoft テスト シナリオ ジョブ (特定の環境設定で実行されるテスト スイート) を実行する
- 後続のテストが常にクリーンな状態から開始できるよう、「汚れた」テスト環境を破壊する
- Virtualize サーバーを CTP から切断して、不要な接続を削除します。
- テスト実行結果を Parasoft DTP にパブリッシュします。
要件
- CTP 2.7.4 or higher以上
- Virtualize 9.9.4 or higher以上
- Jenkins 1.625.3 or higher以上
- JUnit Plugin v.1.10
- DTP 5.4.0 or higher (for publishing test execution XML report to DTP以上 (テスト実行の XML レポートを DTP にパブリッシュする場合)
- DTP 5.4.2 or higher (for publishing test execution environment information to DTP以上 (テスト実行環境情報を DTP にパブリッシュする場合)
...
設定
Each Jenkins server communicates with one instance of CTP, but multiple Jenkins servers can communicate with the same instance of CTP.
- Choose Manage Jenkins> Configure System.
- In the Parasoft Environment Manager area, enter your Environment Manager URL, username, and password. You can click Test Connection to ensure that Jenkins is successfully communicating with Environment Manager.
- If you want to add a build step to publish test execution results to DTP, specify the URL, username, and password for your DTP server in the Parasoft DTP section.
Adding an Environment Manager Build Step to a Job
You can add any number of Environment Manager build steps to a Jenkins job.
各 Jenkins サーバーは 1 つの CTP インスタンスと通信しますが、複数の Jenkins サーバーが同じ CTP インスタンスと通信することもできます。
- [Manage Jenkins] > [Configure System] を選択します。
- Parasoft Environment Manager エリアに Environment Manager URL、ユーザー名、パスワードを入力します。[Test Connection] をクリックすると、Jenkins が正常に Environment Manager と通信できるかを確認できます。
- テスト実行結果を DTP にパブリッシュするためのビルド ステップを追加する場合は、Parasoft DTP セクションで DTP サーバーの URL、ユーザー名、およびパスワードを指定します。
ジョブへの Environment Manager ビルド ステップの追加
Jenkins のジョブには任意の数の Environment Manager ビルド手順を追加できます。
- 設定するジョブを開いて [Configure] をクリックします。
- ビルド エリアで [Add build step] をクリックし、利用可能な Parasoft Environment Manager ビルド手順の 1 つを選択します。
- Open the job you want to configure and choose Configure.
- In the Build area, click Add build step and select one of the available Parasoft Environment Manager build steps:
Scroll Table Layout | ||
---|---|---|
|
Deploy an environment |
---|
テストに必要な状態に環境をセットアップし、オプションとして環境および関連アセットを別の Virtualize サーバー (Docker などのコンテナー技術によって動的にセットアップされたサーバーを含む) にレプリケートします。「Configuring a Deploy an Environment Build Step |
」を参照してください。 |
Execute a test scenario job |
---|
テスト シナリオ ジョブ (特定の環境設定で実行されるテスト スイート) を実行します。「Configuring an Execute a Test Scenario Job Build Step |
」を参照してください。 |
Destroy an environment |
---|
後続のテストが常にクリーンな環境から開始できるよう、「汚れた」テスト環境を削除します。「Configuring a Destroy an Environment Build Step |
」を参照してください。 |
Disconnect a Virtualize server |
---|
Environment Manager |
から指定された Virtualize サーバーの登録を削除します。「Configuring a Disconnect a Virtualize Server Build Step |
」を参照してください。 |
...
Deploy an Environment
...
This build step provisions environments into the specific states needed for testing. As an additional option, it can also replicate environments and associated assets to different Virtualize servers (including servers dynamically-provisioned from Docker or other container technologies). When you add a "Deploy an environment" build step, several new fields are available.
To configure this build step:
ビルド手順の設定
このビルド手順は、テストに必要な特定の状態に環境をセットアップします。オプションとして、環境および関連するアセットを別の Virtualize サーバー (Docker などのコンテナー技術によって動的にセットアップされたサーバーを含む) にレプリケートできます。「Deploy an environment」ビルド手順を追加すると、いくつか新しいフィールドが利用可能になります。
ビルド手順を設定するには、次の操作を行います。
- セットアップ (またオプションとして別の Virtualize サーバーにレプリケート) するシステム、環境、インスタンスを選択します。
- 環境と関連アセット (仮想アセット、プロキシ、JDBC コントローラーなど) をレプリケートする場合、次の操作を行います。
- [
- Choose a system, environment, and instance you want to provision (and optionally replicate to a new Virtualize server) from the respective drop-down menus.
- If you want to replicate the environment and associated assets (virtual assets, proxies, JDBC controllers, etc.) to a new Virtualize server before provisioning:
- Enable the Copy the environment and assets before provisioning option.] を有効化します。
- (Optional) Specify a name for the new environment. If this field is empty, a name will be assigned automatically. You can also use variables, e.g., 任意) 新しい環境の名前を指定します。このフィールドが空の場合、名前は自動的に割り当てられます。変数を使用することもできます。例:
Env${BUILD_NUMBER}
- Specify the target Virtualize server. See the guidelines below this procedure for help selecting and configuring one of the available options.
- レプリケート先の Virtualize サーバーを指定します。どのオプションを選択し、設定するかについては、手順の下のガイドラインを参照してください。
- セットアップの前に環境をコピーし、関連データ リポジトリも複製するには、次の操作を行います。
- [
- Enable the Duplicate associated data repositories before provisioning option.] を有効化します。
データ リポジトリのコピー先を指定します。以下のオプションを設定できます。Specify where you want the data repositories to be copied. You can configure the following options:
Scroll Table Layout widths 40%,60%
Creates a new copy on the same Data Repository server where the repositories currently exist. If you select this option, specify the Data Repository port, username, and password.On the current Data Repository server
Creates a new copy on the target Virtualize server specified in the area above the現在リポジトリがあるのと同じ Data Repository サーバーに新しくコピーを作成します。このオプションを選択した場合、Data Repository のポート、ユーザー名、パスワードも指定します。 To a Data Repository server on the same host as the target Virtualize sever
check box. If you select this option, specify the Data Repository port, username, and password.[Duplicate associated data repositories before provisioning ] オプションの上のエリアで指定されたレプリケート先の Virtualize サーバーに新しくコピーを作成します。このオプションを選択した場合、Data Repository のポート、ユーザー名、パスワードも指定します。 To a Data Repository server on a specific host Creates a new copy on the specified Data Repository. If you select this option, specify the Data Repository host, port, username, and password. 指定された Data Repository に新しくコピーを作成します。このオプションを選択した場合、Data Repository のホスト、ポート、ユーザー名、パスワードも指定します。
- セットアップが失敗した場合にジョブを中止するには、[If you want the job to stop if the provisioning fails, enable the Abort on provisioning failure option.
Choosing Between the Various Environment Copying Options
- ] を有効化します。
環境コピー オプションの選択
プラグインには、さまざまなニーズに対応できるよう 3 つの環境コピー オプションがあります。最初のオプションでは、ジョブ実行時に Virtualize サーバーが Environment Manager に登録されている必要があります。2 番目と 3 番目のオプションでは、Virtualize サーバーが登録されるのを待つため、Docker などのコンテナー技術によって動的に Virtualize サーバーをデプロイする場合に適しています。This plugin provides three different environment copying options to suit various needs. The first option requires the Virtualize server to be registered with Environment Manager when the job executes. The second and third will wait for the Virtualize server to be registered, and is thus the preferred option when you're dynamically deploying Virtualize servers via Docker or other container technologies.
Scroll Table Layout | ||
---|---|---|
|
To a Virtualize server registered with EM |
---|
Use this option to copy to a Virtualize server that is already registered with Environment Manager.
Enable this option and select the desired server under Virtualize server. If this server is not registered with Environment Manager at the time the job executes, the job will fail.すでに Environment Manager に登録されている Virtualize サーバーにコピーする場合、このオプションを使用します。 このオプションを有効化し、Virtualize サーバーの下にあるサーバーを選択します。ジョブ実行時にこのサーバーが Environment Manager に登録されていなかった場合、ジョブは失敗します。 |
To a Virtualize server matching host |
---|
You can configure the build step to wait for a Virtualize server with the specified host (IP), then perform the copy operation once that server is registered with Environment Manager.
Use this option if the Virtualize server is not yet registered with Environment Manager, e.g., if it will be spun up via Docker or other automated processes.
指定されたホストで Virtualize を待機し、サーバーが Environment Manager に登録されたらコピー操作を行うようビルト手順を設定できます。 Virtualize サーバーがまだ Environment Manager に登録されていない場合、たとえば Docker などの自動化プロセスによってサーバーが立ち上げられる場合にこのオプションを使用します。 このオプションを有効化する場合、期待されるホスト IP を指定します。 |
To a Virtualize server matching name |
---|
You can configure the build step to wait for a Virtualize server with the Virtualize server name, then perform the copy operation once that server is registered with Environment Manager.
Use this option if the Virtualize server is not yet registered with Environment Manager, e.g., if it will be spun up via Docker or other automated processes.
Enable this option and specify the expected server name (the name it will use to register with Environment Manager).
When Virtualize Server has a Dynamic IP
As long as the Virtualize server has a consistent name, you can configure the build step to copy to the Virtualize server with the specified name (e.g., the name it uses to register with Environment Manager). If the named Virtualize server is not yet registered with Environment Manager, the build step will wait for it, then perform the copy operation once that server is registered.
Configuring an Execute a Test Scenario Job Build Step
This build step executes one of the test scenario jobs (tests suites that execute vs. specific environment configurations) available on the connected instance of Environment Manager. You can also publish the test execution results to DTP.
You can configure the following options:
指定されたサーバー名の Virtualize サーバーを待機し、サーバーが Environment Manager に登録されたらコピー操作を行うようビルト手順を設定できます。 Virtualize サーバーがまだ Environment Manager に登録されていない場合、たとえば Docker などの自動化プロセスによってサーバーが立ち上げられる場合にこのオプションを使用します。 このオプションを有効化した場合、期待されるサーバー名 (Environment Manager への登録に使用される名前) を指定します。 |
Virtualize サーバーが動的 IP を使用する場合
Virtualize サーバーの名前が変わらないかぎり、指定された名前 (Environment Manager への登録に使用される名前) を持つ Virtualize サーバーにコピーするようビルド手順を設定できます。指定された名前の Virtualize サーバーが Environment Manager に登録されていない場合、ビルド手順は待機し、サーバーが登録されたらコピー操作を行います。
Execute a Test Scenario Job ビルド手順の設定
このビルド手順は、テスト シナリオ ジョブ (特定の環境設定で実行されるテスト スイート) を実行します。テスト実行結果を DTP にパブリッシュすることもできます。
以下のオプションを設定できます。
- [By name] でテストシナリオの名前を指定するか、[From list] からテストシナリオを選択します。[By name] が有効になっている場合は、Jenkins 環境変数 (例:
${JOB_NAME}
) を使用して、Jenkins ジョブと同じ名前を使用できます。 - デフォルトでは、[Abort the build on test failure] は無効になっています。テストが失敗した場合にビルドを停止する場合は、このオプションを有効にします。
- [
- Enable the By name to specify the name of a test scenario or enable From list and choose a test scenario from the drop-down menu. If the By name option is enabled, you can use a Jenkins environment variable, e.g.,
${JOB_NAME
}, to use the same name as the Jenkins job. - By default, the Abort the build on test failure option is disabled. Enable this option if you want to stop the build if a test fails.
- Enable the Abort the build if it's stuck option and specify the number of minutes in the Timeout minutes field that Jenkins should wait before the job times out.] を有効にし、[Timeout minutes] フィールドに、ジョブがタイムアウトするまで Jenkins が待機する時間を分で指定します。
- 結果を DTP で表示できるようにする場合は、[Enable the Publish test execution results to DTP option and specify the DTP project, build ID, and session tag if want to be able to view the results in DTP.] を有効にし、DTP プロジェクト、ビルド ID、およびセッション タグを指定します。
- SOAtest が DTP に公開するときに、実行環境設定 (exec.env) をテスト結果に含める場合は、[Enable the Append variable set environment to session tag if configured option if you want to include the execution environment setting (
exec.env
) in the test results when SOAtest publishes to DTP. This enables you to aggregate test data according to execution environment, which can be displayed in DTP widgets and reports, e.g.:
Refer to the DTP documentation for additional information about projects, build IDs, session tags, and other metadata associated with test and development artifacts.
Configuring a Destroy an Environment Build Step
This build step deletes "dirtied" test environments to ensure that subsequent tests always begin with a "clean" test environment. When you add a "Destroy an environment" build step, two new fields will display.
To configure this build step:
- ] を有効にします。これにより、実行環境に応じてテスト データを集約し、DTP ウィジェットやレポートに表示できるようになります。例:
プロジェクト、ビルド ID、セッション タグ、およびテストおよび開発成果物に関連付けられたその他のメタデータの詳細については、DTP ドキュメントを参照してください。
Destroy an Environment ビルド手順の設定
このビルド手順は、後続のテストが常にクリーンな環境から開始できるよう、「汚れた」テスト環境を削除します。「Destroy an environment」ビルド手順を追加すると、いくつか新しいフィールドが表示されます。
ビルド手順を設定するには、次の操作を行います。
- [System] メニューから、破棄する環境を含むシステムを選択します。
- 破棄する環境の名前を入力します。まだ存在しない環境 (動的にセットアップされる環境) の名前を入力できます。変数を使用することもできます。例:
- Choose the system from the System drop-down menu that includes the environment you want to destroy.
- Enter the name of the environment you want to destroy. You can enter the name of an environment that does not exist yet (e.g., an environment that will be spun up dynamically). You can also use variables, e.g.,
Env${BUILD_NUMBER}
...
Disconnect a Virtualize Server
...
ビルド手順の設定
このビルド手順は、Environment Manager から指定された Virtualize サーバーの登録を削除します。「Disconnect a Virtualize server」ビルド手順を追加すると、いくつか新しいフィールドが表示されます。
Virtualize サーバーを切断するには、いずれかのオプションを有効化し、フィールドにホスト IP またはサーバー名を指定します。
ビルド手順の進捗と結果の確認
実行中のジョブのコンソール出力を参照するには、ビルド履歴エリアの進捗バーをクリックします。すると、ステータス詳細と関連する Environment Manager ホストおよび環境へのリンクが表示されたページが開きます。完了済みのジョブを参照するには、ビルド履歴エリアのコンソール出力プルダウンを使用します。
変更ログ
This build step de-registers a specified Virtualize server from Environment Manager. When you add a "Disconnect a Virtualize server" build step, two new fields will display.
Enable one of the options and specify the host IP or server name in the field provided to disconnect a Virtualize server.
Reviewing a Build Step's Progress and Results
To view the console output for an in-progress job, click the progress bar in the Build History area. This opens a page with status details and links to the associated Environment Manager host and environments. To see details on a completed job, use the Console Output pull-down in the Build History area.
...
Scroll Table Layout | ||
---|---|---|
|
バージョン |
---|
変更 | FR/PR ID |
---|---|
2.18 |
テスト シナリオ実行ジョブのタイムアウト機能 | CTP-4581 |
2.17 | CTP |
ジョブが Jenkins の Environment Manager |
プラグインに表示されない | CTP-5648 |
2.16 |
Jenkins のコンソール出力とステータス ページに、ジョブの一部として実行される .tst ファイルの名前とステータスを表示する機能を追加 | CTP-4550 |
2.15 |
execEnv が追加された CTP ジョブからのレポートを DTP が拒否した | CTP-4766 |
2.14 |
EM プラグインを使用する Jenkins ジョブが実行状態のままになる | CTP-4559 |
2.13 |
失敗した TST でもビルド ステータス ページに失敗が表示されない | CTP-4549 |
2.12 |
動的デプロイ コンソールの出力を改善 | CTP-4540 |
2.11 |
ジョブ内の TST の SKIPPED ステータスを処理 | CTP-4508 |
2.10 |
DTP にパブリッシュするときに変数セット環境をセッション タグに追加するオプション | CTP-4394 |
2.9 |
テスト シナリオ ジョブが失敗した後もビルド ステップを続行する機能 | CTP-4307 |
2.8 |
テスト実行 XML レポートを DTP にアップロードする | |
2.7 |
Parasoft Environment Manager |
プラグインで、ユーザーが CTP ジョブ名を Jenkins 環境変数にパラメータ化できるようにする | CTP-3942 |
2.6 |
テスト実行ジョブの API クエリー パフォーマンスを向上 | CTP-4082 |
2.5 |
ビルド ステップのドロップダウンで 100 を超えるテスト実行ジョブを表示できない問題を修正 | CTP-2841 |