Skip to content

Commit

Permalink
[dist,api,webui] do not use test-unit any longer, just minitest is
Browse files Browse the repository at this point in the history
way less buggy
  • Loading branch information
coolo committed Jul 14, 2012
1 parent 83b7609 commit c1cd877
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions dist/ci/obs_testsuite_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ setup_api

echo "Enter API rails root and running rcov"
cd src/api
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
cd ../..

echo "Enter WebUI rails root and running rcov"
setup_api
setup_webui

cd src/webui
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
cd ../..

cd src/webui-testsuite
Expand Down
2 changes: 1 addition & 1 deletion dist/ci/obs_testsuite_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ setup_api
cd src/api

echo "Invoke rake"
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
cd ../..

echo "Output test.log"
Expand Down
8 changes: 4 additions & 4 deletions dist/ci/obs_testsuite_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ case $SUBTEST in
api)
echo "Enter API rails root and running rcov"
cd src/api
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
;;
webui)
echo "Enter WebUI rails root and running rcov"
cd src/webui
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
;;
webui-testsuite)
cd src/webui-testsuite
Expand All @@ -38,9 +38,9 @@ case $SUBTEST in
;;
webui-gemshead)
cd src/api
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
cd ../webui
rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
;;
webui-testsuite:*)
cd src/webui-testsuite
Expand Down
2 changes: 1 addition & 1 deletion dist/ci/obs_testsuite_webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ setup_webui
cd src/webui

echo "Invoke rake"
bundle exec rake --trace ci:setup:testunit test CI_REPORTS=results || ret=1
bundle exec rake --trace ci:setup:minitest test CI_REPORTS=results || ret=1
cd ../..

echo "Contents of src/api/log/test.log:"
Expand Down
2 changes: 1 addition & 1 deletion src/api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ gem 'ci_reporter'
gem 'rdoc'
gem 'xmlhash', '>=1.2.2'
gem 'fast_xs'
gem 'test-unit', '=2.4.8'
gem 'minitest'
gem 'memcache-client', :require => false
gem 'simplecov-rcov', :require => false, :group => :test
4 changes: 2 additions & 2 deletions src/api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ GEM
treetop (~> 1.4.8)
memcache-client (1.8.5)
mime-types (1.18)
minitest (2.12.1)
multi_json (1.3.6)
mysql2 (0.3.11)
nokogiri (1.5.5)
Expand Down Expand Up @@ -91,7 +92,6 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
test-unit (2.4.8)
thor (0.15.3)
tilt (1.3.3)
treetop (1.4.10)
Expand All @@ -112,11 +112,11 @@ DEPENDENCIES
exception_notification (>= 2.3)
fast_xs
memcache-client
minitest
mysql2
nokogiri (~> 1.5.0)
rails (~> 3.2.1)
rdoc
simplecov-rcov
test-unit (= 2.4.8)
xmlhash (>= 1.2.2)
yajl-ruby
2 changes: 1 addition & 1 deletion src/api/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require(File.join(File.dirname(__FILE__), 'config', 'boot'))
#task(:updateissues => :environment) { Delayed::Job.enqueue UpdateIssuesJob.new }

begin
require 'ci/reporter/rake/test_unit'
require 'ci/reporter/rake/minitest'
rescue LoadError
puts "Please run 'rake gems:install' to install the 'ci_reporter' gem."
end
10 changes: 5 additions & 5 deletions src/api/db/migrate/20120424141421_import_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def up
end
end
reqs = []
dir.each_entry do |e|
reqs << e.value(:name).to_i if e.value(:name).to_i > 0
dir.each_entry do |entry|
reqs << entry.value(:name).to_i if entry.value(:name).to_i > 0
end if dir
reqs.sort.each do |e|
xml = backend.direct_http( URI( "/request/#{e}" ) )
reqs.sort.each do |req|
xml = backend.direct_http( URI( "/request/#{req}" ) )
r = BsRequest.new_from_xml xml
unless r.save
puts e, r.errors.full_messages.join("\n")
puts req, r.errors.full_messages.join("\n")
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
assert_xml_tag( :parent => { :tag => "action", :attributes => { :type => "submit" } }, :tag => "acceptinfo", :attributes => { :rev => "3" } )
post "/request/#{id}?cmd=diff", nil
assert_response :success
assert_match /NEW_FILE/, @response.body
assert_match %{NEW_FILE}, @response.body
post "/request/#{id}?cmd=diff&view=xml", nil
assert_response :success
assert_xml_tag( :parent => { :tag => "file", :attributes => { :state => "added" } }, :tag => "new", :attributes => { :name => "NEW_FILE" } )
Expand Down
1 change: 0 additions & 1 deletion src/webui/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ end
group :test do
gem 'ci_reporter'
gem 'simplecov-rcov', :require => false, :group => :test
gem 'test-unit', '=2.4.8'
# See test/test_helper.rb for details:
gem 'webrat', '>=0.7.3'
end
Expand Down
2 changes: 0 additions & 2 deletions src/webui/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
test-unit (2.4.8)
thor (0.15.3)
tilt (1.3.3)
treetop (1.4.10)
Expand Down Expand Up @@ -144,7 +143,6 @@ DEPENDENCIES
rdoc
simplecov-rcov
sqlite3
test-unit (= 2.4.8)
uglifier (>= 1.2.2)
webrat (>= 0.7.3)
xmlhash (>= 1.2.1)
Expand Down
2 changes: 1 addition & 1 deletion src/webui/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OBSWebUI::Application.load_tasks
require File.join(File.dirname(__FILE__), 'config', 'boot')

begin
require 'ci/reporter/rake/test_unit'
require 'ci/reporter/rake/minitest'
rescue LoadError
puts "Please run 'rake gems:install' to install the 'ci_reporter' gem."
end
Expand Down
12 changes: 8 additions & 4 deletions src/webui/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,15 @@ def mobile_request?
end
end
unless request.env.has_key? 'mobile_device_type'
mobileesp = MobileESPConverted::UserAgentInfo.new(request.user_agent, request.env['HTTP_ACCEPT'])
if mobileesp.is_tier_generic_mobile || mobileesp.is_tier_iphone || mobileesp.is_tier_rich_css || mobileesp.is_tier_tablet
request.env['mobile_device_type'] = :mobile
else
if request.user_agent.nil? || request.env['HTTP_ACCEPT'].nil?
request.env['mobile_device_type'] = :desktop
else
mobileesp = MobileESPConverted::UserAgentInfo.new(request.user_agent, request.env['HTTP_ACCEPT'])
if mobileesp.is_tier_generic_mobile || mobileesp.is_tier_iphone || mobileesp.is_tier_rich_css || mobileesp.is_tier_tablet
request.env['mobile_device_type'] = :mobile
else
request.env['mobile_device_type'] = :desktop
end
end
end
return request.env['mobile_device_type'] == :mobile
Expand Down

0 comments on commit c1cd877

Please sign in to comment.