create-triggered-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create Triggered Task Test Case Guide

触发任务测试用例创建指南

Usage Examples

使用示例

What You WantExample Prompt
Create triggered task
Create a triggered task for my Snowflake pipeline
Create and execute task
Create and execute a triggered task for my Oracle pipeline
Execute existing task
Execute a triggered task with different input file
Task with parameters
Create a task that passes account and schema parameters
Task with notifications
Create a task with email notifications on completion
Task with timeout
Create a triggered task with 5 minute timeout
Get template
Show me a template for creating and executing triggered tasks
See example
What does a triggered task test case look like?

你想要实现的操作示例提示词
创建触发任务
Create a triggered task for my Snowflake pipeline
创建并执行任务
Create and execute a triggered task for my Oracle pipeline
执行现有任务
Execute a triggered task with different input file
带参数的任务
Create a task that passes account and schema parameters
带通知的任务
Create a task with email notifications on completion
带超时的任务
Create a triggered task with 5 minute timeout
获取模板
Show me a template for creating and executing triggered tasks
查看示例
What does a triggered task test case look like?

Claude Instructions

Claude使用说明

IMPORTANT: When user asks a simple question like "How do I create a triggered task?", provide a concise answer first with just the template/command, then offer to explain more if needed. Do NOT dump all documentation.
PREREQUISITES (Claude: Always verify these before creating test cases):
  1. Pipeline must be imported first — use
    /import-pipeline
    if not done yet.
  2. Required accounts must be created first — use
    /create-account
    if not done yet.
  3. Know what parameters the pipeline expects (account references, schema, table, etc.).
MANDATORY: When creating triggered task test cases, you MUST call the Write tool to create ALL required files. Do NOT read files to check if they exist first. Do NOT say "file already exists" or "already complete". Always write them fresh:
  1. Robot test file (
    .robot
    ) in
    test/suite/pipeline_tests/[type]/
    — WRITE this
  2. TRIGGERED_TASK_README.md with file structure tree diagram in the same test directory — WRITE this
This applies to ALL triggered task test cases. No exceptions. You must call Write for each file. See the "IMPORTANT: Step-by-Step Workflow" section for details.
Response format for simple questions:
  1. Give the direct template or test case first
  2. Add a brief note if relevant
  3. Offer "Want me to explain more?" only if appropriate

重要提示: 当用户提出类似“如何创建触发任务?”的简单问题时,先提供简洁的答案,仅包含模板/命令,然后询问用户是否需要更多解释。不要直接输出所有文档内容。
前提条件(Claude:创建测试用例前务必验证以下内容):
  1. 必须先导入管道——若未完成,请使用
    /import-pipeline
    命令。
  2. 必须先创建所需账户——若未完成,请使用
    /create-account
    命令。
  3. 了解管道所需的参数(账户引用、模式、表等)。
强制要求: 创建触发任务测试用例时,必须调用Write工具来创建所有必要文件。无需先读取文件检查是否已存在,不要提示“文件已存在”或“已完成”,始终重新创建:
  1. Robot测试文件
    .robot
    格式),存放路径为
    test/suite/pipeline_tests/[type]/
    ——必须创建
  2. TRIGGERED_TASK_README.md,包含文件结构树状图,存放在同一测试目录下——必须创建
此要求适用于所有触发任务测试用例,无例外情况。必须为每个文件调用Write工具。详细步骤请查看“重要提示:分步工作流”部分。
简单问题的回复格式:
  1. 先提供直接的模板或测试用例
  2. 如有需要,添加简短说明
  3. 仅在合适的情况下询问“需要我进一步解释吗?”

WHEN USER INVOKES
/create-triggered-task
WITH NO ARGUMENTS

当用户仅调用
/create-triggered-task
且无参数时

Claude: When user types just
/create-triggered-task
with no specific request, present the menu below. Use this EXACT format:

SnapLogic Triggered Task Creation & Execution
Prerequisites
  1. Pipeline must be imported first — use
    /import-pipeline
  2. Required accounts must be created first — use
    /create-account
  3. Know what parameters the pipeline expects
What I Can Do
For every triggered task, I create the complete set of files you need:
  • Robot test file (
    .robot
    ) — Robot Framework test cases for creating AND executing triggered tasks
  • TRIGGERED_TASK_README.md — File structure diagram, prerequisites, and run instructions
Two Key Operations:
  1. Create Triggered Task — Uses
    Create Triggered Task From Template
    to create the task
  2. Execute Triggered Task — Uses
    Run Triggered Task With Parameters From Template
    to run the task
I can also:
  • Show you how to pass pipeline parameters
  • Configure email notifications for task completion/failure
  • Set execution timeouts
  • Override parameters at execution time
What is a Triggered Task? A triggered task is an on-demand pipeline execution in SnapLogic. You first CREATE the task (define it), then EXECUTE it (run it with parameters).
Try these sample prompts to get started:
Sample PromptWhat It Does
Create a triggered task for my Snowflake pipeline
Creates triggered task test case
Create and execute a triggered task
Creates task + runs it
Execute a task with different input file
Shows parameter override at execution
Create a task with parameters for account and schema
Shows parameter passing
Create a task with email notifications
Adds notification configuration
Show me the baseline test for triggered task
Displays existing reference test
Need to set up the pipeline first? Use
/end-to-end-pipeline-verification
for complete setup.

