verify-data-in-db

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Verify Data in Database Table Test Case Guide

数据库表数据验证测试用例指南

Usage Examples

使用示例

What You WantExample Prompt
Verify record count
Verify that my Oracle table has 2 records after pipeline execution
Export data to CSV
Export data from Snowflake table to CSV for comparison
Compare actual vs expected
Compare actual output from database with expected CSV file
Full verification flow
Verify pipeline results: count records, export to CSV, compare with expected
Get template
Show me a template for verifying database data
See example
What does a data verification test case look like?

你想要实现的操作示例提示词
验证记录数
验证数据管道执行后我的Oracle表中有2条记录
导出数据到CSV
将Snowflake表中的数据导出为CSV以便对比
对比实际与预期结果
将数据库的实际输出与预期CSV文件进行对比
完整验证流程
验证管道结果:统计记录数、导出为CSV、与预期结果对比
获取模板
给我展示一个验证数据库数据的模板
查看示例
数据验证测试用例是什么样的?

Claude Instructions

Claude使用说明

IMPORTANT: When user asks a simple question like "How do I verify data in a table?", 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 have been executed — triggered task must have completed successfully.
  2. Database connection must be established in Suite Setup.
  3. Know the table name, schema, and expected record count.
  4. For CSV comparison, know the expected output file path.
MANDATORY: When creating data verification 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. VERIFY_DATA_README.md with file structure tree diagram in the same test directory — WRITE this
This applies to ALL data verification test cases. No exceptions. You must call Write for each file.
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. 数据管道已执行——触发的任务必须已成功完成。
  2. 已在Suite Setup中建立数据库连接。
  3. 知晓表名、模式和预期记录数。
  4. 若要进行CSV对比,需知晓预期输出文件的路径。
强制要求: 创建数据验证测试用例时,你必须调用Write工具来创建所有必要的文件。不要先读取文件来检查是否已存在。不要提示“文件已存在”或“已完成”。始终重新创建这些文件:
  1. Robot测试文件
    .robot
    ),路径为
    test/suite/pipeline_tests/[type]/
    —— 必须创建
  2. VERIFY_DATA_README.md,包含文件结构树状图,与测试文件在同一目录下 —— 必须创建
此要求适用于所有数据验证测试用例,无例外。你必须为每个文件调用Write工具。
简单问题的回复格式:
  1. 先提供直接的模板或测试用例
  2. 如有相关,添加简短说明
  3. 仅在合适的情况下询问“需要我进一步解释吗?”

WHEN USER INVOKES
/verify-data-in-db-in-db
WITH NO ARGUMENTS

当用户调用
/verify-data-in-db-in-db
但未传入任何参数时

Claude: When user types just
/verify-data-in-db-in-db
with no specific request, present the menu below. Use this EXACT format:

SnapLogic Data Verification in Database Tables
Prerequisites
  1. Pipeline must have been executed (triggered task completed)
  2. Database connection must be established in Suite Setup
  3. Know the table name, schema, and expected record count
  4. For CSV comparison, know the expected output file path
What I Can Do
I create test cases for verifying pipeline execution results in database tables:
  • Verify Record Count — Check that expected number of records were inserted
  • Export Data to CSV — Export table data for detailed comparison
  • Compare Actual vs Expected — Compare exported CSV with expected output file
Three Key Operations:
  1. Capture And Verify Number of records From DB Table
    — Verify record count
  2. Export DB Table Data To CSV
    — Export table data to CSV
  3. Compare CSV Files With Exclusions Template
    — Compare actual vs expected (with column exclusions)
Try these sample prompts to get started:
Sample PromptWhat It Does
Verify Oracle table has 2 records after pipeline
Creates record count verification
Export Snowflake data to CSV and compare with expected
Creates export + comparison test
Full verification flow for my Oracle pipeline
Creates complete verification suite
Show me the baseline test for data verification
Displays existing reference test
Compare CSV files excluding timestamp columns
Shows column exclusion pattern
Need to execute the pipeline first? Use
/create-triggered-task
to create and execute the task.

Claude:当用户仅输入
/verify-data-in-db-in-db
未附带具体请求时,请展示以下菜单。严格使用此格式:

SnapLogic数据库表数据验证
前置条件
  1. 数据管道已执行(触发的任务已完成)
  2. 已在Suite Setup中建立数据库连接
  3. 知晓表名、模式和预期记录数
  4. 若要进行CSV对比,需知晓预期输出文件的路径
我能实现的功能
我可以创建测试用例,用于验证数据管道执行后数据库表中的结果:
  • 验证记录数 —— 检查是否插入了预期数量的记录
  • 导出数据到CSV —— 导出表数据以便进行详细对比
  • 对比实际与预期结果 —— 将导出的CSV与预期输出文件进行对比
三个核心操作:
  1. Capture And Verify Number of records From DB Table
    —— 验证记录数
  2. Export DB Table Data To CSV
    —— 将数据库表数据导出为CSV
  3. Compare CSV Files With Exclusions Template
    —— 对比实际与预期结果(支持排除指定列)
可以尝试以下示例提示词快速开始:
示例提示词功能说明
验证数据管道执行后Oracle表中有2条记录
创建记录数验证测试用例
将Snowflake数据导出为CSV并与预期结果对比
创建导出+对比测试用例
为我的Oracle管道创建完整的验证流程创建完整的验证套件
给我展示数据验证的基准测试用例
显示已有的参考测试用例
对比CSV文件,排除时间戳列
展示列排除的配置方式
需要先执行数据管道? 使用
/create-triggered-task
来创建并执行任务。

Natural Language — Just Describe What You Need

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

You don't need special syntax. Just describe what you need after
/verify-data-in-db
:
/verify-data-in-db Verify my Oracle table has 2 records after pipeline execution
/verify-data-in-db Export data from Snowflake table and compare with expected output
/verify-data-in-db Create full verification test for PostgreSQL pipeline results
/verify-data-in-db Compare actual vs expected CSV, excluding timestamp columns
Baseline test references:
  • test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robot
  • test/suite/pipeline_tests/oracle/oracle_baseline_tests.robot

