自動化テスト出力の解釈
注釈:本資料はAI技術を用いて翻訳されています。
概要
自動化テストは通常、自動ビルドパイプラインの一部として使用され、頻繁なビルドにおけるコストを削減します。自動化テストは2種類の出力を生成します。
-
Unrealログ:このログは、コマンドラインで実行する場合はコマンドラインに出力され、Unreal Editorで実行する場合はUnrealログウィンドウに出力されます。Unrealログファイルは、セッション中にUnrealコンソールに出力された内容です。デフォルトでは、ログは以下の場所に保存されます。
\<ProjectRoot>\ProjectName\Saved\Logs -
AccelByte Development Toolkit(ADT)ログファイル:テストは、JSON lines形式で1つのレベルのテスト結果を含む複数のADTログファイルを生成します。ADTログファイルのレイアウトは以下のとおりです。
<header>
---
<body>
---
<footer>
Unrealを使用して自動化テストを実行すると、システムはADTログファイルを生成します。ファイルは任意の場所に配置でき、後でADT CLIを使用してアップロードできます。例:
\<ProjectRoot>\ProjectName\Saved\Logs\AutomatedTest\AutomatedTest_Windows_Level1.json
BlackBoxログファイル
BlackBoxログファイルヘッダー
BlackBoxログファイルの<header>部分は次のようになります:
{
"@encoding": "blackbox/snifftest+json.v2.0.0"
}
"@encoding"は、このADTログファイルのエンコーディングバージョンを示します。エンコーディング値が最新であることを確認してください。このエンコーディングは、ADT Hubにファイルの形式を伝えます。
BlackBoxログファイル本文
テスト結果の<body>部分は、以下の形式である必要があります。
{"type": "begin_test", "name": "test1"}
{"type": "msg", "msg_type": "error", "msg": "errors", "callstack":"C:\Dev\Project\Source\Project\Private\Automation\AutoCommands.cpp (777)"}
{"type": "msg", "msg_type": "warning", "msg": "warning", "callstack":"C:\Dev\Project\Source\Project\Private\Automation\AutoCommands.cpp (778)"}
{"type": "msg", "msg_type": "info", "msg": "info", "callstack":"C:\Dev\Project\Source\Project\Private\Automation\AutoCommands.cpp (779)"}
{"type": "end_test", "name": "test1", "result": "success"}
例:
{"type":"begin_test","name":"Mantle"}
{"type":"msg","msg_type":"info","msg":"MantleFromActorsPosition test : start","callstack":"C:\Dev\Project\Source\Project\Private\Automation\AutoCommands_Locomotion.cpp (777)"}
{"type":"msg","msg_type":"info","msg":"MantleFromActorsPosition Teleport to Mantle1","callstack":""C:\Dev\Project\Source\Project\Private\Automation\AutoCommands_Locomotion.cpp (830)"}
{"type":"msg","msg_type":"info","msg":"MantleFromActorsPosition test : Mantle state reached","callstack":""C:\Dev\Project\Source\Project\Private\Automation\AutoCommands_Locomotion.cpp (877)"}
{"type":"msg","msg_type":"info","msg":"MantleFromActorsPosition from actor (Mantle1) : Mantle Success","callstack":""C:\Dev\Project\Source\Project\Private\Automation\AutoCommands_Locomotion.cpp (884)"}
{"type":"msg","msg_type":"info","msg":"MantleFromActorsPosition test : finish","callstack":""C:\Dev\Project\Source\Project\Private\Automation\AutoCommands_Locomotion.cpp (892)"}
{"type":"end_test","name":"Mantle","result":"success"}
ログを"begin_test"と"end_test"で囲みます。内部にエラータイプのログがある場合、テストは失敗します。
"begin_test"タイプの本文は、以下のパラメータで構成されます。
- 現在のJSON行のtype(形式:
"type":"begin_test") - 現在のテストのname(形式:
"name": "test1")
"msg"タイプの本文は、以下のパラメータで構成されます。
- 現在のJSON行のtype(形式:
"type":"msg") - msg_type:ログの詳細度タイプ(info、error、warning)
- msg:ログメッセージ
- callstack:ログが呼び出されたコールスタック
"end_test"タイプの本文は、以下のパラメータで構成されます。
- 現在のJSON行のtype(形式:
"type":"end_test") - 現在のテストのname
- 現在のテストのresult(エラーログメッセージがある場合は
"failed")
BlackBoxログファイルフッター
テスト結果の<footer>部分:
{
test_id : "", map: "", total_test : "", failed : "", success : "", result : ""
}
- test_idは生成されたランダムなUUID
- mapは現在のテストが実行されているマップ(レベル)
- total_testはこのテストで実行されたアクションの総数(または
<body>部分の総行数) - failedは失敗したテストの数
- successは成功したテストの数
- resultは現在のマップ(レベル)でのテストの結果。オプションは
successまたはfailedです。結果は、本文内のレコードのいずれにも失敗した結果がない場合にのみsuccessになります。
テスト結果の例
ABShooterというゲームのLevel 1を使用したADTログファイルの例:
{
"@encoding": "blackbox/snifftest+json.v1.0.1"
}
---
{"type":"begin_test","name":"LoadMap-Level_1"}
{"type":"msg","msg_type":"warning","msg":"RegisterLocationMarkersForBodyPartCaps has been called", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"warning","msg":"GetVertexLocations returned false for mesh HeadStump.", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"info","msg":"FlushAsyncLoading: 1 QueuedPackages, 0 AsyncPackages", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"info","msg":"ULevelStreaming::RequestLevel(/Game/Maps/Game/Escape/Sections/Security/Escape_Security_VFX) is flushing async loading", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"error","msg":"USoundControllerComponent::BeginPlay - sound slots not configured!", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"error","msg":"USoundControllerComponent::BeginPlay - sound slots not configured!", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"end_test","name":"LoadMap-Level_1","result":"failed"}
{"type":"begin_test","name":"Flashlight-PlayerStart"}
{"type":"msg","msg_type":"info","msg":"Flashlight test : start", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"msg","msg_type":"info","msg":"Flashlight test : Success", "callstack":""C:\Dev\Project\Source\Project\Private\Automation\Something.cpp (830)"}
{"type":"end_test","name":"Flashlight-PlayerStart","result":"success"}
---
{
test_id : "fc341e58-9a5a-48e6-9ffc-c3b398f935e5", map: "Level_1", total_test : "2", failed : "1", success : "1", result : "failed"
}