apiVersion: api/v1
kind: Case
name: lighting_all_type_error_when_max_error_set
features: [ lightning ]
summary: lighting all type error when max error set
steps: |
    1. use lightning to import single table with all type errors
    2. check count of type errors
    3. check crc32
expectedResult:
    1. Import successfully
category: FUNCTIONALITY
priority: P1
supportedVersions: [ ">=5.4" ]
tags: [ "lightning", "acceptance" ]
designer: dong.xie@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command: [ "/lightningMaxError" ]
        workingDir: "/"
        env: null
        image: hub-new.pingcap.net/fubinzhang/lightning-max-error
        imagePullPolicy: "Always"
parameters:
    -   type: RESOURCE
        name: target
        default: target
    -   type: RESOURCE
        name: lightning
        default: lightning
    -   type: STRING
        name: import_basic_opts
        default: |
            {"data-dir":"s3://nfs/tools_test_data/max_error/all_type_error?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","backend":"local","sorted-kv-dir":"/tmp/sorted-kv-dir", "timeout":"20m","crc32-checksum":1860370401, "config": "[lightning]\nmax-error = 10\n[tidb]\nsql-mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE\"", "transfer-to-config": true }
    -   type: STRING
        name: drop_databases
        default: max_error
    -   type: STRING
        name: admin_check
        default: |
            [{"table": "max_error.t2", "indexes": ["uk_b"] }]
    -   type: STRING
        name: global_variable
        default: |
            []
    -   type: STRING
        name: max_error_rows
        default: '5'
    -   type: STRING
        name: max_error_schema
        default: lightning_task_info.type_error_v1
    -   type: STRING
        name: expect_error
        default: 'false'
---
apiVersion: api/v1
kind: Case
name: lighting_parallel_import_all_type_error_when_max_error_set
features: [ lightning ]
summary: lighting parallel import all type error when max error set
steps: |
    1. use 2 lightning nodes to parallelly import single table with all type errors
    2. check count of type errors
    3. check crc32
expectedResult:
    1. Import successfully
category: FUNCTIONALITY
priority: P1
supportedVersions: [ ">=5.4" ]
tags: [ "lightning", "acceptance" ]
designer: dong.xie@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command: [ "/case" ]
        workingDir: "/"
        env: null
        image: hub.pingcap.net/xiedong/lightning-parallel-import-max-error
        imagePullPolicy: "Always"
parameters:
    -   type: RESOURCE
        name: target
        default: target
    -   type: RESOURCE
        name: lightning
        default: lightning
    -   type: RESOURCE
        name: lightning2
        default: lightning2
    -   type: STRING
        name: import_basic_opts
        default: |
            {"data-dir":"s3://nfs/tools_test_data/max_error/all_type_error?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","backend":"local","sorted-kv-dir":"/tmp/sorted-kv-dir", "timeout":"20m","crc32-checksum":680474446, "config": "[tikv-importer]\nduplicate-resolution = \"remove\"\nincremental-import = true\n[lightning]\nmax-error = 10\n[tidb]\nsql-mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE\"", "transfer-to-config": true }
    -   type: STRING
        name: import_basic_opts2
        default: |
            {"data-dir":"s3://nfs/tools_test_data/max_error/all_type_error_2?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","backend":"local","sorted-kv-dir":"/tmp/sorted-kv-dir", "timeout":"20m","crc32-checksum":0, "config": "[tikv-importer]\nduplicate-resolution = \"remove\"\nincremental-import = true\n[lightning]\nmax-error = 10\n[tidb]\nsql-mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE\"", "transfer-to-config": true }
    -   type: STRING
        name: drop_databases
        default: max_error
    -   type: STRING
        name: admin_check
        default: |
            [{"table": "max_error.t2", "indexes": ["uk_b"] }]
    -   type: STRING
        name: global_variable
        default: |
            []
    -   type: STRING
        name: max_error_rows
        default: '5'
    -   type: STRING
        name: max_error_schema
        default: lightning_task_info.type_error_v1
    -   type: STRING
        name: expect_error
        default: 'false'