Skip to content

Test environment setup

Nicholas Sizer edited this page Oct 26, 2019 · 5 revisions

Roughly, the steps for setting up a test environment are:

  1. Download and install a trial version of ASE
  2. Set up a server
  • NOTE: Some tests require the server's character encoding to be configured as utf8 to pass.
    • The faults that emerge in another encoding do not seem to be significant. In particular, what differs based on server encoding is:
      1. Amount of trailing space on things like char and nchar
      2. How the server uses the specified size constraints things like char and nchar.
    • Personally, this shouldn't be an issue in the real world because:
      1. Developers will likely not care about the amount of trailing space and Trim it all themselves
      2. Schema designers should take into account how much space is required to store data, and should take into consideration how the server encoding affects this.
  1. Create a test database
  2. Enter connection details into DatabaseLoginDetails.json

The following script should suffice to set up a test database

use master
if exists (select 1 from master..sysdatabases where name = 'your_test_db')
begin
  drop database your_test_db
end

create database your_test_db
  on default = '512M'

go

use your_test_db
exec sp_configure 'number of user connections', 100
exec sp_configure 'enable unicode normalization', 0
exec sp_configure 'heap memory per user', 65535
go

We've found that tests can hang if:

  • The database's number of user connections setting is too small
  • The database's allocated size is too small
    • ASE might emit a message like the following: X task(s) are sleeping waiting for space to become available in the segment 'logsegment' for database 'your_test_db'