Source

htsql-firebird / test / input / mssql.yaml

Full commit
#
# Copyright (c) 2006-2012, Prometheus Research, LLC
# See `LICENSE` for license information, `AUTHORS` for the list of authors.
#

title: MS SQL Server regression tests
id: mssql
output: test/output/mssql.yaml
tests:

- title: Remove any existing regression databases
  id: drop-mssql
  tests:
  - connect: &connect-admin
      engine: mssql
      database: master
      username: ${MSSQL_USERNAME}
      password: ${MSSQL_PASSWORD}
      host: ${MSSQL_HOST}
      port: ${MSSQL_PORT}
    sql: |
        IF DB_ID('htsql_demo') IS NOT NULL
            DROP DATABASE [htsql_demo];
        IF SUSER_ID('htsql_demo') IS NOT NULL
            DROP LOGIN [htsql_demo];
        IF DB_ID('htsql_edge') IS NOT NULL
            DROP DATABASE [htsql_edge];
        IF SUSER_ID('htsql_edge') IS NOT NULL
            DROP LOGIN [htsql_edge];
        IF DB_ID('htsql_sandbox') IS NOT NULL
            DROP DATABASE [htsql_sandbox];
        IF SUSER_ID('htsql_sandbox') IS NOT NULL
            DROP LOGIN [htsql_sandbox];
    autocommit: true
    ignore: true

- title: Deploy the regression databases
  id: create-mssql
  tests:
  # Create the `demo` database
  - connect: *connect-admin
    sql: |
        CREATE DATABASE [htsql_demo] COLLATE Latin1_General_CI_AI;
        CREATE LOGIN [htsql_demo] WITH PASSWORD = 'secret', CHECK_POLICY = OFF;
        USE [htsql_demo];
        CREATE USER [htsql_demo] FOR LOGIN [htsql_demo];
        GRANT CONTROL TO [htsql_demo] WITH GRANT OPTION;
    autocommit: true
  - connect: &connect-demo
      engine: mssql
      database: htsql_demo
      username: htsql_demo
      password: secret
      host: ${MSSQL_HOST}
      port: ${MSSQL_PORT}
    sql-include: test/sql/demo-mssql.sql
  - db: *connect-demo
  - py-include: test/sql/demo-load.py
  # Create the `edge` database
  - connect: *connect-admin
    sql: |
        CREATE DATABASE [htsql_edge] COLLATE Latin1_General_CI_AI;
        CREATE LOGIN [htsql_edge] WITH PASSWORD = 'secret', CHECK_POLICY = OFF;
        USE [htsql_edge];
        CREATE USER [htsql_edge] FOR LOGIN [htsql_edge];
        GRANT CONTROL TO [htsql_edge] WITH GRANT OPTION;
    autocommit: true
  - connect: &connect-edge
      engine: mssql
      database: htsql_edge
      username: htsql_edge
      password: secret
      host: ${MSSQL_HOST}
      port: ${MSSQL_PORT}
    sql-include: test/sql/edge-mssql.sql
  # Create the `sandbox` database
  - connect: *connect-admin
    sql: |
        CREATE DATABASE [htsql_sandbox] COLLATE Latin1_General_CI_AI;
        CREATE LOGIN [htsql_sandbox] WITH PASSWORD = 'secret', CHECK_POLICY = OFF;
        USE [htsql_sandbox];
        CREATE USER [htsql_sandbox] FOR LOGIN [htsql_sandbox];
        GRANT CONTROL TO [htsql_sandbox] WITH GRANT OPTION;
    autocommit: true
  - connect: &connect-sandbox
      engine: mssql
      database: htsql_sandbox
      username: htsql_sandbox
      password: secret
      host: ${MSSQL_HOST}
      port: ${MSSQL_PORT}
    sql: |
        -- The `sandbox` database is populated by the tests.

- title: Run the test collection
  id: test-mssql
  tests:
  - define: mssql
  - db: *connect-sandbox
    save: sandbox
  - db: *connect-edge
    save: edge
  - db: *connect-demo
    save: demo
  # The Regression Schema
  - include: test/input/schema.yaml
  # Examples from the Tutorial
  - include: test/input/tutorial.yaml
  # Standard Data Types, Functions, and Operations
  - include: test/input/library.yaml
  # Edge Cases of HTSQL-to-SQL Translation
  - include: test/input/translation.yaml
  # Formatting Output Data
  - include: test/input/format.yaml
  # Extensions
  - include: test/input/addon.yaml
  # Error Reporting
  - include: test/input/error.yaml
  # Embedding HTSQL
  - include: test/input/embedding.yaml