UiPath Documentation
cicd-integrations
2023.10
false
CI/CD 連携ユーザー ガイド
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

Test Manager でパッケージをテストする、またはテスト セットを実行する

Test Manager と UiPath CLI を使用して、UiPath パッケージをテストするか、テスト セットを実行します。

Test Manager でパッケージをテストする、またはテスト セットを実行する​

前提条件​

  1. 最新バージョンの Test Manager を使用します (Automation Suite へのデリバリーの場合は Test Manager 2.2510 以降、スタンドアロンでのインストールの場合は Test Manager 25.10 以降)。

  2. すでに Orchestrator でテスト セットを実行している場合は、そのテスト セットを Test Manager にインポートします。詳細については、「 Test Manager - Orchestrator のテスト セットをインポートする」をご覧ください。インポート後に testset-key を取得します。

  3. Test Manager でプロジェクトを作成し、プロジェクト キーを取得します。[プロジェクト] > [すべてのプロジェクト] > [ダッシュボード] タブ> Test Manager からプロジェクト キーを取得します。

  4. 自動化されたテスト ケースを含むパッケージまたはテスト セットを作成します。Test Manager の [テスト セット] タブ> [キー] 列> testset-key を取得します。

  5. クライアント ID とクライアント シークレットを取得します。クライアント ID とクライアント シークレットの取得方法の詳細については、「 CI/CD との連携 - UiPath CLI タスクを実行する 」の「外部アプリケーションを登録する」をご覧ください。

  6. CLI の exe ファイル (Windows の場合) または dll ファイル (Linux の場合) を実行します。

  7. 必要な Test Manager API アクセスのアプリケーション スコープを追加します。Test Manager のスコープについて詳しくは、「 CI/CD との連携 - UiPath CLI タスクを実行する 」をご覧ください。

CLI で Test Manager を使用する​

Test Manager を使用してパッケージをテストするには、次の手順を実行します。 uipcli test を使用してテスト タスクを実行します。利用可能なサブタスクのリストが表示されます。必要なパラメーターを指定し、run サブタスクを実行します。

Orchestrator でのテストの代わりに Test Manager を使用するには、test run コマンドで --projectKey パラメーターを指定します。CLI によって、テストが Test Manager 経由で自動的にルーティングされます。

テスト コマンドのパラメーター​
パラメーター説明Required
Orchestrator URL (pos. 0)Orchestrator インスタンスの URL ですはい
Orchestrator Tenant (pos. 1)パッケージまたはテスト セットが含まれるテナントSaaS デプロイの場合は必須、PaaS デプロイの場合は任意
-P, --project-pathテストするテスト パッケージ ファイルへのパスですいいえ
--projectKeyTest Manager の >[ダッシュボード] タブに表示されるプロジェクト キー> [プロジェクト] > [すべてのプロジェクト]プロジェクト キーは、すべてのオブジェクト キーのプレフィックスです。はい (Test Manager の場合)
--testsetkeyTest Manager の [テスト セット] タブ> [キー] 列に表示されるテスト セット>キーです。テスト セットに最新バージョンのテスト ケースが含まれていることを確認します。テスト セットが既定のフォルダーに含まれていない場合は、前に適切なフォルダー名を含めてください。例: AccountingTeam\TestSetいいえ
-s, --testset実行するテスト セットに表示される名前です。テスト セットに最新バージョンのテスト ケースが含まれていることを確認します。テスト セットが既定のフォルダーに含まれていない場合は、前に適切なフォルダー名を含めてください。例: AccountingTeam\TestSetいいえ
--out結果ファイルの種類 (junit または uipath) ですいいえ
-r, --result_path結果の保存先のファイルのパスですいいえ
-e, --environmentパッケージをデプロイする環境です。これは、 project pathクラシック フォルダーに必要です
-w, --timeoutテスト セットの実行を待機する時間 (秒単位) です。既定値は 7200 秒ですいいえ
-i, --input_pathJSON 入力ファイルへのフル パスです。ファイル構造について詳しくは、「 入力パラメーター JSON 形式 」をご覧ください。エントリ ポイント ワークフローに入力パラメーターがある場合は必須です
--attachRobotLogs実行された各テスト ケースのロボット ログと JUnit テスト レポートを添付しますいいえ
--repositoryUrlプロジェクトがバージョン管理されているリポジトリの URL ですいいえ
--repositoryCommitプロジェクトの構築元であるリポジトリのコミットですいいえ
--repositoryBranchプロジェクトの構築元のリポジトリ ブランチですいいえ
--repositoryTypeVCSシステム・リポジトリ・タイプいいえ
--projectUrlAutomation Hub のアイデアの URLいいえ
--releaseNotesリリースノートの追加いいえ
--disableBuiltInNugetFeeds組み込みの NuGet フィードを無効化いいえ
--retryCount失敗したテスト ケースのリトライ回数 (既定では、リトライは設定されていません)いいえ
-u, --usernameOrchestrator への認証に使用するユーザー名です。対応するパスワードと組み合わせる必要があります基本認証に必要です
-p, --passwordOrchestrator への認証に使用するパスワードです。対応するユーザー名と組み合わせる必要があります基本認証に必要です
-t, --tokenOrchestrator への認証に使用される OAuth2 更新トークンです。アカウント名およびクライアント ID と組み合わせる必要がありますトークンベースの認証に必要です
-a, --accountNameOrchestrator Cloud RPA のアカウント名です。OAuth2 更新トークンおよびクライアント ID と組み合わせる必要がありますトークンベースの認証に必要です
-A, --accountForAppOrchestrator Cloud RPA のアカウント名 (組織名) です。外部アプリケーションのアプリケーション ID、アプリケーション シークレット、アプリケーション スコープと組み合わせて使用する必要があります。いいえ
-I, --applicationId外部アプリケーション ID です。アプリケーション アカウント、アプリケーション シークレット、アプリケーション スコープと組み合わせて使用する必要があります外部アプリケーションの認証に必要
-S, --applicationSecret外部アプリケーション シークレットです。アプリケーション アカウント、アプリケーション ID、アプリケーション スコープと組み合わせて使用する必要があります外部アプリケーションの認証に必要
--applicationScopeアプリケーション スコープを単一のスペースで区切って列挙したリストです。外部アプリケーションのアプリケーション アカウント、アプリケーション ID、アプリケーション シークレットと組み合わせて使用する必要があります。外部アプリケーションの認証に必要
-o, --organizationUnitテスト セットを実行する Orchestrator のフォルダーです。いいえ
-l, --languageOrchestrator のユーザー インターフェイスで使用される言語いいえ
--traceLevelイベントのトレースを表示しますいいえ
--identityURLIdentity Server の URL ですPaaS または MSI のデプロイに必要です
注: Test Manager に必要なアプリケーション スコープ