Claude:当用户仅输入
/create-triggered-task
而无具体请求时,展示以下菜单,必须严格遵循此格式:

SnapLogic触发任务创建与执行
前提条件
  1. 必须先导入管道——使用
    /import-pipeline
    命令
  2. 必须先创建所需账户——使用
    /create-account
    命令
  3. 了解管道所需的参数
我能提供的功能
针对每个触发任务,我会创建你所需的完整文件集
  • Robot测试文件
    .robot
    格式)——用于创建和执行触发任务的Robot Framework测试用例
  • TRIGGERED_TASK_README.md——包含文件结构示意图、前提条件和运行说明
两项核心操作:
  1. 创建触发任务——使用
    Create Triggered Task From Template
    来创建任务
  2. 执行触发任务——使用
    Run Triggered Task With Parameters From Template
    来运行任务
我还可以:
  • 展示如何传递管道参数
  • 配置任务完成/失败时的邮件通知
  • 设置执行超时时间
  • 执行时覆盖参数
什么是触发任务? 触发任务是SnapLogic中的按需管道执行功能。你需要先创建任务(定义任务),然后执行任务(带参数运行)。
尝试以下示例提示词开始操作:
示例提示词功能说明
Create a triggered task for my Snowflake pipeline
创建触发任务测试用例
Create and execute a triggered task
创建并运行任务
Execute a task with different input file
展示执行时的参数覆盖
Create a task with parameters for account and schema
展示参数传递
Create a task with email notifications
添加通知配置
Show me the baseline test for triggered task
显示现有参考测试用例
需要先设置管道? 使用
/end-to-end-pipeline-verification
命令完成完整设置。

Natural Language — Just Describe What You Need

自然语言交互——只需描述你的需求

You don't need special syntax. Just describe what you need after
/create-triggered-task
:
/create-triggered-task Create a triggered task for my Snowflake pipeline
/create-triggered-task Create and execute a triggered task with input file parameter
/create-triggered-task I need a task that passes snowflake_acct and schema parameters
/create-triggered-task Execute a triggered task with different input files
/create-triggered-task Create a task with email notifications on completion and failure
Baseline test references:
  • test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robot
  • test/suite/pipeline_tests/oracle/oracle_baseline_tests.robot

你无需使用特殊语法,在
/create-triggered-task
后直接描述需求即可:
/create-triggered-task Create a triggered task for my Snowflake pipeline
/create-triggered-task Create and execute a triggered task with input file parameter
/create-triggered-task I need a task that passes snowflake_acct and schema parameters
/create-triggered-task Execute a triggered task with different input files
/create-triggered-task Create a task with email notifications on completion and failure
基准测试参考:
  • test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robot
  • test/suite/pipeline_tests/oracle/oracle_baseline_tests.robot

Quick Template Reference

快速模板参考

Create triggered task:
robotframework
[Template]    Create Triggered Task From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    ${GROUNDPLEX_NAME}    ${task_params_set}    execution_timeout=300
Execute triggered task:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    param1=value1    param2=value2
Required variables for Create:
VariableDescription
${unique_id}
Generated in suite setup
${PIPELINES_LOCATION_PATH}
SnapLogic path where pipeline is stored
${pipeline_name}
Name of the pipeline
${task_name}
Name to assign to the task
${GROUNDPLEX_NAME}
Snaplex where task will execute (optional)
${task_params_set}
Dictionary of parameters to pass (optional)
Required variables for Execute:
VariableDescription
${unique_id}
Same unique_id used when creating the task
${PIPELINES_LOCATION_PATH}
SnapLogic path where pipeline is stored
${pipeline_name}
Name of the pipeline
${task_name}
Name of the triggered task to execute
key=value
Optional parameter overrides
Related slash command:
/create-triggered-task

创建触发任务:
robotframework
[Template]    Create Triggered Task From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    ${GROUNDPLEX_NAME}    ${task_params_set}    execution_timeout=300
执行触发任务:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    param1=value1    param2=value2
创建任务所需变量:
变量说明
${unique_id}
在套件初始化时生成
${PIPELINES_LOCATION_PATH}
管道在SnapLogic中的存储路径
${pipeline_name}
管道名称
${task_name}
要分配给任务的名称
${GROUNDPLEX_NAME}
任务将在其中执行的Snaplex(可选)
${task_params_set}
要传递的参数字典(可选)
执行任务所需变量:
变量说明
${unique_id}
创建任务时使用的同一唯一ID
${PIPELINES_LOCATION_PATH}
管道在SnapLogic中的存储路径
${pipeline_name}
管道名称
${task_name}
要执行的触发任务名称
key=value
可选的参数覆盖
相关斜杠命令:
/create-triggered-task

Quick Start Template

快速入门模板

Here's a basic test case template for creating AND executing triggered tasks:
IMPORTANT: Required Libraries When creating any new Robot file, ALWAYS include these Resource imports under
*** Settings ***
:
  • snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
    - SnapLogic API keywords from installed package
  • ../../resources/common/general.resource
    - Project-specific common keywords
robotframework
*** Settings ***
Documentation    Creates and executes triggered tasks for SnapLogic pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/general.resource
Library          Collections

