# Tables for testing an import: a CSV or Excel upload, a bulk import screen, a
# data pipeline that reads files.
#
#   tfg generate spreadsheet-import.yaml
#
# The files and manifest.json land in ./spreadsheet-import. Every file here is
# a well formed table. The ones marked accept are what most tools export, and
# an importer should take them. The others are shapes and sizes an importer may
# refuse on purpose, so they say unspecified: set them to what your importer
# does. The two at the end are broken on purpose.

version: 1
seed: 303

targets:
  # The same table written the ways real tools export it.
  - id: comma_lf
    format: csv
    size: 50kb
    name: comma_lf.csv
    expected: accept
  - id: comma_crlf
    format: csv
    size: 50kb
    name: comma_crlf.csv
    properties:
      line_ending: crlf
    expected: accept
  - id: semicolon
    format: csv
    size: 50kb
    name: semicolon.csv
    properties:
      delimiter: semicolon
    expected:
      outcome: unspecified
      reason: none
  - id: tab
    format: csv
    size: 50kb
    name: tab_separated.csv
    properties:
      delimiter: tab
    expected:
      outcome: unspecified
      reason: none
  - id: no_header
    format: csv
    size: 50kb
    name: no_header.csv
    properties:
      header: false
    expected:
      outcome: unspecified
      reason: none
  - id: every_field_quoted
    format: csv
    size: 50kb
    name: every_field_quoted.csv
    properties:
      quote_style: all
    expected: accept

  # Shapes an importer meets less often: a wide table and a large one.
  - id: wide
    format: csv
    size: 500kb
    name: wide_200_columns.csv
    properties:
      columns: 200
    expected:
      outcome: unspecified
      reason: count_limit
  - id: large
    format: csv
    size: 20mb
    name: large.csv
    expected:
      outcome: unspecified
      reason: size_limit

  # Excel files: a small sheet, a long one and a single cell.
  - id: sheet
    format: xlsx
    size: 2mb
    name: sheet.xlsx
    properties:
      rows: 1000
      columns: 10
    expected: accept
  - id: long_sheet
    format: xlsx
    size: 12mb
    name: long_sheet.xlsx
    properties:
      rows: 10000
      columns: 6
    expected:
      outcome: unspecified
      reason: count_limit
  - id: one_cell
    format: xlsx
    size: 8kb
    name: one_cell.xlsx
    properties:
      rows: 1
      columns: 1
    expected: accept

  # Broken on purpose: an Excel file cut short, and an empty file named as a
  # CSV.
  - id: truncated_xlsx
    format: xlsx
    size: 200kb
    name: truncated.xlsx
    damage:
      - truncate
    expected:
      outcome: reject
      reason: content_malformed
  - id: empty_csv
    format: txt
    size: 0
    name: empty.csv
    expected:
      outcome: reject
      reason: size_zero

output:
  dir: ./spreadsheet-import