你无需使用特殊语法,只需在
/verify-data-in-db
后描述你的需求即可:
/verify-data-in-db 验证数据管道执行后我的Oracle表中有2条记录
/verify-data-in-db 将Snowflake表中的数据导出并与预期输出对比
/verify-data-in-db 为PostgreSQL管道结果创建完整的验证测试用例
/verify-data-in-db 对比实际与预期CSV,排除时间戳列
基准测试用例参考:
  • test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robot
  • test/suite/pipeline_tests/oracle/oracle_baseline_tests.robot

Quick Template Reference

快速模板参考

Verify record count:
robotframework
Capture And Verify Number of records From DB Table
...    ${table_name}
...    ${schema_name}
...    ${order_by_column}
...    ${expected_record_count}
Export data to CSV:
robotframework
Export DB Table Data To CSV
...    ${table_name}
...    ${order_by_column}
...    ${output_file_path}
Compare actual vs expected CSV:
robotframework
[Template]    Compare CSV Files With Exclusions Template
${actual_file_path}    ${expected_file_path}    ${ignore_order}    ${show_details}    ${expected_status}    @{excluded_columns}
Required variables:
VariableDescription
${table_name}
Full table name (e.g.,
DEMO.TEST_TABLE
)
${schema_name}
Schema name (e.g.,
DEMO
)
${order_by_column}
Column for consistent ordering
${expected_record_count}
Number of expected records
${actual_file_path}
Path to exported actual output CSV
${expected_file_path}
Path to expected output CSV
@{excluded_columns}
List of columns to exclude from comparison
Related slash command:
/verify-data-in-db