*** Variables ***
以下是用于创建和执行触发任务的基础测试用例模板:
重要提示:所需库 创建任何新的Robot文件时,必须在
*** Settings ***
下包含以下Resource导入:
  • snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
    ——来自已安装包的SnapLogic API关键字
  • ../../resources/common/general.resource
    ——项目特定的通用关键字
robotframework
*** Settings ***
Documentation    Creates and executes triggered tasks for SnapLogic pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/general.resource
Library          Collections

*** Variables ***

Pipeline configuration

Pipeline configuration

${pipeline_name} my_pipeline ${task_name} Task
${pipeline_name} my_pipeline ${task_name} Task

Input file for execution

Input file for execution

${input_file_name} test_input.json
${input_file_name} test_input.json

Task parameters - passed to pipeline during creation

Task parameters - passed to pipeline during creation

&{task_params_set} ... account_name=../shared/${ACCOUNT_NAME} ... schema=DEMO ... table=TEST_TABLE
*** Test Cases *** Create Triggered Task [Documentation] Creates a triggered task for pipeline execution. ... PREREQUISITES: ... - Pipeline must be imported first ... - Accounts must be created first ... - ${unique_id} - Generated from suite setup ... ... ARGUMENTS: ... - ${unique_id}: Unique test execution identifier ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored ... - ${pipeline_name}: Name of the pipeline ... - ${task_name}: Name for the triggered task ... - ${GROUNDPLEX_NAME}: Snaplex for execution (optional) ... - ${task_params_set}: Parameters to pass to pipeline (optional) [Tags] task_creation triggered_task [Template] Create Triggered Task From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Triggered Task [Documentation] Executes the triggered task with specified parameters and monitors completion. ... This test case runs the pipeline through the triggered task, optionally overriding ... task parameters for different execution scenarios. ... ... PREREQUISITES: ... - Task must be created first (Create Triggered Task test case) ... - Task must be in ready state before execution ... ... ARGUMENTS: ... - ${unique_id}: Unique identifier matching the task creation ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored ... - ${pipeline_name}: Name of the pipeline associated with the task ... - ${task_name}: Name of the triggered task to execute ... - key=value: Optional parameter overrides (e.g., test_input_file=input.json) [Tags] task_execution triggered_task [Template] Run Triggered Task With Parameters From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}

---
&{task_params_set} ... account_name=../shared/${ACCOUNT_NAME} ... schema=DEMO ... table=TEST_TABLE
*** Test Cases *** Create Triggered Task [Documentation] Creates a triggered task for pipeline execution. ... PREREQUISITES: ... - Pipeline must be imported first ... - Accounts must be created first ... - ${unique_id} - Generated from suite setup ... ... ARGUMENTS: ... - ${unique_id}: Unique test execution identifier ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored ... - ${pipeline_name}: Name of the pipeline ... - ${task_name}: Name for the triggered task ... - ${GROUNDPLEX_NAME}: Snaplex for execution (optional) ... - ${task_params_set}: Parameters to pass to pipeline (optional) [Tags] task_creation triggered_task [Template] Create Triggered Task From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Triggered Task [Documentation] Executes the triggered task with specified parameters and monitors completion. ... This test case runs the pipeline through the triggered task, optionally overriding ... task parameters for different execution scenarios. ... ... PREREQUISITES: ... - Task must be created first (Create Triggered Task test case) ... - Task must be in ready state before execution ... ... ARGUMENTS: ... - ${unique_id}: Unique identifier matching the task creation ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored ... - ${pipeline_name}: Name of the pipeline associated with the task ... - ${task_name}: Name of the triggered task to execute ... - key=value: Optional parameter overrides (e.g., test_input_file=input.json) [Tags] task_execution triggered_task [Template] Run Triggered Task With Parameters From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}

---

IMPORTANT: Step-by-Step Workflow

重要提示:分步工作流

Always follow this workflow when creating triggered task test cases.
MANDATORY: You MUST create ALL of the following files:
#FileLocationPurpose
1Robot test file
test/suite/pipeline_tests/[type]/[type]_triggered_task.robot
Robot Framework test case
2TRIGGERED_TASK_README.md
test/suite/pipeline_tests/[type]/TRIGGERED_TASK_README.md
File structure diagram and instructions
ALWAYS create all files using the Write tool. There are NO exceptions. Even if a file already exists, you MUST still use the Write tool to create/overwrite it. Do NOT skip any file.
创建触发任务测试用例时,请始终遵循此工作流。
强制要求:必须创建以下所有文件:
序号文件路径用途
1Robot测试文件
test/suite/pipeline_tests/[type]/[type]_triggered_task.robot
Robot Framework测试用例
2TRIGGERED_TASK_README.md
test/suite/pipeline_tests/[type]/TRIGGERED_TASK_README.md
文件结构示意图和说明文档
必须始终使用Write工具创建所有文件。 无例外情况。即使文件已存在,也必须使用Write工具重新创建/覆盖,不得跳过任何文件。

Step 1: Identify Requirements

步骤1:明确需求

  • Which pipeline is the triggered task for?
  • What parameters does the pipeline need?
  • Need notifications?
  • What timeout value?
  • Need to execute the task after creating it?
  • 触发任务是为哪个管道创建的?
  • 管道需要哪些参数?
  • 是否需要通知?
  • 超时值设为多少?
  • 创建任务后是否需要执行?

