- 概要
- はじめに
- 概念
- UiPath CLI を使用する
- 使用ガイド
- CI/CD レシピ
- コマンド リファレンス
- 概要
- 終了コード
- グローバル オプション
- uip codedagent
- UIP コーダー
- UIP のコンテキスト グラウンディング
- uip docsai
- uip 関数
- UIP ガードレール
- uip llm - 構成
- uip llm-gateway
- UIP Maestro のオーサリング
- UIP Maestro レジストリ
- uip model-hub
- アクティビティ検索
- アクティビティ get-default-xaml
- 分析
- アナライザー - ルールのリスト
- 開発
- クリーンアップ
- data-fabric-entities をインストールする
- data-fabric-entities リスト
- ファイル差分
- get-library-object-repository
- オブジェクト リポジトリを取得
- Init
- インスタンス リスト
- パッケージ化
- パッケージ検査
- パッケージのインストール
- パッケージ バージョン
- パブリッシュ
- リモート
- 元に戻す
- 実行、デバッグ、実行
- 設定
- Studio での起動
- テンプレートの検索
- test-data add-entity
- test-data add-queue
- test-data add-variation
- TM
- UIA
- 検証
- workflow-examples get
- ワークフロー - 例のリスト
- UIP タスク
- uip traces
- UIP トレースのフィードバック
- 移行
- 参照とサポート
UIP TM の実行
「uip tm run」の構文とオプション。この実行は、Orchestrator に既にアップロード済みのパッケージ内のすべてのテストを実行し、結果を待機してレポートを書き込み、テストが失敗すると非 0 で終了します。
uip tm run は、Test Manager でテストを実行し、結果を待機し、CI 用に作成された 1 つのコマンドでレポートを書き込みます。--type packageでは、Orchestrator にアップロード済みのパッケージ内のすべてのテストが実行されます。終了コードには判定が記述されるため、パイプライン ステップで追加の解析は必要ありません。
このコマンドは、Test Manager がアップロードされたパッケージのインデックスを作成するまで最大 5 分待ってから、非表示のテスト セットを通じてテストを実行します。Test Manager は、パッケージ内にまだテスト ケースがないテスト ケースを作成してリンクします。失敗したテスト ケースは同じ実行内で最大で --max-retries 回再実行されるため、レポートにはすべてのテスト ケースの最後の結果が保持されます。
--project-key または --project-idがない場合、テストはテナントの既定のプロジェクト (project get-default が返すプロジェクト) で実行されます。テナントにプロジェクトがない場合、Test Manager によってそのプロジェクトが作成されます。すべての結果に、テストが実行されたプロジェクトに という名前 ProjectKeyが付いています。
概要
uip tm run --type package [--project-key <key> | --project-id <id>] --package-name <name> --package-version <version> (--folder-path <path> | --folder-key <uuid>) [--input-path <file>] [--max-retries <count>] [--format <format>] [--result-path <path>] [--include-passed-assertions] [--timeout <seconds>] [--poll-interval <seconds>]
uip tm run --type package [--project-key <key> | --project-id <id>] --package-name <name> --package-version <version> (--folder-path <path> | --folder-key <uuid>) [--input-path <file>] [--max-retries <count>] [--format <format>] [--result-path <path>] [--include-passed-assertions] [--timeout <seconds>] [--poll-interval <seconds>]
グローバル オプションが適用されます。このコマンドが使用するコードについては、 終了コード を参照してください。
UIP TM の実行
アップロードされたパッケージ内のすべてのテストを実行し、実行が完了するまで待機し、JUnit XML または UiPath JSON レポートを記述します。
引数
設定はありません。
オプション
| フラグ | 説明 |
|---|---|
--type <type> | 必須。実行する内容。package (Orchestrator にアップロード済みのパッケージ) のみが受け入れられます。 |
--project-key <key> | Test Manager プロジェクト キー。--project-idも指定されている場合は無視されます。--project-key または --project-idを使用しない場合、テストはテナントの既定のプロジェクトで実行されます。テナントにテナントがない場合、Test Manager によってテナントが作成されます。このテナントにはテナントのProject.Create権限が必要です。 |
--project-id <id> | Test Manager プロジェクト IDの代わりに を使用します --project-key両方が与えられた場合に勝ちます。 |
--package-name <name> | 必須。Orchestrator にアップロードされたパッケージ ID (例: MyTests)。 |
--package-version <version> | 必須。アプリのバージョン (例: 1.0) で、アップロードされた最新のパッチが実行されます。正確なバージョン (例: 1.0.244878764) がすでにアップロードされている必要があり、アプリのバージョンの最新のパッチである必要があります。古いパッチは拒否されます。このコマンドは、Test Manager が Orchestrator に既に作成されているバージョンのインデックスを作成するまで最大 5 分待機します。 |
--folder-path <path> | テストを実行する Orchestrator フォルダーです (例: Shared や Shared/CI)。--folder-pathまたは--folder-keyのいずれか 1 つだけが必要です。 |
--folder-key <uuid> | Orchestrator のフォルダー キー ( --folder-pathではなく )。 |
--input-path <file> | パラメーターが上書きされた JSON ファイル (例: [{"name":"Param","type":"String","value":"v"}])。ファイルは、何かが作成される前に読み取られます。テストで宣言されていない名前は適用されません。出力では、 IgnoredInputsの下にリストされます。 |
--max-retries <count> | 失敗したテスト ケースを 0 回から 100回まで繰り返し再実行します。既定値は 0です。 |
--format <format> | レポート形式: junit (XML) または uipath (JSON)既定値は junitです。 |
--result-path <path> | ファイルまたはディレクトリをレポートします。既定では、現在の作業ディレクトリです。ディレクトリ、または拡張子のない新しいパスには、実行のテスト セットにちなんだ名前のファイルが取得されます。 |
--include-passed-assertions | また、レポートの合格したテストのアサーション (合格したテストごとに 1 つの要求) もお読みください。既定では、合格しなかったテストのみがアサーションを取得します。 |
--timeout <seconds> | 実行全体の最大秒数 (リトライを含む) 0 、タイムアウトがないことを意味します。既定値は 7200で、最大で 604800 (1 週間) です。 |
--poll-interval <seconds> | 実行ステータスの確認間隔 ( 1 から 3600までの秒数)。既定値は 60です。 |
例
# run every test in MyTests 1.0.3 and write a JUnit report
uip tm run \
--type package \
--project-key DEMO \
--package-name MyTests \
--package-version 1.0.3 \
--folder-path Shared \
--result-path ./results/junit.xml
# run the same package in the tenant default project (no --project-key)
uip tm run \
--type package \
--package-name MyTests \
--package-version 1.0.3 \
--folder-path Shared \
--result-path ./results/junit.xml
# run the latest 1.0.x patch with input overrides, retry failed tests twice, write the UiPath JSON report
uip tm run \
--type package \
--project-key DEMO \
--package-name MyTests \
--package-version 1.0 \
--folder-path Shared \
--input-path ./inputs.json \
--max-retries 2 \
--format uipath
# run every test in MyTests 1.0.3 and write a JUnit report
uip tm run \
--type package \
--project-key DEMO \
--package-name MyTests \
--package-version 1.0.3 \
--folder-path Shared \
--result-path ./results/junit.xml
# run the same package in the tenant default project (no --project-key)
uip tm run \
--type package \
--package-name MyTests \
--package-version 1.0.3 \
--folder-path Shared \
--result-path ./results/junit.xml
# run the latest 1.0.x patch with input overrides, retry failed tests twice, write the UiPath JSON report
uip tm run \
--type package \
--project-key DEMO \
--package-name MyTests \
--package-version 1.0 \
--folder-path Shared \
--input-path ./inputs.json \
--max-retries 2 \
--format uipath
データ図形 (すべてのテストに合格)
{
"Result": "Success",
"Code": "RunPackage",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
"PackageName": "MyTests",
"PackageVersion": "1.0.3",
"FolderPath": "Shared",
"Status": "Finished",
"TotalTests": 12,
"Passed": 12,
"Failed": 0,
"Cancelled": 0,
"Format": "junit",
"OutputPath": "./results/junit.xml",
"Retries": 0,
"ProjectKey": "DEMO"
}
}
{
"Result": "Success",
"Code": "RunPackage",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
"PackageName": "MyTests",
"PackageVersion": "1.0.3",
"FolderPath": "Shared",
"Status": "Finished",
"TotalTests": 12,
"Passed": 12,
"Failed": 0,
"Cancelled": 0,
"Format": "junit",
"OutputPath": "./results/junit.xml",
"Retries": 0,
"ProjectKey": "DEMO"
}
}
| フィールド | 意味 |
|---|---|
ExecutionUrl | Link to the execution in Test Manager. Present on success and on failure. |
PackageVersion | 実行された正確なバージョン --package-versionから解決されました。 |
ProjectKey | テストが実行されたプロジェクト (合格したプロジェクト、またはテナントの既定のプロジェクト)これは最後のフィールドであるため、 --output plain は最後の列になります。 |
Retries | 失敗したテスト ケースの再実行回数です。 |
OutputPath | レポートが書かれた場所。 |
IgnoredInputs, DeclaredInputs | テスト --input-path 宣言していない入力 (無視される名前と、テストが宣言する名前) の名前を付けている場合にのみ表示されます。 |
MissingResults | Test Manager が報告した結果よりも多くのテストをカウントしている場合にのみ表示されます。 |
AssertionsNotRead | 一部のテストのアサーションを読み取ることができなかった場合にのみ存在します。レポートには、これらの失敗の詳細はありません。 |
テストに合格しても、入力が無視された場合や、アサーションを読み取れなかった場合、成功エンベロープにも Warningが付きます。
データシェイプ (テストに失敗)
{
"Result": "Failure",
"Code": "RunPackageTestsFailed",
"ErrorCode": "execution_failed",
"Message": "2 of 12 tests did not pass (2 failed).",
"Instructions": "See the report at ./results/junit.xml or open https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001.",
"Retry": "RetryWillNotFix",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
"PackageName": "MyTests",
"PackageVersion": "1.0.3",
"FolderPath": "Shared",
"Status": "Finished",
"TotalTests": 12,
"Passed": 10,
"Failed": 2,
"Cancelled": 0,
"Format": "junit",
"OutputPath": "./results/junit.xml",
"Retries": 0,
"ProjectKey": "DEMO"
}
}
{
"Result": "Failure",
"Code": "RunPackageTestsFailed",
"ErrorCode": "execution_failed",
"Message": "2 of 12 tests did not pass (2 failed).",
"Instructions": "See the report at ./results/junit.xml or open https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001.",
"Retry": "RetryWillNotFix",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
"PackageName": "MyTests",
"PackageVersion": "1.0.3",
"FolderPath": "Shared",
"Status": "Finished",
"TotalTests": 12,
"Passed": 10,
"Failed": 2,
"Cancelled": 0,
"Format": "junit",
"OutputPath": "./results/junit.xml",
"Retries": 0,
"ProjectKey": "DEMO"
}
}
Data holds the same run summary as on success, with the same fields in the same order. Only the envelope around it differs:
| Envelope field | Every test passed | A test failed |
|---|---|---|
Result | Success | Failure |
Code | RunPackage | RunPackageTestsFailed, or RunPackageCancelled for a cancelled execution |
ErrorCode、Message、Instructions、Retry | Absent | Present. Instructions names the report path and the execution link. |
| 終了コード | 0 | 1 |
To link a CI run to its results in Test Manager, read Data.ExecutionUrl. It is present whether the tests passed or failed. The report is written in both cases.
データシェイプ (タイムアウト)
{
"Result": "TimeoutError",
"ErrorCode": "timeout",
"Message": "Timed out while waiting for the tests.",
"Instructions": "The tests may still be running. Check execution a1b2c3d4-0000-0000-0000-000000000001 in Test Manager, or run again with a larger --timeout. A report of the tests that finished is at ./results/junit.xml.",
"Retry": "RetryLater",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Retries": 0,
"OutputPath": "./results/junit.xml",
"ProjectKey": "DEMO",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001"
}
}
{
"Result": "TimeoutError",
"ErrorCode": "timeout",
"Message": "Timed out while waiting for the tests.",
"Instructions": "The tests may still be running. Check execution a1b2c3d4-0000-0000-0000-000000000001 in Test Manager, or run again with a larger --timeout. A report of the tests that finished is at ./results/junit.xml.",
"Retry": "RetryLater",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Retries": 0,
"OutputPath": "./results/junit.xml",
"ProjectKey": "DEMO",
"ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001"
}
}
Data は、時間切れになる前に実行が開始された場合にのみ存在します。OutputPath は、完了したテストの部分的なレポートを作成できる場合にのみ表示されます。ProjectKey ExecutionUrl 開始した実行を見つけます。実行開始後にそれ以外に失敗した場合、同じ Data フィールドが発生します。
終了コード
| 終了コード | 意味 |
|---|---|
0 | すべてのテストに合格しました。 |
1 | テストが失敗したか、結果が報告されていないか、実行がキャンセルされたか、テストが実行されなかったか、またはサービス呼び出しが失敗しました。 |
2 | 実行開始後にログインまたは権限に問題があるか、テナントの既定のプロジェクトを開いたり作成したりする権限がない。ログインできないか、合格したプロジェクトにアクセスできない場合、実行が開始する前に 1 終了します。 |
3 | 正しくないオプションまたは入力 (たとえば、フォルダーがない、または両方のフォルダー フラグがある、 --package-versionが無効、 --input-path ファイルの形式が正しくないなど)。 |
4 | --timeout 経過。 |
終了コード 1 にはいくつかの結果が記載されています。それらを区別するには、エンベロープを読み取ってください。 Code はキャンセルされた実行に対して RunPackageCancelled され、それ以外の場合は RunPackageTestsFailed テストが実行されなかった場合 (空のパッケージや指定ミスの場合など Data.TotalTests ) に 0 され、 Data.MissingResults 結果が報告されなかったテストがカウントされます。runing-login のケースは、認証エラーが 2で終了するという CLI 全体のルールとは異なります。「 終了コード」をご覧ください。
uip tm waitとは異なり、実行が終了すると 0 を終了しますが、uip tm runテストに合格しなかった場合、ステップ自体は失敗します。
関連
- UIP またはパッケージ — このコマンドを実行するパッケージを
packages uploadパブリッシュします。 - プロジェクト get-default — プロジェクトを渡さない場合にこのコマンドが実行される、テナントの既定のプロジェクトです。
- pack — 外部の Playwright テスト プロジェクトから
.nupkgを構築します。 - テスト セットの実行 — 代わりに、既存のテスト セットの実行を開始します。
- 実行 — このコマンドが開始する実行を検査、リトライ、またはキャンセルします。
- result — 任意の実行のために JUnit XML をダウンロードします。