Test Manager を使用する場合、 --applicationScope パラメーターに以下のスコープを含める必要があります。

TM.Projects TM.TestSets TM.TestExecutions

Orchestrator のスコープに加えて、以下の操作も行います。

OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read

使用例​

Test Manager で既存のテスト セットを実行します​
# Windows
uipcli test run "https://cloud.uipath.com/" "TenantName" `
  --projectKey "MyTestProject" `
  --testsetkey "MyTestSet" `
  -A "organizationName" `
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" `
  -S "********" `
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" `
  -o "FolderName" `
  --out "junit" `
  --result_path "C:\TestResults"

# Linux
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"
# Windows
uipcli test run "https://cloud.uipath.com/" "TenantName" `
  --projectKey "MyTestProject" `
  --testsetkey "MyTestSet" `
  -A "organizationName" `
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" `
  -S "********" `
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" `
  -o "FolderName" `
  --out "junit" `
  --result_path "C:\TestResults"

# Linux
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"

プロジェクトから一時的なテスト セットを作成して実行する​

一時的なテスト セットは、プロジェクト パスからその場で作成される一時的なテスト セットです。

uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  -P "./MyTestProject/project.json" \
  -e "TestEnvironment" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "uipath" \
  --result_path "./test-results"
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  -P "./MyTestProject/project.json" \
  -e "TestEnvironment" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "uipath" \
  --result_path "./test-results"

パラメーターを上書きしてテストを実行する​

uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -i "./test-parameters.json" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -i "./test-parameters.json" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"

ロボット ログが添付されてテストを実行する​

uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  --attachRobotLogs true \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  --attachRobotLogs true \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./test-results"

レポートの種類​

Test Manager では、次の 2 つの出力形式がサポートされています。

形式説明ユースケース
junitJUnit XML 形式CI/CD との連携 (Jenkins、Azure DevOps、GitHub Actions)
uipathUiPath のネイティブ形式Test Manager 固有のデータを含む詳細な実行レポート

Orchestrator のテストからの移行​

変更前 (Orchestrator のテスト)​

uipcli test run "https://cloud.uipath.com/" "TenantName" \
  -s "MyTestSet" \
  -u "username" \
  -p "password" \
  -o "FolderName" \
  -P "./project.json"
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  -s "MyTestSet" \
  -u "username" \
  -p "password" \
  -o "FolderName" \
  -P "./project.json"

実行後 (Test Manager)​

uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./results"
uipcli test run "https://cloud.uipath.com/" "TenantName" \
  --projectKey "MyTestProject" \
  --testsetkey "MyTestSet" \
  -A "organizationName" \
  -I "becc663c-8f1e-409a-a75f-c00330d80bc8" \
  -S "********" \
  --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" \
  -o "FolderName" \
  --out "junit" \
  --result_path "./results"

主な違い​

  1. --projectKeyパラメーターを追加して Test Manager を有効化します
  2. テスト セットの識別に-sではなく --testsetkey を使用する
  3. Test Manager で OAuth 認証 (アプリケーション資格情報) が必要
  4. 出力形式を --out で指定し、出力先を --result_path で指定
  5. Test Manager のスコープを --applicationScope に含める

ベスト プラクティス​

Test Manager の設定​

  • さまざまなアプリケーションやチーム専用の Test Manager プロジェクトを作成する
  • わかりやすいプロジェクト キーとテスト セット キーを使用して、簡単に識別できるようにします
  • 目的 (回帰、煙、統合など) ごとにテスト セットを整理します。

パラメータ管理​

  • 環境固有の構成には、パラメーター ファイル (-i) を使用します
  • 機密性の高いパラメーターは、パラメーター ファイルではなく CI/CD シークレットに保存する
  • テスト セットの説明に必要なパラメーターを文書化します

リトライ ロジック​

  • 断続的に失敗する可能性のある不安定なテストには --retryCount を使用します
  • テスト期間に基づいて適切な --timeout 値を設定する
  • リトライ パターンを監視して、不安定なテストを特定して修正します

報告​

  • CI/CD パイプライン連携に junit 形式を使用する
  • Test Manager で詳細を分析するには uipath 形式を使用します
  • テストの不合格をデバッグするための --attachRobotLogs の有効化

CI/CD との連携​

  • セキュリティで保護された環境変数を使用して Test Manager の認証を設定する
  • コードのコミットまたはプル要求に対する自動テスト実行を設定する
  • テストレポートをビルド成果物としてアーカイブし、履歴を追跡

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得