---
sourceDocument: Yokohama IT Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/yokohama/it-service-management

 Release :

    - yokohama

ft:locale :

    - ja-JP

ft:publication_title :

    - Yokohama IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# DevOps テストツールの統合

# DevOps テストツールの統合 {#ariaid-title1}

* リリースバージョン: Yokohama
* 
* 更新日 2025年07月31日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：10分

テストツールの統合により、Jenkins、Azure DevOps、GitHub、GitHub Enterprise、および GitLab 単体テスト、機能テスト、およびパフォーマンステストのテスト結果を DevOps で表示できます。

GitLab と Jenkins では、JUnit テストタイプの統合のみがサポートされています。  
注:  
その他のテストタイプの場合は、[DevOps API](https://www.servicenow.com/docs/access?context=devops-api&version=yokohama&pubname=yokohama-api-reference&ft:locale=en-US) の [DevOps - POST /devops/tool/{capability}](https://www.servicenow.com/docs/access?context=devops-api&version=yokohama&pubname=yokohama-api-reference&ft:locale=en-US) エンドポイントを使用します。  
* TestNG を使用して実行および公開された Selenium テストは、ServiceNow DevOps 用の Jenkins プラグインによって報告されます。
* テストタイプの分類がサポートされています。
* Apache JMeter などのツールによって報告された追加のテスト結果は、カスタムワークフロースタジオサブフローを使用して DevOps で処理できます (パイプラインの変更は必要ありません)。
{#dev-ops-test-tool-integration__ul_bkq_dq5_pnb}  
{#dev-ops-test-tool-integration__table_xxq_lcx_pnb__entry__2}

| カテゴリ | テストタイプ |
|-|-|
| 単位 | JUnit (デフォルト) NUnit XUnit 単体テスト 注: * GitLab および Jenkins では、JUnit テストタイプの統合のみがサポートされています。 * ADO、GitHub、および GitHub Enterprise では、JUnit、NUnit、XUnit、および単体テストタイプの統合がサポートされています。 {#dev-ops-test-tool-integration__ul_cyb_gdj_b1c} デフォルトのテストタイプを変更するには、 \[sn_devops.default_test_type\] [DevOps プロパティ](https://servicenow-prod.fluidtopics.net/0_KiXIbs1uc3kl2m6PHidA "これらのプロパティを使用して、DevOps 変更速度管理アプリケーションの設定を構成します。"). |
| 機能的 | * 統合 * 回帰 * スモーク * システム * ユーザー受理 {#dev-ops-test-tool-integration__ul_nnl_mcx_pnb} |
| パフォーマンス | 負荷 |
[ ]

{#dev-ops-test-tool-integration__table_xxq_lcx_pnb}

## テストタイプマッピング {#dev-ops-test-tool-integration__section_opj_n5l_vlb}

テストタイプマッピングは、テスト対象のテストタイプとエンティティを DevOps ツール (DevOps統合テストタイプマッピング モジュール)。

正確なテストタイプマッピングにより、テストタイプがテストサマリー結果に常に意図したとおりに表示されます。  
{#dev-ops-test-tool-integration__table_j2s_nkv_pnb__entry__2}

| フィールド || 説明 |
|-|-|-|
| テストタイプ || * JUnit * 統合 * 回帰 * スモーク * システム * ユーザー受理 * 負荷 {#dev-ops-test-tool-integration__ul_jyw_xkv_pnb} |
| DevOps エンティティ ID | テーブル名 | (テストレポートペイロード内の) テスト結果にリンクされたエンティティを含む DevOps テーブル名。 * ステップ \[sn_devops_step\] * パイプライン \[sn-devops-pipeline\] {#dev-ops-test-tool-integration__ul_sy5_4mv_pnb} 注: DevOps のステップテーブルとパイプラインテーブルのみがサポートされています。 |
| DevOps エンティティ ID | ドキュメント | 選択したテーブルで指定されたエンティティの名前。 たとえば、ステップ、パイプライン、アーティファクト、パッケージの名前などです。 |
| テストファイルパス (Jenkins テストのみ) || Jenkins サーバー上で生成されたテスト結果ファイルへのパス。 これは、JUnit や TestNG の実装に準拠しない属性 (たとえば JMeter など) を持つテストレポートを DevOps で活用できるようにするために便利です。 複数のファイルはカンマで区切ります。 注: 生のテストペイロードを変換するには、ワークフロースタジオサブフローを使用する必要があります。 |
| ツール統合 || テストを実行しているツール。 |
| DevOps テーブル || \[DevOps エンティティ ID\] 設定のテーブル名に対応する DevOps テーブル。 |
[ ]

{#dev-ops-test-tool-integration__table_j2s_nkv_pnb}  
図 : 1. DevOps テストタイプマッピング  
図 : 2. ADO 単体テストの yaml ファイルの例 図 : 3. GitHub 単体テストの yaml ファイルの例

## 生のテストペイロードの変換 {#dev-ops-test-tool-integration__section_evb_tzv_pnb}

たとえば、カスタムサブフローを呼び出すように DevOps テストサブフロー ポリシーディシジョンテーブルを構成することで、JMeter などの生のテストレポート (JUnit または TestNG 実装に準拠しない属性を含むレポート) を変換できますディシジョンテーブルディシジョンテーブル モジュール)。  
注:  
生のテストペイロードを変換するカスタムワークフロースタジオサブフローを作成する必要があります。

パフォーマンスステージに複数のテストタイプがある場合は、\[DevOps テストタイプポリシー (DevOps Test Type Policy)\] ディシジョンテーブルを使用して各テストのテストタイプを構成し、テスト結果のペイロードが正しく変換されるようにすることができます。  
図 : 4. DevOps ディシジョンテーブル  
{#dev-ops-test-tool-integration__table_c54_kcw_pnb__entry__3}

| ディシジョンテーブル | 目的 | 構成 |
|-|-|-|
| DevOps テストサブフローポリシー (DevOps Test Subflow Policy) | ツールが受信した生のペイロードを変換するカスタムサブフローを自動的に呼び出すこと。 意思決定の入力： * テスト結果ペイロード * テストタイプ {#dev-ops-test-tool-integration__ul_wxg_2dw_pnb} | 生のペイロードを受信したときに呼び出すカスタムサブフローを指定する意思決定を作成します。 生のペイロードに含まれるフィールドを含む条件を設定します。 たとえば、Jenkins BZ パフォーマンステスト (BZ Performance Test) カスタムサブフローを呼び出すには、次のようにします。 条件: * <kbd class="ph userinput">テストタイプは [ロード] です</kbd> (負荷は、パフォーマンステスト用に構成されたテストタイプです) * <kbd class="ph userinput">テスト結果ペイロードにスループットが含まれています</kbd> * <kbd class="ph userinput">テスト結果ペイロードに同時実行が含まれている</kbd> {#dev-ops-test-tool-integration__ul_jrv_x2w_pnb} 解答:フロー: Jenkins BZパフォーマンステスト |
| DevOps テストタイプポリシー (DevOps Test Type Policy) | パフォーマンステストステージに複数のタイプのテストが構成されている場合に、テストタイプを自動的に設定すること これは、2 番目のテストタイプの結果を正しく変換するために必要です。 たとえば、ロードパフォーマンステストと JUnit パフォーマンステストの両方が同じ DevOps ステップでマップされている場合、決定が作成されない限り、JUnit テスト結果は正しくフォーマットされません。 意思決定の入力： * ステップ * テスト結果ペイロード * ツール統合 * パイプライン {#dev-ops-test-tool-integration__ul_dkm_sjw_pnb} | テストタイプを設定するために、パフォーマンステストステージの各タイプのテストに対する意思決定を作成します。 負荷テスト: * 条件: * <kbd class="ph userinput">ステップはパフォーマンステストです</kbd> * <kbd class="ph userinput">テスト結果ペイロードにスループットが含まれています</kbd> * <kbd class="ph userinput">テスト結果ペイロードに同時実行が含まれている</kbd> {#dev-ops-test-tool-integration__ul_r5g_2kw_pnb} * 解答: <kbd class="ph userinput">TestType: ロード</kbd> {#dev-ops-test-tool-integration__ul_fvh_tpw_pnb} JUnit テスト: * 条件: * <kbd class="ph userinput">ステップはパフォーマンステストです</kbd> * <kbd class="ph userinput">テスト結果ペイロードにスループットが含まれていません</kbd> * <kbd class="ph userinput">テスト結果ペイロードに並行処理性が含まれていません</kbd> {#dev-ops-test-tool-integration__ul_lx1_5qw_pnb} * 解答: <kbd class="ph userinput">TestType: JUnit</kbd> {#dev-ops-test-tool-integration__ul_kx1_5qw_pnb} |
[表 : 1. DevOps ディシジョンテーブル]

{#dev-ops-test-tool-integration__table_c54_kcw_pnb}  
図 : 5. DevOps 複数のパフォーマンステストタイプ  
図 : 6. DevOps 複数のテストタイプマッピング  
図 : 7. DevOps ディシジョンテーブルの決定

## テストサマリー結果 {#dev-ops-test-tool-integration__section_iq3_11v_pnb}

テストサマリーの結果は、次の方法で表示できます。

* DevOpsテスト結果 モジュール (テストサマリーとパフォーマンステストサマリー)。
* [DevOps 変更要求](https://servicenow-prod.fluidtopics.net/Cnyc6TrD95jn5jw3qnrJmQ "パイプラインで変更要求を自動的に作成するために DevOps 変更速度管理の変更の促進機能を有効にし、変更承認フローとポリシーを使用して特定の条件下で承認を自動化します。") - \[テスト結果\] 関連リスト。
* [DevOps パイプライン UI](https://servicenow-prod.fluidtopics.net/cAxDYaEXsRHLQRGnRdKnkw "パイプライン UI を使用して、パイプライン実行全体のインタラクションと結果を可視化できます。このグラフィカルビューには、各パイプラインのパイプライン ステップの進行状況とその他の詳細が表示されます。") - \[品質\] タイル。
{#dev-ops-test-tool-integration__ul_ayj_jd4_vlb}  
図 : 8. DevOps パフォーマンステストサマリーの例

## 予想標準 JSON 通知機能ペイロード - テストツール {#dev-ops-test-tool-integration__section_ey3_fyn_qnb}

機能的：

    { 
    "name": "CorpSite-selenium#55", 
    "duration": 78.802, 
    "passedTests": 4, 
    "failedTests": 0, 
    "skippedTests": 0, 
    "blockedTests": 0, 
    "totalTests": 4, 
    "startTime": "2020-06-30T18:12:31Z", 
    "finishTime": "2020-06-30T18:12:31Z", 
    "passingPercent": 100, 
     
     
    // Use Artifact OR Package OR Build + Stage + PipelineName Attributes 

    Send only one Attribute combination. For example, send Attributes of either  Artifact or Package, or the combination of Build + Stage + PipelineName.

    If you send more than one Attribute, priority is given in the following order and the low priory one is ignored. For example, if you send attribute for both packages and artifacts, then attribute of package is considered and the attribute of artifacts is ignored.

    1.packages
    2.artifcats
    3.buildNumber + stageName + pipelineName

    "packages": [{"name": "CorpSite-pkg1"}], 
    "artifacts": [{"name": "CorpSite-artifact", "version": "1.0.0"}], 
    "buildNumber": "55", 
    "stageName": "test", 
    "pipelineName": "CorpSite-selenium", 
    } 

    Notes:
    - The pipelineName attribute value must be same as the value in the Orchestration pipeline field of the Pipeline [sn_devops_pipeline] table.
    - The stageName attribute value must be same as the value in the Orchestration stage field of the Step [sn_devops_step] table.

パフォーマンス：

    { 
    "name": "Performance Tests", 
    "url": "http://abc.com", 
    "startTime": "2020-06-30T18:12:31Z", 
    "finishTime": "2020-06-30T18:12:31Z", 
    "duration": 78.802, 
    "maximumVirtualUsers": "", 
    "throughput": "", 
    "maximumTime": "", 
    "minimumTime": "", 
    "averageTime": "", 
    "ninetyPercent": "", 
    "standardDeviation": "", 
     
    // Use Artifact OR Package OR Build + Stage + PipelineName Attributes 

    Send only one Attribute combination. For example, send Attributes of either  Artifact or Package, or the combination of Build + Stage + PipelineName.

    If you send more than one Attribute, priority is given in the following order and the low priory one is ignored. For example, if you send attribute for both packages and artifacts, then attribute of package is considered and the attribute of artifacts is ignored.

    1.packages
    2.artifcats
    3.buildNumber + stageName + pipelineName

    "packages": [{"name": "CorpSite-pkg1"}], 
    "artifacts": [{"name": "CorpSite-artifact", "version": "1.0.0"}], 
    "buildNumber": "55", 
    "stageName": "test", 
    "pipelineName": "CorpSite-Performance", 
    } 

    Notes:
    - The pipelineName attribute value must be same as the value in the Orchestration pipeline field of the Pipeline [sn_devops_pipeline] table.
    - The stageName attribute value must be same as the value in the Orchestration stage field of the Step [sn_devops_step] table.

* **[DevOps でのテストツールの構成](https://servicenow-prod.fluidtopics.net/Ei6xExw21AtDudtgwyB4Lg)**   
  DevOps でテストツールを構成して、ユニット、機能、およびパフォーマンスのテスト結果を表示します。
* **[テスト API を使用してテスト結果を変更要求に追加する](https://servicenow-prod.fluidtopics.net/WZvnugc0sYCIAIYuHqXt6g)**   
  DevOps - POST /devops/tool/{capability} API のテスト機能を使用して、 DevOps 変更要求にテスト結果を追加します。API は、 DevOps 変更速度管理 に接続されているさまざまなツールのすべてのテストタイプで使用できます。
* **[添付ファイル API を使用して添付ファイルを変更要求に追加](https://servicenow-prod.fluidtopics.net/sSwreGKtSFuZ1hdUN9Xfug)**   
  添付ファイル API を使用して、テストレポート XML を DevOps 変更要求に添付ファイルとして追加します。