Step 2: Verify Prerequisites

步骤2:验证前提条件

  • Pipeline must be imported (
    /import-pipeline
    )
  • Accounts must be created (
    /create-account
    )
  • 管道必须已导入(使用
    /import-pipeline
    命令)
  • 账户必须已创建(使用
    /create-account
    命令)

Step 3: Create the Robot Test Case (ALWAYS — use Write tool)

步骤3:创建Robot测试用例(必须执行——使用Write工具)

ALWAYS use the Write tool to create the
.robot
test file. Do NOT skip this step.
必须使用Write工具创建
.robot
测试文件,不得跳过此步骤。

Step 4: Create TRIGGERED_TASK_README.md (ALWAYS — use Write tool)

步骤4:创建TRIGGERED_TASK_README.md(必须执行——使用Write工具)

ALWAYS use the Write tool to create the README with file structure diagram. Do NOT skip this step.

必须使用Write工具创建包含文件结构示意图的README文档,不得跳过此步骤。

COMPLETE EXAMPLE: Snowflake Triggered Task with Execution (All Files)

完整示例:带执行功能的Snowflake触发任务(所有文件)

When a user asks "Create and execute a triggered task for Snowflake pipeline", you MUST create ALL of these files:
当用户请求“Create and execute a triggered task for Snowflake pipeline”时,必须创建以下所有文件:

File 1: Robot Test File —
test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robot

文件1:Robot测试文件——
test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robot

robotframework
*** Settings ***
Documentation    Creates and executes triggered task for Snowflake pipeline
...              Task is created with parameters and then executed with optional overrides
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/general.resource
Library          Collections

*** Variables ***
robotframework
*** Settings ***
Documentation    Creates and executes triggered task for Snowflake pipeline
...              Task is created with parameters and then executed with optional overrides
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/general.resource
Library          Collections

*** Variables ***

Pipeline configuration

Pipeline configuration

${pipeline_name} snowflake_keypair ${task_name} Task ${sf_acct_keypair} ${pipeline_name}_account
${pipeline_name} snowflake_keypair ${task_name} Task ${sf_acct_keypair} ${pipeline_name}_account

Input files for execution

Input files for execution

${input_file1_name} test_input_file1.json ${input_file2_name} test_input_file2.json ${input_file3_name} test_input_file3.json
${input_file1_name} test_input_file1.json ${input_file2_name} test_input_file2.json ${input_file3_name} test_input_file3.json

Notification configuration (optional)

Notification configuration (optional)

@{notification_states} Completed Failed &{task_notifications} ... recipients=notify@example.com ... states=${notification_states}
@{notification_states} Completed Failed &{task_notifications} ... recipients=notify@example.com ... states=${notification_states}

Task parameters - passed to pipeline during creation

Task parameters - passed to pipeline during creation

&{task_params_set} ... snowflake_acct=../shared/${sf_acct_keypair} ... schema=DEMO ... table=DEMO.TEST_TABLE ... isTest=test ... test_input_file=${input_file1_name}
*** Test Cases *** Create Snowflake Triggered Task [Documentation] Creates a triggered task for Snowflake pipeline execution. ... The task is configured with pipeline parameters for account reference, ... schema, and table settings. ... ... PREREQUISITES: ... - Snowflake account must be created first ... - Pipeline must be imported first ... - ${unique_id} - Generated from suite setup ... ... ARGUMENTS: ... - ${unique_id}: Unique test execution identifier ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored ... - ${pipeline_name}: Name of the pipeline (snowflake_keypair) ... - ${task_name}: Name for the triggered task (Task) ... - ${GROUNDPLEX_NAME}: Snaplex for execution ... - ${task_params_set}: Parameters including account, schema, table ... - execution_timeout: Task timeout in seconds [Tags] snowflake task_creation triggered_task [Template] Create Triggered Task From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Snowflake Triggered Task [Documentation] Executes the triggered task with specified parameters and monitors completion. ... This test case runs the pipeline through the triggered task, optionally overriding ... task parameters for different execution scenarios. ... ... PREREQUISITES: ... - Task must be created first (Create Snowflake Triggered Task) ... - Task must be in ready state before execution ... ... ARGUMENTS: ... - ${unique_id}: Unique identifier matching the task creation ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored ... - ${pipeline_name}: Name of the pipeline associated with the task ... - ${task_name}: Name of the triggered task to execute ... - test_input_file: Input file parameter override [Tags] snowflake task_execution triggered_task [Template] Run Triggered Task With Parameters From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name} # Additional executions with different input files (uncomment as needed): # ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name} # ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}
undefined
&{task_params_set} ... snowflake_acct=../shared/${sf_acct_keypair} ... schema=DEMO ... table=DEMO.TEST_TABLE ... isTest=test ... test_input_file=${input_file1_name}
*** Test Cases *** Create Snowflake Triggered Task [Documentation] Creates a triggered task for Snowflake pipeline execution. ... The task is configured with pipeline parameters for account reference, ... schema, and table settings. ... ... PREREQUISITES: ... - Snowflake account must be created first ... - Pipeline must be imported first ... - ${unique_id} - Generated from suite setup ... ... ARGUMENTS: ... - ${unique_id}: Unique test execution identifier ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored ... - ${pipeline_name}: Name of the pipeline (snowflake_keypair) ... - ${task_name}: Name for the triggered task (Task) ... - ${GROUNDPLEX_NAME}: Snaplex for execution ... - ${task_params_set}: Parameters including account, schema, table ... - execution_timeout: Task timeout in seconds [Tags] snowflake task_creation triggered_task [Template] Create Triggered Task From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Snowflake Triggered Task [Documentation] Executes the triggered task with specified parameters and monitors completion. ... This test case runs the pipeline through the triggered task, optionally overriding ... task parameters for different execution scenarios. ... ... PREREQUISITES: ... - Task must be created first (Create Snowflake Triggered Task) ... - Task must be in ready state before execution ... ... ARGUMENTS: ... - ${unique_id}: Unique identifier matching the task creation ... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored ... - ${pipeline_name}: Name of the pipeline associated with the task ... - ${task_name}: Name of the triggered task to execute ... - test_input_file: Input file parameter override [Tags] snowflake task_execution triggered_task [Template] Run Triggered Task With Parameters From Template ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name} # Additional executions with different input files (uncomment as needed): # ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name} # ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}
undefined

