テストケースを使用したSparkジョブのテスト
最終更新日時: 2026-11-10
テストケースを使用したジョブおよびサービスのテストにおけるテストフレームワークは、継続的統合ワークフロー内のSparkジョブに対しても適用されます。
情報メモヒント: Local mode is selected by default in the
Spark Configuration tab. Use Local mode
when designing and testing Spark Jobs. Depending on the number of input and output flows,
context variables are automatically created to specify the input and reference files, and
the Use context variable radio button in the Basic
settings tab of tFixedFlowInput or
tBoundedStreamInput is automatically selected.
情報メモ注: Before you create a test case for a Job, make sure all Job components are configured.
「テストケースを使用したジョブおよびサービスのテスト」に記載されている手順に従って、Sparkテストケースを作成します。Sparkジョブ専用のテストスケルトンが用意されています。
デフォルトでは、Sparkテストスケルトンには以下が含まれています。
-
ジョブ内の入力フローの数に応じた、入力ファイルを読み込むための1つ以上のtFixedFlowInputコンポーネント(Sparkストリーミングジョブの場合はtBoundedStreamInput)。
-
読み取り専用のINPUTおよびOUTPUTアイコン。テストする部分の最初と最後を示すために使用します。
-
1つ(または複数)のtCollectAndCheckコンポーネント。一時出力ファイルを参照ファイルと比較するためのジョブ内の出力フローの数によります。ファイルが同一である場合はテスト成功、そうでない場合は失敗となります。
継続的統合およびTalendによる実装の詳細については、「ソフトウェア開発ライフサイクルのベストプラクティスガイド」を参照してください。