验证记录数:
robotframework
Capture And Verify Number of records From DB Table
...    ${table_name}
...    ${schema_name}
...    ${order_by_column}
...    ${expected_record_count}
导出数据到CSV:
robotframework
Export DB Table Data To CSV
...    ${table_name}
...    ${order_by_column}
...    ${output_file_path}
对比实际与预期CSV:
robotframework
[Template]    Compare CSV Files With Exclusions Template
${actual_file_path}    ${expected_file_path}    ${ignore_order}    ${show_details}    ${expected_status}    @{excluded_columns}
必填变量:
变量说明
${table_name}
完整表名(例如:
DEMO.TEST_TABLE
${schema_name}
模式名称(例如:
DEMO
${order_by_column}
用于确保排序一致性的列
${expected_record_count}
预期记录数
${actual_file_path}
导出的实际输出CSV文件路径
${expected_file_path}
预期输出CSV文件路径
@{excluded_columns}
对比时需要排除的列列表
相关斜杠命令:
/verify-data-in-db

Quick Start Template

快速开始模板

Here's a basic test case template for data verification:
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
  • ../../resources/common/sql_table_operations.resource
    - SQL table operations
  • ../../resources/common/files.resource
    - CSV/file comparison operations
robotframework
*** Settings ***
Documentation    Verifies data in database table after pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections

*** Variables ***
以下是数据验证的基础测试用例模板:
重要提示:必填库 创建任何新的Robot文件时,必须在
*** Settings ***
下包含以下Resource导入:
  • snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
    - SnapLogic API关键字库
  • ../../resources/common/sql_table_operations.resource
    - SQL表操作库
  • ../../resources/common/files.resource
    - CSV/文件对比操作库
robotframework
*** Settings ***
Documentation    验证数据管道执行后数据库表中的数据
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections

*** Variables ***

Table configuration

表配置

${table_name} DEMO.TEST_TABLE ${schema_name} DEMO ${order_by_column} RECORD_METADATA
${table_name} DEMO.TEST_TABLE ${schema_name} DEMO ${order_by_column} RECORD_METADATA

Expected record count

预期记录数

${expected_record_count} 2
${expected_record_count} 2

Output files

输出文件

${actual_output_file} ${CURDIR}/../../test_data/actual_expected_data/actual_output/oracle/actual_output.csv ${expected_output_file} ${CURDIR}/../../test_data/actual_expected_data/expected_output/oracle/expected_output.csv
${actual_output_file} ${CURDIR}/../../test_data/actual_expected_data/actual_output/oracle/actual_output.csv ${expected_output_file} ${CURDIR}/../../test_data/actual_expected_data/expected_output/oracle/expected_output.csv

Columns to exclude from comparison (timestamps, dynamic values)

对比时需要排除的列(时间戳、动态值)

@{excluded_columns_for_comparison} ... event_timestamp ... unique_event_id ... SnowflakeConnectorPushTime
*** Test Cases *** Verify Data In Table [Documentation] Verifies data integrity in database table by querying and validating record counts. ... PREREQUISITES: ... - Pipeline execution completed successfully ... - Table exists with data inserted ... - Database connection is established [Tags] verification data_validation Capture And Verify Number of records From DB Table ... ${table_name} ... ${schema_name} ... ${order_by_column} ... ${expected_record_count}
Export Data To CSV [Documentation] Exports data from database table to CSV for comparison. ... PREREQUISITES: ... - Previous verification passed ... - Database connection established [Tags] verification export Export DB Table Data To CSV ... ${table_name} ... ${order_by_column} ... ${actual_output_file}
Compare Actual vs Expected Output [Documentation] Compares actual database export against expected output. ... PREREQUISITES: ... - Export completed successfully ... - Expected output file exists [Tags] verification comparison [Template] Compare CSV Files With Exclusions Template ${actual_output_file} ${expected_output_file} ${FALSE} ${TRUE} IDENTICAL @{excluded_columns_for_comparison}

---
@{excluded_columns_for_comparison} ... event_timestamp ... unique_event_id ... SnowflakeConnectorPushTime
*** Test Cases *** Verify Data In Table [Documentation] 通过查询和验证记录数,验证数据库表中的数据完整性。 ... 前置条件: ... - 数据管道执行完成 ... - 表已存在且已插入数据 ... - 已建立数据库连接 [Tags] verification data_validation Capture And Verify Number of records From DB Table ... ${table_name} ... ${schema_name} ... ${order_by_column} ... ${expected_record_count}
Export Data To CSV [Documentation] 将数据库表中的数据导出为CSV以便对比。 ... 前置条件: ... - 上一步验证已通过 ... - 已建立数据库连接 [Tags] verification export Export DB Table Data To CSV ... ${table_name} ... ${order_by_column} ... ${actual_output_file}
Compare Actual vs Expected Output [Documentation] 将数据库导出的实际数据与预期输出进行对比。 ... 前置条件: ... - 导出操作已完成 ... - 预期输出文件已存在 [Tags] verification comparison [Template] Compare CSV Files With Exclusions Template ${actual_output_file} ${expected_output_file} ${FALSE} ${TRUE} IDENTICAL @{excluded_columns_for_comparison}

---

IMPORTANT: Step-by-Step Workflow

重要提示:分步工作流

Always follow this workflow when creating data verification test cases.
MANDATORY: You MUST create ALL of the following files:
#FileLocationPurpose
1Robot test file
test/suite/pipeline_tests/[type]/[type]_verify_data.robot
Robot Framework test case
2VERIFY_DATA_README.md
test/suite/pipeline_tests/[type]/VERIFY_DATA_README.md
File structure diagram and instructions
ALWAYS create all files using the Write tool. There are NO exceptions.
创建数据验证测试用例时请始终遵循以下工作流。
强制要求:你必须创建以下所有文件:
序号文件位置用途
1Robot测试文件
test/suite/pipeline_tests/[type]/[type]_verify_data.robot
Robot Framework测试用例
2VERIFY_DATA_README.md与测试文件在同一目录下文件结构说明文档
必须始终使用Write工具创建所有文件。无例外。

Step 1: Identify Requirements

步骤1:明确需求

  • Which database type? (Oracle, Snowflake, PostgreSQL, etc.)
  • What table to verify?
  • Expected record count?
  • Need CSV comparison?
  • Which columns to exclude from comparison?
  • 数据库类型?(Oracle、Snowflake、PostgreSQL等)
  • 需要验证哪个表?
  • 预期记录数是多少?
  • 是否需要CSV对比?
  • 对比时需要排除哪些列?

Step 2: Verify Prerequisites

步骤2:验证前置条件

  • Pipeline must have been executed
  • Database connection in Suite Setup
  • 数据管道已执行
  • Suite Setup中已配置数据库连接

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 VERIFY_DATA_README.md (ALWAYS — use Write tool)

步骤4:创建VERIFY_DATA_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: Oracle Data Verification (All Files)

完整示例:Oracle数据验证(所有文件)

When a user asks "Verify data in Oracle table after pipeline execution", you MUST create ALL of these files:
当用户请求“验证数据管道执行后Oracle表中的数据”时,你必须创建以下所有文件:

File 1: Robot Test File —
test/suite/pipeline_tests/oracle/oracle_verify_data.robot

文件1:Robot测试文件 ——
test/suite/pipeline_tests/oracle/oracle_verify_data.robot

robotframework
*** Settings ***
Documentation    Verifies data in Oracle database table after pipeline execution
...              This test suite validates that the pipeline correctly inserted data
...              by checking record counts and comparing with expected output
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Resource         ../../../resources/common/database.resource
Library          Collections
Library          DatabaseLibrary
Library          oracledb

Suite Setup      Connect To Oracle And Initialize
Suite Teardown   Disconnect From Database

*** Variables ***
robotframework
*** Settings ***
Documentation    Verifies data in Oracle database table after pipeline execution
...              This test suite validates that the pipeline correctly inserted data
...              by checking record counts and comparing with expected output
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Resource         ../../../resources/common/database.resource
Library          Collections
Library          DatabaseLibrary
Library          oracledb

Suite Setup      Connect To Oracle And Initialize
Suite Teardown   Disconnect From Database

*** Variables ***

Table configuration

Table configuration

${table_name} DEMO.TEST_TABLE1 ${schema_name} DEMO ${order_by_column} DCEVENTHEADERS_USERID
${table_name} DEMO.TEST_TABLE1 ${schema_name} DEMO ${order_by_column} DCEVENTHEADERS_USERID

Task parameters (for reference - passed from pipeline)

Task parameters (for reference - passed from pipeline)

&{task_params_set} ... table_name=DEMO.TEST_TABLE1 ... schema_name=DEMO
&{task_params_set} ... table_name=DEMO.TEST_TABLE1 ... schema_name=DEMO

Expected record count after pipeline execution

Expected record count after pipeline execution

${expected_record_count} 2
${expected_record_count} 2

Output file paths

Output file paths

${actual_output_file} ${CURDIR}/../../test_data/actual_expected_data/actual_output/oracle/oracle_actual_output.csv ${expected_output_file} ${CURDIR}/../../test_data/actual_expected_data/expected_output/oracle/expected_output_file1.csv
${actual_output_file} ${CURDIR}/../../test_data/actual_expected_data/actual_output/oracle/oracle_actual_output.csv ${expected_output_file} ${CURDIR}/../../test_data/actual_expected_data/expected_output/oracle/expected_output_file1.csv

Columns to exclude from comparison (dynamic values that change between runs)

Columns to exclude from comparison (dynamic values that change between runs)

@{excluded_columns_for_comparison} ... event_timestamp ... unique_event_id ... created_date
*** Test Cases *** Verify Data In Oracle Table [Documentation] Verifies data integrity in Oracle table by querying and validating record counts. ... This test case ensures that the pipeline successfully inserted the expected number ... of records into the target Oracle table. ... ... 📋 PREREQUISITES: ... • Pipeline execution completed successfully ... • Oracle table exists with data inserted ... • Database connection is established ... • Table is cleaned (truncated) during suite setup for consistent results ... ... 📋 VERIFICATION DETAILS: ... • Table Name: ${task_params_set}[table_name] - Target table to verify (DEMO.TEST_TABLE1) ... • Schema Name: ${task_params_set}[schema_name] - Schema containing the table (DEMO) ... • Order By Column: DCEVENTHEADERS_USERID - Column used for consistent ordering ... • Expected Record Count: 2 - Number of records expected after pipeline execution [Tags] oracle verification data_validation
Capture And Verify Number of records From DB Table
...    ${task_params_set}[table_name]
...    ${task_params_set}[schema_name]
...    ${order_by_column}
...    ${expected_record_count}
Export Oracle Data To CSV [Documentation] Exports data from Oracle table to a CSV file for detailed verification and comparison. ... This test case retrieves all data from the target table and saves it in CSV format, ... enabling file-based validation against expected results. ... ... 📋 PREREQUISITES: ... • Pipeline execution completed successfully (Execute Triggered Task With Parameters) ... • Oracle table contains data inserted by the pipeline ... • Database connection is established ... ... 📋 ARGUMENT DETAILS: ... • Argument 1: Table Name - ${task_params_set}[table_name] - Source table to export data from (DEMO.TEST_TABLE1) ... • Argument 2: Order By Column - DCEVENTHEADERS_USERID - Column for consistent row ordering ... • Argument 3: Output File Path - ${actual_output_file} - Local path to save CSV file ... ... 📋 OUTPUT: ... • CSV file saved to: test/suite/test_data/actual_expected_data/actual_output/oracle/oracle_actual_output.csv ... • File contains all rows from the Oracle table ordered by DCEVENTHEADERS_USERID [Tags] oracle verification export
Export DB Table Data To CSV
...    ${task_params_set}[table_name]
...    ${order_by_column}
...    ${actual_output_file}
Compare Actual vs Expected CSV Output [Documentation] Validates data integrity by comparing actual Oracle export against expected output. ... This test case performs a comprehensive file comparison to ensure that data processed ... through the Oracle pipeline matches the expected results exactly. ... ... 📋 PREREQUISITES: ... • Export Oracle Data To CSV test case completed successfully ... • Expected output file exists at: test/suite/test_data/actual_expected_data/expected_output/oracle/expected_output_file1.csv ... ... 📋 ARGUMENT DETAILS: ... • Argument 1: file1_path - Path to the actual output CSV file from Oracle ... • Argument 2: file2_path - Path to the expected output CSV file (baseline) ... • Argument 3: ignore_order - Boolean flag to ignore row ordering ... • Argument 4: show_details - Boolean flag to display detailed differences ... • Argument 5: expected_status - Expected comparison result (IDENTICAL, DIFFERENT, SUBSET) ... • Argument 6: exclude_columns - List of columns to exclude from comparison ... ... 📋 OUTPUT: ... • Test passes if files are IDENTICAL (or match the expected_status) ... • Detailed differences are displayed in console when show_details=${TRUE} [Tags] oracle verification comparison [Template] Compare CSV Files With Exclusions Template
# file1_path    file2_path    ignore_order    show_details    expected_status    exclude_columns
${actual_output_file}    ${expected_output_file}    ${FALSE}    ${TRUE}    IDENTICAL    @{excluded_columns_for_comparison}
*** Keywords *** Connect To Oracle And Initialize [Documentation] Establishes Oracle database connection for verification Connect to Oracle Database ... ${ORACLE_DATABASE} ... ${ORACLE_USER} ... ${ORACLE_PASSWORD} ... ${ORACLE_HOST} ... ${ORACLE_PORT} Log Connected to Oracle database for verification console=yes
undefined
@{excluded_columns_for_comparison} ... event_timestamp ... unique_event_id ... created_date
*** Test Cases *** Verify Data In Oracle Table [Documentation] Verifies data integrity in Oracle table by querying and validating record counts. ... This test case ensures that the pipeline successfully inserted the expected number ... of records into the target Oracle table. ... ... 📋 PREREQUISITES: ... • Pipeline execution completed successfully ... • Oracle table exists with data inserted ... • Database connection is established ... • Table is cleaned (truncated) during suite setup for consistent results ... ... 📋 VERIFICATION DETAILS: ... • Table Name: ${task_params_set}[table_name] - Target table to verify (DEMO.TEST_TABLE1) ... • Schema Name: ${task_params_set}[schema_name] - Schema containing the table (DEMO) ... • Order By Column: DCEVENTHEADERS_USERID - Column used for consistent ordering ... • Expected Record Count: 2 - Number of records expected after pipeline execution [Tags] oracle verification data_validation
Capture And Verify Number of records From DB Table
...    ${task_params_set}[table_name]
...    ${task_params_set}[schema_name]
...    ${order_by_column}
...    ${expected_record_count}
Export Oracle Data To CSV [Documentation] Exports data from Oracle table to a CSV file for detailed verification and comparison. ... This test case retrieves all data from the target table and saves it in CSV format, ... enabling file-based validation against expected results. ... ... 📋 PREREQUISITES: ... • Pipeline execution completed successfully (Execute Triggered Task With Parameters) ... • Oracle table contains data inserted by the pipeline ... • Database connection is established ... ... 📋 ARGUMENT DETAILS: ... • Argument 1: Table Name - ${task_params_set}[table_name] - Source table to export data from (DEMO.TEST_TABLE1) ... • Argument 2: Order By Column - DCEVENTHEADERS_USERID - Column for consistent row ordering ... • Argument 3: Output File Path - ${actual_output_file} - Local path to save CSV file ... ... 📋 OUTPUT: ... • CSV file saved to: test/suite/test_data/actual_expected_data/actual_output/oracle/oracle_actual_output.csv ... • File contains all rows from the Oracle table ordered by DCEVENTHEADERS_USERID [Tags] oracle verification export
Export DB Table Data To CSV
...    ${task_params_set}[table_name]
...    ${order_by_column}
...    ${actual_output_file}
Compare Actual vs Expected CSV Output [Documentation] Validates data integrity by comparing actual Oracle export against expected output. ... This test case performs a comprehensive file comparison to ensure that data processed ... through the Oracle pipeline matches the expected results exactly. ... ... 📋 PREREQUISITES: ... • Export Oracle Data To CSV test case completed successfully ... • Expected output file exists at: test/suite/test_data/actual_expected_data/expected_output/oracle/expected_output_file1.csv ... ... 📋 ARGUMENT DETAILS: ... • Argument 1: file1_path - Path to the actual output CSV file from Oracle ... • Argument 2: file2_path - Path to the expected output CSV file (baseline) ... • Argument 3: ignore_order - Boolean flag to ignore row ordering ... • Argument 4: show_details - Boolean flag to display detailed differences ... • Argument 5: expected_status - Expected comparison result (IDENTICAL, DIFFERENT, SUBSET) ... • Argument 6: exclude_columns - List of columns to exclude from comparison ... ... 📋 OUTPUT: ... • Test passes if files are IDENTICAL (or match the expected_status) ... • Detailed differences are displayed in console when show_details=${TRUE} [Tags] oracle verification comparison [Template] Compare CSV Files With Exclusions Template
# file1_path    file2_path    ignore_order    show_details    expected_status    exclude_columns
${actual_output_file}    ${expected_output_file}    ${FALSE}    ${TRUE}    IDENTICAL    @{excluded_columns_for_comparison}
*** Keywords *** Connect To Oracle And Initialize [Documentation] Establishes Oracle database connection for verification Connect to Oracle Database ... ${ORACLE_DATABASE} ... ${ORACLE_USER} ... ${ORACLE_PASSWORD} ... ${ORACLE_HOST} ... ${ORACLE_PORT} Log Connected to Oracle database for verification console=yes
undefined

File 2: README —
test/suite/pipeline_tests/oracle/VERIFY_DATA_README.md

文件2:README ——
test/suite/pipeline_tests/oracle/VERIFY_DATA_README.md

markdown
undefined
markdown
undefined

Oracle Data Verification Tests

Oracle数据验证测试用例

This test suite verifies data in Oracle database tables after pipeline execution.
此测试套件用于验证数据管道执行后Oracle数据库表中的数据。

Purpose

用途

Validates that the pipeline correctly inserted data by:
  1. Checking record counts match expected values
  2. Exporting data to CSV for detailed comparison
  3. Comparing actual output with expected baseline files
通过以下方式验证数据管道是否正确插入数据:
  1. 检查记录数是否与预期值一致
  2. 将数据导出为CSV以便进行详细对比
  3. 将实际输出与预期基准文件进行对比

Three Key Operations

三个核心操作

OperationKeywordPurpose
Verify Count
Capture And Verify Number of records From DB Table
Verify expected record count
Export Data
Export DB Table Data To CSV
Export table data to CSV file
Compare Output
Compare CSV Files With Exclusions Template
Compare actual vs expected
操作关键字用途
验证记录数
Capture And Verify Number of records From DB Table
验证预期记录数
导出数据
Export DB Table Data To CSV
将表数据导出为CSV文件
对比输出
Compare CSV Files With Exclusions Template
对比实际与预期结果

File Structure

文件结构

project-root/
├── test/
│   └── suite/
│       ├── pipeline_tests/
│       │   └── oracle/
│       │       ├── oracle_verify_data.robot                ← Test case file
│       │       └── VERIFY_DATA_README.md                   ← This file
│       └── test_data/
│           └── actual_expected_data/
│               ├── actual_output/
│               │   └── oracle/
│               │       └── oracle_actual_output.csv        ← Exported actual data
│               └── expected_output/
│                   └── oracle/
│                       └── expected_output_file1.csv       ← Expected baseline
└── .env                                                    ← Environment configuration
project-root/
├── test/
│   └── suite/
│       ├── pipeline_tests/
│       │   └── oracle/
│       │       ├── oracle_verify_data.robot                ← 测试用例文件
│       │       └── VERIFY_DATA_README.md                   ← 此文档
│       └── test_data/
│           └── actual_expected_data/
│               ├── actual_output/
│               │   └── oracle/
│               │       └── oracle_actual_output.csv        ← 导出的实际数据
│               └── expected_output/
│                   └── oracle/
│                       └── expected_output_file1.csv       ← 预期基准数据
└── .env                                                    ← 环境配置文件

Prerequisites

前置条件

  1. Pipeline must have been executed (triggered task completed)
  2. Oracle database connection configured in
    .env
  3. Expected output file exists in
    expected_output/oracle/
  1. 数据管道已执行(触发的任务已完成)
  2. .env
    文件中已配置Oracle数据库连接信息
  3. 预期输出文件已存在于
    expected_output/oracle/
    目录下

Configuration

配置说明

Table Settings

表设置

  • table_name
    — Target table to verify (e.g.,
    DEMO.TEST_TABLE1
    )
  • schema_name
    — Schema containing the table (e.g.,
    DEMO
    )
  • order_by_column
    — Column for consistent ordering
  • table_name
    —— 需要验证的目标表(例如:
    DEMO.TEST_TABLE1
  • schema_name
    —— 表所在的模式(例如:
    DEMO
  • order_by_column
    —— 用于确保排序一致性的列

Excluded Columns

排除列配置

Columns that change between runs (timestamps, IDs) should be excluded from comparison:
robotframework
@{excluded_columns_for_comparison}
...    event_timestamp
...    unique_event_id
...    created_date
对于每次运行时会变化的列(时间戳、ID等),应从对比中排除:
robotframework
@{excluded_columns_for_comparison}
...    event_timestamp
...    unique_event_id
...    created_date

How to Run

运行方式

bash
undefined
bash
undefined

Run verification tests only

仅运行验证测试用例

make robot-run-all-tests TAGS="oracle AND verification" PROJECT_SPACE_SETUP=True
make robot-run-all-tests TAGS="oracle AND verification" PROJECT_SPACE_SETUP=True

Run specific verification type

运行特定类型的验证测试

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

make robot-run-all-tests TAGS="data_validation" PROJECT_SPACE_SETUP=True make robot-run-all-tests TAGS="comparison" PROJECT_SPACE_SETUP=True
undefined
Claude:以上是完整示例。为任何数据库类型创建数据验证测试用例时,请遵循相同的模式——始终创建所有文件。

Test Case Examples by Database Type

按数据库类型分类的测试用例示例

Snowflake Verification

Snowflake数据验证

robotframework
*** Settings ***
Documentation    Verifies data in Snowflake table after pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../../resources/snowflake/snowflake_keywords_databaselib.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections

Suite Setup      Connect To Snowflake Via DatabaseLibrary    keypair
Suite Teardown   Disconnect From Snowflake

*** Variables ***
${table_name}                   DEMO.TEST_SNAP4
${schema_name}                  DEMO
${order_by_column}              RECORD_METADATA
${expected_record_count}        2

${actual_output_file}           ${CURDIR}/../../test_data/actual_expected_data/actual_output/snowflake/actual_output.csv
${expected_output_file}         ${CURDIR}/../../test_data/actual_expected_data/expected_output/snowflake/expected_output.csv

@{excluded_columns_for_comparison}
...    SnowflakeConnectorPushTime
...    unique_event_id
...    event_timestamp

*** Test Cases ***
Verify Data In Snowflake Table
    [Documentation]    Verifies data integrity in Snowflake table.
    [Tags]    snowflake    verification
    Capture And Verify Number of records From DB Table
    ...    ${table_name}
    ...    ${schema_name}
    ...    ${order_by_column}
    ...    ${expected_record_count}

Export Snowflake Data To CSV
    [Documentation]    Exports Snowflake table data to CSV.
    [Tags]    snowflake    export
    Export DB Table Data To CSV
    ...    ${table_name}
    ...    ${order_by_column}
    ...    ${actual_output_file}

Compare Actual vs Expected
    [Documentation]    Compares actual vs expected CSV output.
    [Tags]    snowflake    comparison
    [Template]    Compare CSV Files With Exclusions Template
    ${actual_output_file}    ${expected_output_file}    ${FALSE}    ${TRUE}    IDENTICAL    @{excluded_columns_for_comparison}
robotframework
*** Settings ***
Documentation    Verifies data in Snowflake table after pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../../resources/snowflake/snowflake_keywords_databaselib.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections

Suite Setup      Connect To Snowflake Via DatabaseLibrary    keypair
Suite Teardown   Disconnect From Snowflake

*** Variables ***
${table_name}                   DEMO.TEST_SNAP4
${schema_name}                  DEMO
${order_by_column}              RECORD_METADATA
${expected_record_count}        2

${actual_output_file}           ${CURDIR}/../../test_data/actual_expected_data/actual_output/snowflake/actual_output.csv
${expected_output_file}         ${CURDIR}/../../test_data/actual_expected_data/expected_output/snowflake/expected_output.csv

@{excluded_columns_for_comparison}
...    SnowflakeConnectorPushTime
...    unique_event_id
...    event_timestamp

*** Test Cases ***
Verify Data In Snowflake Table
    [Documentation]    Verifies data integrity in Snowflake table.
    [Tags]    snowflake    verification
    Capture And Verify Number of records From DB Table
    ...    ${table_name}
    ...    ${schema_name}
    ...    ${order_by_column}
    ...    ${expected_record_count}

Export Snowflake Data To CSV
    [Documentation]    Exports Snowflake table data to CSV.
    [Tags]    snowflake    export
    Export DB Table Data To CSV
    ...    ${table_name}
    ...    ${order_by_column}
    ...    ${actual_output_file}

Compare Actual vs Expected
    [Documentation]    Compares actual vs expected CSV output.
    [Tags]    snowflake    comparison
    [Template]    Compare CSV Files With Exclusions Template
    ${actual_output_file}    ${expected_output_file}    ${FALSE}    ${TRUE}    IDENTICAL    @{excluded_columns_for_comparison}

PostgreSQL Verification

PostgreSQL数据验证

robotframework
*** Settings ***
Documentation    Verifies data in PostgreSQL table after pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections
Library          DatabaseLibrary

Suite Setup      Connect To PostgreSQL Database
Suite Teardown   Disconnect From Database

*** Variables ***
${table_name}                   public.test_table
${schema_name}                  public
${order_by_column}              id
${expected_record_count}        5

${actual_output_file}           ${CURDIR}/../../test_data/actual_expected_data/actual_output/postgres/actual_output.csv
${expected_output_file}         ${CURDIR}/../../test_data/actual_expected_data/expected_output/postgres/expected_output.csv

*** Test Cases ***
Verify Data In PostgreSQL Table
    [Documentation]    Verifies data integrity in PostgreSQL table.
    [Tags]    postgres    verification
    Capture And Verify Number of records From DB Table
    ...    ${table_name}
    ...    ${schema_name}
    ...    ${order_by_column}
    ...    ${expected_record_count}

robotframework
*** Settings ***
Documentation    Verifies data in PostgreSQL table after pipeline execution
Resource         snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource         ../../resources/common/sql_table_operations.resource
Resource         ../../resources/common/files.resource
Library          Collections
Library          DatabaseLibrary

Suite Setup      Connect To PostgreSQL Database
Suite Teardown   Disconnect From Database

*** Variables ***
${table_name}                   public.test_table
${schema_name}                  public
${order_by_column}              id
${expected_record_count}        5

${actual_output_file}           ${CURDIR}/../../test_data/actual_expected_data/actual_output/postgres/actual_output.csv
${expected_output_file}         ${CURDIR}/../../test_data/actual_expected_data/expected_output/postgres/expected_output.csv

*** Test Cases ***
Verify Data In PostgreSQL Table
    [Documentation]    Verifies data integrity in PostgreSQL table.
    [Tags]    postgres    verification
    Capture And Verify Number of records From DB Table
    ...    ${table_name}
    ...    ${schema_name}
    ...    ${order_by_column}
    ...    ${expected_record_count}

Keyword Arguments Reference

关键字参数参考

Capture And Verify Number of records From DB Table

Capture And Verify Number of records From DB Table

ArgumentDescriptionRequiredExample
${table_name}
Full table name (schema.table)Yes
DEMO.TEST_TABLE1
${schema_name}
Schema containing the tableYes
DEMO
${order_by_column}
Column for ordering resultsYes
DCEVENTHEADERS_USERID
${expected_record_count}
Expected number of recordsYes
2
参数说明是否必填示例
${table_name}
完整表名(模式.表名)
DEMO.TEST_TABLE1
${schema_name}
表所在的模式
DEMO
${order_by_column}
用于排序结果的列
DCEVENTHEADERS_USERID
${expected_record_count}
预期记录数
2

Export DB Table Data To CSV

Export DB Table Data To CSV

ArgumentDescriptionRequiredExample
${table_name}
Table to export data fromYes
DEMO.TEST_TABLE1
${order_by_column}
Column for ordering exportYes
DCEVENTHEADERS_USERID
${output_file}
Path to save CSV fileYes
${CURDIR}/.../actual_output.csv
参数说明是否必填示例
${table_name}
要导出数据的表
DEMO.TEST_TABLE1
${order_by_column}
用于排序导出结果的列
DCEVENTHEADERS_USERID
${output_file}
CSV文件的保存路径
${CURDIR}/.../actual_output.csv

Compare CSV Files With Exclusions Template

Compare CSV Files With Exclusions Template

ArgumentDescriptionRequiredExample
${file1_path}
Path to actual output CSVYes
${actual_output_file}
${file2_path}
Path to expected output CSVYes
${expected_output_file}
${ignore_order}
Ignore row order in comparisonYes
${FALSE}
${show_details}
Display detailed differencesYes
${TRUE}
${expected_status}
Expected result (IDENTICAL/DIFFERENT)Yes
IDENTICAL
@{exclude_columns}
Columns to exclude from comparisonOptional
@{excluded_columns}

参数说明是否必填示例
${file1_path}
实际输出CSV文件的路径
${actual_output_file}
${file2_path}
预期输出CSV文件的路径
${expected_output_file}
${ignore_order}
对比时是否忽略行顺序
${FALSE}
${show_details}
是否显示详细的差异信息
${TRUE}
${expected_status}
预期的对比结果(IDENTICAL/DIFFERENT)
IDENTICAL
@{exclude_columns}
对比时需要排除的列可选
@{excluded_columns}

Column Exclusion Patterns

列排除规则

When to Exclude Columns

何时需要排除列

Exclude columns that have dynamic values that change between runs:
robotframework
*** Variables ***
@{excluded_columns_for_comparison}
...    event_timestamp                    # Timestamp when event was created
...    unique_event_id                    # Auto-generated unique ID
...    SnowflakeConnectorPushTime         # Snowflake connector timestamp
...    created_date                       # Record creation date
...    modified_date                      # Record modification date
...    /MARKETING-NOTIFICATIONS/CONTENT   # Dynamic notification content
对于每次运行时会动态变化的列,应将其排除在对比范围之外:
robotframework
*** Variables ***
@{excluded_columns_for_comparison}
...    event_timestamp                    # 事件创建的时间戳
...    unique_event_id                    # 自动生成的唯一ID
...    SnowflakeConnectorPushTime         # Snowflake连接器时间戳
...    created_date                       # 记录创建日期
...    modified_date                      # 记录修改日期
...    /MARKETING-NOTIFICATIONS/CONTENT   # 动态通知内容

Common Patterns by Database

各数据库的常见排除列

DatabaseCommon Excluded Columns
Snowflake
SnowflakeConnectorPushTime
,
_metadata_*
Oracle
CREATED_DATE
,
MODIFIED_DATE
,
SYS_*
PostgreSQL
created_at
,
updated_at
,
ctid
SQL Server
TIMESTAMP
,
ROWVERSION

数据库常见排除列
Snowflake
SnowflakeConnectorPushTime
,
_metadata_*
Oracle
CREATED_DATE
,
MODIFIED_DATE
,
SYS_*
PostgreSQL
created_at
,
updated_at
,
ctid
SQL Server
TIMESTAMP
,
ROWVERSION

Typical Test Execution Flow

典型测试执行流程

┌─────────────────────────┐
│  1. Suite Setup         │
│  (Connect to Database)  │
└───────────┬─────────────┘
┌─────────────────────────┐
│  2. (Previous Steps)    │
│  - Create Account       │
│  - Import Pipeline      │
│  - Execute Task         │
└───────────┬─────────────┘
┌─────────────────────────┐
│  3. Verify Record Count │  ◄── VERIFY COUNT
│  (Expected: 2 records)  │
└───────────┬─────────────┘
┌─────────────────────────┐
│  4. Export Data to CSV  │  ◄── EXPORT DATA
│  (actual_output.csv)    │
└───────────┬─────────────┘
┌─────────────────────────┐
│  5. Compare CSV Files   │  ◄── COMPARE OUTPUT
│  (Actual vs Expected)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  6. Suite Teardown      │
│  (Disconnect Database)  │
└─────────────────────────┘

┌─────────────────────────┐
│  1. Suite Setup         │
│  (连接到数据库)  │
└───────────┬─────────────┘
┌─────────────────────────┐
│  2. (前置步骤)    │
│  - 创建账户       │
│  - 导入数据管道      │
│  - 执行任务         │
└───────────┬─────────────┘
┌─────────────────────────┐
│  3. 验证记录数 │  ◄── 记录数验证
│  (预期:2条记录)  │
└───────────┬─────────────┘
┌─────────────────────────┐
│  4. 导出数据到CSV  │  ◄── 数据导出
│  (actual_output.csv)    │
└───────────┬─────────────┘
┌─────────────────────────┐
│  5. 对比CSV文件   │  ◄── 输出对比
│  (实际与预期)   │
└───────────┬─────────────┘
┌─────────────────────────┐
│  6. Suite Teardown      │
│  (断开数据库连接)  │
└─────────────────────────┘

Supported Database Types

支持的数据库类型

DatabaseConnection ResourceNotes
Oracle
database.resource
+
oracledb
Use
Connect to Oracle Database
Snowflake
snowflake_keywords_databaselib.resource
Use
Connect To Snowflake Via DatabaseLibrary
PostgreSQL
database.resource
+
DatabaseLibrary
Use standard DatabaseLibrary
MySQL
database.resource
+
DatabaseLibrary
Use standard DatabaseLibrary
SQL Server
database.resource
+
DatabaseLibrary
Use standard DatabaseLibrary
DB2
database.resource
+
DatabaseLibrary
Use standard DatabaseLibrary
Teradata
database.resource
+
DatabaseLibrary
Use standard DatabaseLibrary

数据库连接资源说明
Oracle
database.resource
+
oracledb
使用
Connect to Oracle Database
Snowflake
snowflake_keywords_databaselib.resource
使用
Connect To Snowflake Via DatabaseLibrary
PostgreSQL
database.resource
+
DatabaseLibrary
使用标准DatabaseLibrary
MySQL
database.resource
+
DatabaseLibrary
使用标准DatabaseLibrary
SQL Server
database.resource
+
DatabaseLibrary
使用标准DatabaseLibrary
DB2
database.resource
+
DatabaseLibrary
使用标准DatabaseLibrary
Teradata
database.resource
+
DatabaseLibrary
使用标准DatabaseLibrary

MANDATORY: VERIFY_DATA_README.md with File Structure

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

IMPORTANT: Every time you create data verification test cases, you MUST also create a VERIFY_DATA_README.md in the same directory with a file structure diagram.
This is required for ALL data verification test cases. No exceptions.
重要提示:每次创建数据验证测试用例时,你必须在同一目录下创建VERIFY_DATA_README.md文档,并包含文件结构树状图。
此要求适用于所有数据验证测试用例,无例外。

README Template

README模板

markdown
undefined
markdown
undefined

[Type] Data Verification Tests

[数据库类型]数据验证测试用例

This test suite verifies data in [Type] database tables after pipeline execution.
此测试套件用于验证数据管道执行后[数据库类型]数据库表中的数据。

Purpose

用途

Validates that the pipeline correctly inserted data by:
  1. Checking record counts match expected values
  2. Exporting data to CSV for detailed comparison
  3. Comparing actual output with expected baseline files
通过以下方式验证数据管道是否正确插入数据:
  1. 检查记录数是否与预期值一致
  2. 将数据导出为CSV以便进行详细对比
  3. 将实际输出与预期基准文件进行对比

Three Key Operations

三个核心操作

OperationKeywordPurpose
Verify Count
Capture And Verify Number of records From DB Table
Verify expected record count
Export Data
Export DB Table Data To CSV
Export table data to CSV file
Compare Output
Compare CSV Files With Exclusions Template
Compare actual vs expected
操作关键字用途
验证记录数
Capture And Verify Number of records From DB Table
验证预期记录数
导出数据
Export DB Table Data To CSV
将表数据导出为CSV文件
对比输出
Compare CSV Files With Exclusions Template
对比实际与预期结果

File Structure

文件结构

project-root/
├── test/
│   └── suite/
│       ├── pipeline_tests/
│       │   └── [type]/
│       │       ├── [type]_verify_data.robot                ← Test case file
│       │       └── VERIFY_DATA_README.md                   ← This file
│       └── test_data/
│           └── actual_expected_data/
│               ├── actual_output/
│               │   └── [type]/
│               │       └── actual_output.csv               ← Exported actual data
│               └── expected_output/
│                   └── [type]/
│                       └── expected_output.csv             ← Expected baseline
└── .env                                                    ← Environment configuration
project-root/
├── test/
│   └── suite/
│       ├── pipeline_tests/
│       │   └── [type]/
│       │       ├── [type]_verify_data.robot                ← 测试用例文件
│       │       └── VERIFY_DATA_README.md                   ← 此文档
│       └── test_data/
│           └── actual_expected_data/
│               ├── actual_output/
│               │   └── [type]/
│               │       └── actual_output.csv               ← 导出的实际数据
│               └── expected_output/
│                   └── [type]/
│                       └── expected_output.csv             ← 预期基准数据
└── .env                                                    ← 环境配置文件

Prerequisites

前置条件

  1. Pipeline must have been executed (triggered task completed)
  2. [Type] database connection configured in
    .env
  3. Expected output file exists in
    expected_output/[type]/
  1. 数据管道已执行(触发的任务已完成)
  2. .env
    文件中已配置[数据库类型]数据库连接信息
  3. 预期输出文件已存在于
    expected_output/[type]/
    目录下

How to Run

运行方式

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

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

---

Troubleshooting

故障排除

Common Issues

常见问题

IssueCauseSolution
Table not found
Wrong table name or schemaVerify table name includes schema
Connection failed
Database credentialsCheck
.env
configuration
Record count mismatch
Pipeline didn't completeVerify triggered task completed
CSV comparison failed
Dynamic columnsAdd columns to exclusion list
File not found
Wrong output pathCheck file path in variables
问题原因解决方案
Table not found
表名或模式错误验证表名是否包含模式
Connection failed
数据库凭证错误检查
.env
配置
Record count mismatch
数据管道未执行完成验证触发的任务是否已完成
CSV comparison failed
存在动态列将相关列添加到排除列表
File not found
输出路径错误检查变量中的文件路径

Debug Tips

调试技巧

  1. Log record count:
    robotframework
    ${count}=    Get Row Count    ${table_name}
    Log    Current record count: ${count}    console=yes
  2. Verify table exists:
    robotframework
    Table Should Exist    ${table_name}    ${schema_name}
  3. List columns to exclude:
    robotframework
    Log    Excluded columns: @{excluded_columns_for_comparison}    console=yes

  1. 记录当前记录数:
    robotframework
    ${count}=    Get Row Count    ${table_name}
    Log    当前记录数:${count}    console=yes
  2. 验证表是否存在:
    robotframework
    Table Should Exist    ${table_name}    ${schema_name}
  3. 查看排除的列:
    robotframework
    Log    排除的列:@{excluded_columns_for_comparison}    console=yes

Checklist Before Committing

提交前检查清单

  • Pipeline has been executed successfully
  • Database connection established in Suite Setup
  • Table name includes schema (e.g.,
    DEMO.TEST_TABLE
    )
  • Expected record count is correct
  • Expected output file exists and is up to date
  • Dynamic columns added to exclusion list
  • Test has appropriate tags (
    verification
    ,
    data_validation
    ,
    comparison
    )
  • VERIFY_DATA_README.md created with file structure diagram
  • 数据管道已成功执行
  • Suite Setup中已建立数据库连接
  • 表名包含模式(例如:
    DEMO.TEST_TABLE
  • 预期记录数正确
  • 预期输出文件已存在且为最新版本
  • 动态列已添加到排除列表
  • 测试用例已添加合适的标签(
    verification
    ,
    data_validation
    ,
    comparison
  • 已创建包含文件结构树状图的VERIFY_DATA_README.md