File 2: README —
test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.md

文件2:README文档——
test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.md

markdown
undefined
markdown
undefined

Snowflake Triggered Task Tests

Snowflake Triggered Task Tests

This test suite creates AND executes triggered tasks for Snowflake pipeline testing.
This test suite creates AND executes triggered tasks for Snowflake pipeline testing.

Purpose

Purpose

Creates triggered task(s) for Snowflake pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Creates triggered task(s) for Snowflake pipeline execution with configurable parameters, then executes them with optional parameter overrides.

Two Key Operations

Two Key Operations

OperationKeywordPurpose
Create Task
Create Triggered Task From Template
Defines the task with default parameters
Execute Task
Run Triggered Task With Parameters From Template
Runs the task, optionally overriding parameters
OperationKeywordPurpose
Create Task
Create Triggered Task From Template
Defines the task with default parameters
Execute Task
Run Triggered Task With Parameters From Template
Runs the task, optionally overriding parameters

File Structure

File Structure

project-root/
├── test/
│   └── suite/
│       └── pipeline_tests/
│           └── snowflake/
│               ├── snowflake_triggered_task.robot             ← Test case file
│               └── TRIGGERED_TASK_README.md                   ← This file
└── .env                                                       ← Environment configuration
project-root/
├── test/
│   └── suite/
│       └── pipeline_tests/
│           └── snowflake/
│               ├── snowflake_triggered_task.robot             ← Test case file
│               └── TRIGGERED_TASK_README.md                   ← This file
└── .env                                                       ← Environment configuration

Prerequisites

Prerequisites

  1. Snowflake account must be created (
    /create-account
    )
  2. Pipeline must be imported (
    /import-pipeline
    )
  3. Environment variables configured in
    .env
  1. Snowflake account must be created (
    /create-account
    )
  2. Pipeline must be imported (
    /import-pipeline
    )
  3. Environment variables configured in
    .env

Task Parameters (Set at Creation)

Task Parameters (Set at Creation)

The following parameters are passed to the pipeline when the task is created:
  • snowflake_acct
    — Reference to the Snowflake account
  • schema
    — Database schema name
  • table
    — Target table name
  • isTest
    — Test mode flag
  • test_input_file
    — Default input file
The following parameters are passed to the pipeline when the task is created:
  • snowflake_acct
    — Reference to the Snowflake account
  • schema
    — Database schema name
  • table
    — Target table name
  • isTest
    — Test mode flag
  • test_input_file
    — Default input file

Parameter Overrides (At Execution)

Parameter Overrides (At Execution)

You can override parameters when executing the task:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=different_file.json
You can override parameters when executing the task:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=different_file.json

How to Run

How to Run

bash
undefined
bash
undefined

Run both create and execute

Run both create and execute

make robot-run-all-tests TAGS="snowflake AND triggered_task" PROJECT_SPACE_SETUP=True
make robot-run-all-tests TAGS="snowflake AND triggered_task" PROJECT_SPACE_SETUP=True

Run only task creation

Run only task creation

make robot-run-all-tests TAGS="task_creation" PROJECT_SPACE_SETUP=True
make robot-run-all-tests TAGS="task_creation" PROJECT_SPACE_SETUP=True

Run only task execution

Run only task execution

make robot-run-all-tests TAGS="task_execution" PROJECT_SPACE_SETUP=True
undefined
Claude: The above is a COMPLETE example. When creating triggered task test cases for ANY type, follow the same pattern — always create all files.

make robot-run-all-tests TAGS="task_execution" PROJECT_SPACE_SETUP=True
undefined
Claude:以上是完整示例。为任何类型的管道创建触发任务测试用例时,请遵循相同模式——始终创建所有文件。

Template Keyword Arguments

模板关键字参数

Create Triggered Task From Template

Create Triggered Task From Template

