Skip to content

Commit a5ff711

Browse files
committed
Changed line endings to unix
1 parent e75bd0b commit a5ff711

File tree

1 file changed

+103
-103
lines changed

1 file changed

+103
-103
lines changed

RUNNING_UNIT_TESTS.md

Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,104 @@
1-
2-
# How To Run The Test!
3-
4-
This process is much easier than it has been before!
5-
6-
7-
## TL;DR
8-
9-
Default testing uses DBLIB with TinyTDS.
10-
11-
* Setup two databases in SQL Server, [activerecord_unittest] and [activerecord_unittest2]
12-
* Create a [rails] user with an empty password and give it a [db_owner] role to both DBs. Some tests require a server role of [sysadmin] too.
13-
- http://twitpic.com/9bsiyp/full
14-
- http://twitpic.com/9bsj7z/full
15-
- http://twitpic.com/9bsjdx/full
16-
- http://twitpic.com/9bsjl7/full
17-
* $ git clone git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git
18-
* $ bundle install
19-
* $ bundle exec rake test ACTIVERECORD_UNITTEST_HOST='my.db.net'
20-
21-
22-
## Creating the test databases
23-
24-
The default names for the test databases are `activerecord_unittest` and `activerecord_unittest2`. If you want to use another database name then be sure to update the connection file that matches your connection method in test/connections/native_sqlserver_#{connection_method}/connection.rb. Define a user named 'rails' in SQL Server with all privileges granted for the test databases. Use an empty password for said user.
25-
26-
The connection files make certain assumptions. For instance, the ODBC connection assumes you have a DSN setup that matches the name of the default database names. Remember too you have to set an environment variable for the DSN of the adapter, see the connection.rb file that matches your connection mode for details.
27-
28-
29-
## Cloning The Repos
30-
31-
Clone adapter git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git. The master branch is the one under development for Rails 3, track the repos 2-3-stable branch for 2.x development.
32-
33-
The tests of this adapter depend on the existence of the Rails which under the 3.1 version and above is automatically cloned for you with bundler. However you can clone Rails from git://github.com/rails/rails.git and set the `RAILS_SOURCE` environment variable so bundler will use another local path instead.
34-
35-
```
36-
$ git clone git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git
37-
```
38-
39-
Optionally, you an just let bundler do all the work and assuming there is a git tag for the Rails version, you can set `RAILS_VERSION` before bundling.
40-
41-
```
42-
$ export RAILS_VERSION='3.2.13'
43-
$ bundle install
44-
```
45-
46-
47-
## Configure DB Connection
48-
49-
Please consult the `test/config.yml` file which is used to parse the configuration options for the DB connections when running tests. This file has overrides for any connection mode that you can set using simple environment variables. Assuming you are using FreeTDS 0.91 and above
50-
51-
```
52-
$ export ACTIVERECORD_UNITTEST_HOST='my.db.net' # Defaults to localhost
53-
$ export ACTIVERECORD_UNITTEST_PORT='1533' # Defaults to 1433
54-
```
55-
56-
If you have FreeTDS installed and/or want to use a named dataserver in your freetds.conf file
57-
58-
```
59-
$ export ACTIVERECORD_UNITTEST_DATASERVER='mydbname'
60-
```
61-
62-
These can be passed down to rake too.
63-
64-
```
65-
$ bundle exec rake test ACTIVERECORD_UNITTEST_HOST='my.db.net'
66-
```
67-
68-
69-
## Bundling
70-
71-
Now with that out of the way you can run "bundle install" to hook everything up. Our tests use bundler to setup the load paths correctly. The default mode is DBLIB using TinyTDS. It is important to use bundle exec so we can wire up the ActiveRecord test libs correctly.
72-
73-
```
74-
$ bundle exec rake test
75-
```
76-
77-
78-
## Testing Options
79-
80-
The Gemfile contains groups for `:tinytds` and `:odbc`. By default it will install both gems which allows you to run the full test suite in either connection mode. If for some reason any one of these is problematic or of no concern, you could always opt out of bundling either gem with something like this.
81-
82-
```
83-
$ bundle install --without odbc
84-
```
85-
86-
You can run different connection modes using the following rake commands. Again, the DBLIB connection mode using TinyTDS is the default test task.
87-
88-
```
89-
$ bundle exec rake test:dblib
90-
$ bundle exec rake test:odbc
91-
```
92-
93-
By default, Bundler will download the Rails git repo and use the git tag that matches the dependency version in our gemspec. If you want to test another version of Rails, you can either temporarily change the :tag for Rails in the Gemfile. Likewise, you can clone the Rails repo your self to another directory and use the `RAILS_SOURCE` environment variable.
94-
95-
96-
## Current Expected Failures
97-
98-
* Misc Date/Time erros when using ODBC mode.
99-
* Misc Date/Time erros when testing SQL Server 2005.
100-
* A find with Limit, Order, and Includes may return fewer results than the limit specifies
101-
102-
FinderTest#test_coerced_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct [/Users/acarey/code/nextgear/sqlserver/annaswims/activerecord-sqlserver-adapter/test/cases/finder_test_sqlserver.rb:28]:
103-
Expected: 2
1+
2+
# How To Run The Test!
3+
4+
This process is much easier than it has been before!
5+
6+
7+
## TL;DR
8+
9+
Default testing uses DBLIB with TinyTDS.
10+
11+
* Setup two databases in SQL Server, [activerecord_unittest] and [activerecord_unittest2]
12+
* Create a [rails] user with an empty password and give it a [db_owner] role to both DBs. Some tests require a server role of [sysadmin] too.
13+
- http://twitpic.com/9bsiyp/full
14+
- http://twitpic.com/9bsj7z/full
15+
- http://twitpic.com/9bsjdx/full
16+
- http://twitpic.com/9bsjl7/full
17+
* $ git clone git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git
18+
* $ bundle install
19+
* $ bundle exec rake test ACTIVERECORD_UNITTEST_HOST='my.db.net'
20+
21+
22+
## Creating the test databases
23+
24+
The default names for the test databases are `activerecord_unittest` and `activerecord_unittest2`. If you want to use another database name then be sure to update the connection file that matches your connection method in test/connections/native_sqlserver_#{connection_method}/connection.rb. Define a user named 'rails' in SQL Server with all privileges granted for the test databases. Use an empty password for said user.
25+
26+
The connection files make certain assumptions. For instance, the ODBC connection assumes you have a DSN setup that matches the name of the default database names. Remember too you have to set an environment variable for the DSN of the adapter, see the connection.rb file that matches your connection mode for details.
27+
28+
29+
## Cloning The Repos
30+
31+
Clone adapter git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git. The master branch is the one under development for Rails 3, track the repos 2-3-stable branch for 2.x development.
32+
33+
The tests of this adapter depend on the existence of the Rails which under the 3.1 version and above is automatically cloned for you with bundler. However you can clone Rails from git://github.com/rails/rails.git and set the `RAILS_SOURCE` environment variable so bundler will use another local path instead.
34+
35+
```
36+
$ git clone git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git
37+
```
38+
39+
Optionally, you an just let bundler do all the work and assuming there is a git tag for the Rails version, you can set `RAILS_VERSION` before bundling.
40+
41+
```
42+
$ export RAILS_VERSION='3.2.13'
43+
$ bundle install
44+
```
45+
46+
47+
## Configure DB Connection
48+
49+
Please consult the `test/config.yml` file which is used to parse the configuration options for the DB connections when running tests. This file has overrides for any connection mode that you can set using simple environment variables. Assuming you are using FreeTDS 0.91 and above
50+
51+
```
52+
$ export ACTIVERECORD_UNITTEST_HOST='my.db.net' # Defaults to localhost
53+
$ export ACTIVERECORD_UNITTEST_PORT='1533' # Defaults to 1433
54+
```
55+
56+
If you have FreeTDS installed and/or want to use a named dataserver in your freetds.conf file
57+
58+
```
59+
$ export ACTIVERECORD_UNITTEST_DATASERVER='mydbname'
60+
```
61+
62+
These can be passed down to rake too.
63+
64+
```
65+
$ bundle exec rake test ACTIVERECORD_UNITTEST_HOST='my.db.net'
66+
```
67+
68+
69+
## Bundling
70+
71+
Now with that out of the way you can run "bundle install" to hook everything up. Our tests use bundler to setup the load paths correctly. The default mode is DBLIB using TinyTDS. It is important to use bundle exec so we can wire up the ActiveRecord test libs correctly.
72+
73+
```
74+
$ bundle exec rake test
75+
```
76+
77+
78+
## Testing Options
79+
80+
The Gemfile contains groups for `:tinytds` and `:odbc`. By default it will install both gems which allows you to run the full test suite in either connection mode. If for some reason any one of these is problematic or of no concern, you could always opt out of bundling either gem with something like this.
81+
82+
```
83+
$ bundle install --without odbc
84+
```
85+
86+
You can run different connection modes using the following rake commands. Again, the DBLIB connection mode using TinyTDS is the default test task.
87+
88+
```
89+
$ bundle exec rake test:dblib
90+
$ bundle exec rake test:odbc
91+
```
92+
93+
By default, Bundler will download the Rails git repo and use the git tag that matches the dependency version in our gemspec. If you want to test another version of Rails, you can either temporarily change the :tag for Rails in the Gemfile. Likewise, you can clone the Rails repo your self to another directory and use the `RAILS_SOURCE` environment variable.
94+
95+
96+
## Current Expected Failures
97+
98+
* Misc Date/Time erros when using ODBC mode.
99+
* Misc Date/Time erros when testing SQL Server 2005.
100+
* A find with Limit, Order, and Includes may return fewer results than the limit specifies
101+
102+
FinderTest#test_coerced_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct [/Users/acarey/code/nextgear/sqlserver/annaswims/activerecord-sqlserver-adapter/test/cases/finder_test_sqlserver.rb:28]:
103+
Expected: 2
104104
Actual: 1

0 commit comments

Comments
 (0)