@@ -1,46 +1,16 | |||
|
1 | Creating test repositories | |
|
2 | =================== | |
|
3 | ||
|
4 | mkdir tmp/test | |
|
5 | ||
|
6 | Subversion | |
|
7 | ---------- | |
|
8 | svnadmin create tmp/test/subversion_repository | |
|
9 | gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load tmp/test/subversion_repository | |
|
10 | ||
|
11 | CVS | |
|
12 | --- | |
|
13 | gunzip < test/fixtures/repositories/cvs_repository.tar.gz | tar -xv -C tmp/test | |
|
14 | ||
|
15 | Bazaar | |
|
16 | ------ | |
|
17 | gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test | |
|
18 | ||
|
19 | Mercurial | |
|
20 | --------- | |
|
21 | gunzip < test/fixtures/repositories/mercurial_repository.tar.gz | tar -xv -C tmp/test | |
|
22 | ||
|
23 | Git | |
|
24 | --- | |
|
25 | gunzip < test/fixtures/repositories/git_repository.tar.gz | tar -xv -C tmp/test | |
|
26 | ||
|
27 | Darcs (2.0+ required) | |
|
28 | --------------------- | |
|
29 | gunzip < test/fixtures/repositories/darcs_repository.tar.gz | tar -xv -C tmp/test | |
|
30 | ||
|
31 | FileSystem | |
|
32 | ---------- | |
|
33 | gunzip < test/fixtures/repositories/filesystem_repository.tar.gz | tar -xv -C tmp/test | |
|
34 | ||
|
35 | ||
|
36 | 1 | Running Tests |
|
37 | 2 | ============= |
|
38 | 3 | |
|
39 | Run | |
|
4 | Run `rake --tasks test` to see available tests. | |
|
5 | `rake test` will run the entire testsuite. | |
|
40 | 6 | |
|
41 | rake --tasks | grep test | |
|
42 | 7 | |
|
43 | to see available tests. | |
|
8 | Creating test repositories | |
|
9 | =================== | |
|
10 | ||
|
11 | Redmine supports a wide array of different version control systems. | |
|
12 | To test the support, a test repository needs to be created for each of those. | |
|
44 | 13 | |
|
45 | RAILS_ENV=test rake test will run tests. | |
|
14 | Run `rake --tasks test:scm:setup` for a list of available test-repositories or | |
|
15 | run `rake test:scm:setup:all` to set up all of them | |
|
46 | 16 |
@@ -1,5 +1,35 | |||
|
1 | 1 | ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake |
|
2 | 2 | |
|
3 | namespace :test do | |
|
4 | namespace :scm do | |
|
5 | namespace :setup do | |
|
6 | desc "Creates directory for test repositories" | |
|
7 | task :create_dir do | |
|
8 | FileUtils.mkdir_p Rails.root + '/tmp/test' | |
|
9 | end | |
|
10 | ||
|
11 | supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem] | |
|
12 | ||
|
13 | desc "Creates a test subversion repository" | |
|
14 | task :subversion => :create_dir do | |
|
15 | repo_path = "tmp/test/subversion_repository" | |
|
16 | system "svnadmin create #{repo_path}" | |
|
17 | system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" | |
|
18 | end | |
|
19 | ||
|
20 | (supported_scms - [:subversion]).each do |scm| | |
|
21 | desc "Creates a test #{scm} repository" | |
|
22 | task scm => :create_dir do | |
|
23 | system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" | |
|
24 | end | |
|
25 | end | |
|
26 | ||
|
27 | desc "Creates all test repositories" | |
|
28 | task :all => supported_scms | |
|
29 | end | |
|
30 | end | |
|
31 | end | |
|
32 | ||
|
3 | 33 | ### Inspired by http://blog.labratz.net/articles/2006/12/2/a-rake-task-for-rcov |
|
4 | 34 | begin |
|
5 | 35 | require 'rcov/rcovtask' |
General Comments 0
You need to be logged in to leave comments.
Login now