ArgumentDescriptionRequiredExample
${unique_id}
Unique test execution identifierYes
test_20240115_143022
${PIPELINES_LOCATION_PATH}
SnapLogic path where pipeline is storedYes
org/project_space/project
${pipeline_name}
Name of the pipelineYes
snowflake_keypair
${task_name}
Name to assign to the taskYes
Task
${GROUNDPLEX_NAME}
Snaplex where task will executeOptional
my_snaplex
${task_params_set}
Dictionary of parametersOptional
&{params}
${task_notifications}
Notification settingsOptional
&{notifications}
execution_timeout
Timeout in secondsOptional
300
参数说明是否必填示例
${unique_id}
唯一的测试执行标识符
test_20240115_143022
${PIPELINES_LOCATION_PATH}
管道在SnapLogic中的存储路径
org/project_space/project
${pipeline_name}
管道名称
snowflake_keypair
${task_name}
要分配给任务的名称
Task
${GROUNDPLEX_NAME}
任务将在其中执行的Snaplex可选
my_snaplex
${task_params_set}
参数字典可选
&{params}
${task_notifications}
通知设置可选
&{notifications}
execution_timeout
超时时间(秒)可选
300

Run Triggered Task With Parameters From Template

Run Triggered Task With Parameters From Template

ArgumentDescriptionRequiredExample
${unique_id}
Unique test execution identifierYes
test_20240115_143022
${PIPELINES_LOCATION_PATH}
SnapLogic path where pipeline is storedYes
org/project_space/project
${pipeline_name}
Name of the pipelineYes
snowflake_keypair
${task_name}
Name of the task to executeYes
Task
key=value
Parameter overridesOptional
test_input_file=input.json

参数说明是否必填示例
${unique_id}
唯一的测试执行标识符
test_20240115_143022
${PIPELINES_LOCATION_PATH}
管道在SnapLogic中的存储路径
org/project_space/project
${pipeline_name}
管道名称
snowflake_keypair
${task_name}
要执行的任务名称
Task
key=value
参数覆盖可选
test_input_file=input.json

Test Case Examples

测试用例示例

Basic Create and Execute

基础创建与执行

robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task
${input_file_name}              test_input.json

*** Test Cases ***
Create Triggered Task
    [Documentation]    Creates a triggered task.
    [Tags]    snowflake    task_creation
    [Template]    Create Triggered Task From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}

Execute Triggered Task
    [Documentation]    Executes the triggered task.
    [Tags]    snowflake    task_execution
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file_name}
robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task
${input_file_name}              test_input.json

*** Test Cases ***
Create Triggered Task
    [Documentation]    Creates a triggered task.
    [Tags]    snowflake    task_creation
    [Template]    Create Triggered Task From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}

Execute Triggered Task
    [Documentation]    Executes the triggered task.
    [Tags]    snowflake    task_execution
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file_name}

Execute with Multiple Input Files

多输入文件执行

robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task
${input_file1_name}             test_input_file1.json
${input_file2_name}             test_input_file2.json
${input_file3_name}             test_input_file3.json

*** Test Cases ***
Execute Triggered Task With Multiple Files
    [Documentation]    Executes the triggered task multiple times with different input files.
    [Tags]    snowflake    task_execution    multiple_files
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file1_name}
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file2_name}
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file3_name}
robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task
${input_file1_name}             test_input_file1.json
${input_file2_name}             test_input_file2.json
${input_file3_name}             test_input_file3.json

*** Test Cases ***
Execute Triggered Task With Multiple Files
    [Documentation]    Executes the triggered task multiple times with different input files.
    [Tags]    snowflake    task_execution    multiple_files
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file1_name}
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file2_name}
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    test_input_file=${input_file3_name}

Execute with Multiple Parameter Overrides

多参数覆盖执行

robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task

*** Test Cases ***
Execute With Custom Parameters
    [Documentation]    Executes the triggered task with multiple parameter overrides.
    [Tags]    snowflake    task_execution
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    schema=PROD    table=PROD.CUSTOMERS    mode=production
robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task

*** Test Cases ***
Execute With Custom Parameters
    [Documentation]    Executes the triggered task with multiple parameter overrides.
    [Tags]    snowflake    task_execution
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    schema=PROD    table=PROD.CUSTOMERS    mode=production

Create with Notifications, Then Execute

创建带通知的任务并执行

robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task

@{notification_states}          Completed    Failed
&{task_notifications}
...    recipients=notify@example.com
...    states=${notification_states}

&{task_params_set}
...    snowflake_acct=../shared/${SNOWFLAKE_ACCOUNT_NAME}

*** Test Cases ***
Create Triggered Task With Notifications
    [Documentation]    Creates triggered task with email notifications.
    [Tags]    snowflake    task_creation    notifications
    [Template]    Create Triggered Task From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    ${GROUNDPLEX_NAME}    ${task_params_set}    ${task_notifications}    execution_timeout=300

Execute Notified Task
    [Documentation]    Executes the task that has notifications configured.
    [Tags]    snowflake    task_execution    notifications
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}

robotframework
*** Variables ***
${pipeline_name}                snowflake_demo
${task_name}                    Task

@{notification_states}          Completed    Failed
&{task_notifications}
...    recipients=notify@example.com
...    states=${notification_states}

&{task_params_set}
...    snowflake_acct=../shared/${SNOWFLAKE_ACCOUNT_NAME}

*** Test Cases ***
Create Triggered Task With Notifications
    [Documentation]    Creates triggered task with email notifications.
    [Tags]    snowflake    task_creation    notifications
    [Template]    Create Triggered Task From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    ${GROUNDPLEX_NAME}    ${task_params_set}    ${task_notifications}    execution_timeout=300

Execute Notified Task
    [Documentation]    Executes the task that has notifications configured.
    [Tags]    snowflake    task_execution    notifications
    [Template]    Run Triggered Task With Parameters From Template
    ${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}

Parameter Configuration

参数配置

Defining Task Parameters (for Create)

定义任务参数(用于创建)

Task parameters are defined as a Robot Framework dictionary:
robotframework
*** Variables ***
&{task_params_set}
...    account_param=../shared/${ACCOUNT_NAME}
...    schema_param=DEMO
...    table_param=TEST_TABLE
...    input_file=${input_file_name}
任务参数以Robot Framework字典形式定义:
robotframework
*** Variables ***
&{task_params_set}
...    account_param=../shared/${ACCOUNT_NAME}
...    schema_param=DEMO
...    table_param=TEST_TABLE
...    input_file=${input_file_name}

Overriding Parameters (at Execute)

覆盖参数(执行时)

Parameters can be overridden at execution time using key=value syntax:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    input_file=different_file.json    schema=PROD
执行时可使用key=value语法覆盖参数:
robotframework
[Template]    Run Triggered Task With Parameters From Template
${unique_id}    ${PIPELINES_LOCATION_PATH}    ${pipeline_name}    ${task_name}    input_file=different_file.json    schema=PROD

Common Parameter Patterns

常见参数模式

ParameterDescriptionExample Value
Account referencePath to account in SnapLogic
../shared/snowflake_acct
SchemaDatabase schema
DEMO
TableTable name
DEMO.TEST_TABLE
Input fileInput file name
test_input.json
Mode flagTest/prod mode
test

参数说明示例值
Account referenceSnapLogic中的账户路径
../shared/snowflake_acct
Schema数据库模式
DEMO
Table表名称
DEMO.TEST_TABLE
Input file输入文件名
test_input.json
Mode flag测试/生产模式
test

Notification Configuration

通知配置

Setting Up Notifications

设置通知

robotframework
*** Variables ***
robotframework
*** Variables ***

Define which states trigger notifications

Define which states trigger notifications

@{notification_states} Completed Failed
@{notification_states} Completed Failed

Configure notification settings

Configure notification settings

&{task_notifications} ... recipients=email1@example.com,email2@example.com ... states=${notification_states}
undefined
&{task_notifications} ... recipients=email1@example.com,email2@example.com ... states=${notification_states}
undefined

Available Notification States

可用通知状态

  • Completed
    — Task completed successfully
  • Failed
    — Task execution failed
  • Started
    — Task started execution
  • Stopped
    — Task was stopped

  • Completed
    — 任务成功完成
  • Failed
    — 任务执行失败
  • Started
    — 任务开始执行
  • Stopped
    — 任务已停止

Typical Test Execution Flow

典型测试执行流程

┌─────────────────────────┐
│  1. Suite Setup         │
│  (Generate unique_id)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  2. Create Accounts     │
│  (Database, S3, etc.)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  3. Upload Files        │
│  (Input data, expr libs)│
└───────────┬─────────────┘
┌─────────────────────────┐
│  4. Import Pipeline     │
│  (.slp file)            │
└───────────┬─────────────┘
┌─────────────────────────┐
│  5. Create Triggered    │  ◄── CREATE TASK
│     Task                │
└───────────┬─────────────┘
┌─────────────────────────┐
│  6. Execute Triggered   │  ◄── EXECUTE TASK
│     Task                │
└───────────┬─────────────┘
┌─────────────────────────┐
│  7. Verify Results      │
└─────────────────────────┘

┌─────────────────────────┐
│  1. Suite Setup         │
│  (Generate unique_id)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  2. Create Accounts     │
│  (Database, S3, etc.)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  3. Upload Files        │
│  (Input data, expr libs)│
└───────────┬─────────────┘
┌─────────────────────────┐
│  4. Import Pipeline     │
│  (.slp file)            │
└───────────┬─────────────┘
┌─────────────────────────┐
│  5. Create Triggered    │  ◄── CREATE TASK
│     Task                │
└───────────┬─────────────┘
┌─────────────────────────┐
│  6. Execute Triggered   │  ◄── EXECUTE TASK
│     Task                │
└───────────┬─────────────┘
┌─────────────────────────┐
│  7. Verify Results      │
└─────────────────────────┘

MANDATORY: TRIGGERED_TASK_README.md with File Structure

强制要求:包含文件结构的TRIGGERED_TASK_README.md

IMPORTANT: Every time you create triggered task test cases, you MUST also create a TRIGGERED_TASK_README.md in the same directory with a file structure diagram.
This is required for ALL triggered tasks. No exceptions.
重要提示:每次创建触发任务测试用例时,必须在同一目录下创建TRIGGERED_TASK_README.md文档,包含文件结构示意图。
此要求适用于所有触发任务,无例外情况。

README Template

README模板

markdown
undefined
markdown
undefined

[Type] Triggered Task Tests

[Type] Triggered Task Tests

This test suite creates AND executes triggered tasks for [Type] pipeline testing.
This test suite creates AND executes triggered tasks for [Type] pipeline testing.

Purpose

Purpose

Creates triggered task(s) for [Type] pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Creates triggered task(s) for [Type] pipeline execution with configurable parameters, then executes them with optional parameter overrides.

Two Key Operations

Two Key Operations

OperationKeywordPurpose
Create Task
Create Triggered Task From Template
Defines the task with default parameters
Execute Task
Run Triggered Task With Parameters From Template
Runs the task, optionally overriding parameters
OperationKeywordPurpose
Create Task
Create Triggered Task From Template
Defines the task with default parameters
Execute Task
Run Triggered Task With Parameters From Template
Runs the task, optionally overriding parameters

File Structure

File Structure

project-root/
├── test/
│   └── suite/
│       └── pipeline_tests/
│           └── [type]/
│               ├── [type]_triggered_task.robot                ← Test case file
│               └── TRIGGERED_TASK_README.md                   ← This file
└── .env                                                       ← Environment configuration
project-root/
├── test/
│   └── suite/
│       └── pipeline_tests/
│           └── [type]/
│               ├── [type]_triggered_task.robot                ← Test case file
│               └── TRIGGERED_TASK_README.md                   ← This file
└── .env                                                       ← Environment configuration

Prerequisites

Prerequisites

  1. [Type] account must be created (
    /create-account
    )
  2. Pipeline must be imported (
    /import-pipeline
    )
  3. Environment variables configured in
    .env
  1. [Type] account must be created (
    /create-account
    )
  2. Pipeline must be imported (
    /import-pipeline
    )
  3. Environment variables configured in
    .env

Task Parameters (Set at Creation)

Task Parameters (Set at Creation)

  • [param1]
    — Description
  • [param2]
    — Description
  • [param1]
    — Description
  • [param2]
    — Description

Parameter Overrides (At Execution)

Parameter Overrides (At Execution)

  • [param1]
    — Override description
  • [param2]
    — Override description
  • [param1]
    — Override description
  • [param2]
    — Override description

How to Run

How to Run

bash
make robot-run-all-tests TAGS="[type] AND triggered_task" PROJECT_SPACE_SETUP=True

---
bash
make robot-run-all-tests TAGS="[type] AND triggered_task" PROJECT_SPACE_SETUP=True

---

Troubleshooting

故障排除

Common Issues

常见问题

IssueCauseSolution
Pipeline not found
Pipeline not importedRun
/import-pipeline
first
Account not found
Account not createdRun
/create-account
first
Task not found
Task not createdRun Create Triggered Task first
Invalid parameter
Parameter name mismatchCheck pipeline parameter names
Task creation failed
Permission issueVerify SnapLogic permissions
Execution timeout
Long-running pipelineIncrease
execution_timeout
Parameter override ignored
Wrong key nameCheck parameter name matches pipeline
问题原因解决方案
Pipeline not found
管道未导入先运行
/import-pipeline
Account not found
账户未创建先运行
/create-account
Task not found
任务未创建先运行Create Triggered Task
Invalid parameter
参数名称不匹配检查管道参数名称
Task creation failed
权限问题验证SnapLogic权限
Execution timeout
管道运行时间过长增加
execution_timeout
Parameter override ignored
键名称错误检查参数名称是否与管道匹配

Debug Tips

调试技巧

  1. Verify task exists before executing:
    robotframework
    Log    Task: ${task_name}    console=yes
    Log    Pipeline: ${pipeline_name}    console=yes
  2. Log execution parameters:
    robotframework
    Log    Executing with input_file: ${input_file_name}    console=yes
  3. Log task parameters:
    robotframework
    Log Dictionary    ${task_params_set}    console=yes
  4. Check environment variables:
    bash
    make check-env

  1. 执行前验证任务是否存在:
    robotframework
    Log    Task: ${task_name}    console=yes
    Log    Pipeline: ${pipeline_name}    console=yes
  2. 记录执行参数:
    robotframework
    Log    Executing with input_file: ${input_file_name}    console=yes
  3. 记录任务参数:
    robotframework
    Log Dictionary    ${task_params_set}    console=yes
  4. 检查环境变量:
    bash
    make check-env

Checklist Before Committing

提交前检查清单

  • Pipeline is imported first
  • Required accounts are created
  • Task parameters match pipeline parameters
  • ${task_name}
    variable defined
  • Create Triggered Task test case included
  • Execute Triggered Task test case included (if needed)
  • Parameter overrides use correct key names
  • Test has appropriate tags (
    task_creation
    ,
    task_execution
    ,
    triggered_task
    )
  • Documentation describes both create and execute operations
  • TRIGGERED_TASK_README.md created with file structure diagram
  • 管道已先导入
  • 所需账户已创建
  • 任务参数与管道参数匹配
  • 已定义
    ${task_name}
    变量
  • 包含Create Triggered Task测试用例
  • 包含Execute Triggered Task测试用例(若需要)
  • 参数覆盖使用正确的键名称
  • 测试用例已添加合适的标签(
    task_creation
    ,
    task_execution
    ,
    triggered_task
  • 文档描述了创建和执行操作
  • 已创建包含文件结构示意图的TRIGGERED_TASK_README.md