better test/unit progression display

G

Gaspard Bucher

Hi !

I must often run the 1300+ tests of zena and I would really like to
see some kind of progression % instead of just dots.

I have seen that there is a tk UI in test/unit but did not found a way
to use it.

Thanks for your help.


Gaspard
 
T

Trans

Hi !

I must often run the 1300+ tests of zena and I would really like to =A0
see some kind of progression % instead of just dots.

I have seen that there is a tk UI in test/unit but did not found a way = =A0
to use it.

Check out the current turn repo (ie. this version has not been
released yet)

http://github.com/TwP/turn/tree/master/lib

Run it with the --solo option and you'll see a progress bar.

Progress bar doesn't work for normal run mode yet, and it still needs
some work so the end user has better control of the output options.
But it's getting there.

T.
 
G

Gaspard Bucher

I cloned the repository and did "rake gem", "rake gem:install"

Using "require 'turn'" in the testhelp.rb file works fine. I tested =20
with/without 'turn' to see the speed hit:

I ran the 1300+ tests without run: 6m23
With run: 6m28
(In both cases, no test failure).

That's great it takes very little time and it gives a direct hint on =20
failed tests.

The --solo option to display a progress bar does not seem to work (the =20=

progress bar ... is not progressing).

Feature request ;-)

Is it possible to view a % of tests executed somewhere during the =20
PASS, FAIL listing ?

Thanks

Gaspard

Le 24 sept. 08 =E0 17:16, Trans a =E9crit :
 
T

Trans

I cloned the repository and did "rake gem", "rake gem:install"

Using "require 'turn'" in the testhelp.rb file works fine. I tested =A0
with/without 'turn' to see the speed hit:

I ran the 1300+ tests without run: 6m23
With run: 6m28
(In both cases, no test failure).

That's great it takes very little time and it gives a direct hint on =A0
failed tests.

The --solo option to display a progress bar does not seem to work (the = =A0
progress bar ... is not progressing).

Hmm... that sucks. It's working for me. It just hangs?

What system are you running? Version of Ruby? And I assume you have
Facets installed?

Is "zena" a public project? If so I could download it and try to see
what's the issue is.
Feature request ;-)

Is it possible to view a % of tests executed somewhere during the =A0
PASS, FAIL listing ?

Possibly, I'll look into it.

T.
 
G

Gaspard Bucher

Le 24 sept. 08 =E0 18:35, Trans a =E9crit :
Hmm... that sucks. It's working for me. It just hangs? I tried


What system are you running? Version of Ruby? And I assume you have
Facets installed?
It's related to zena... It works fine in irb.
pb =3D ProgressBar.new('pbtest', 100)
=3D> (ProgressBar: 0/100)
irb(main):023:0> (1..100).to_a.each do
irb(main):024:1* pb.inc
irb(main):025:1> sleep(1)
irb(main):026:1> end

works fine.
Is "zena" a public project? If so I could download it and try to see
what's the issue is.
project: http://zenadmin.org
sources: http://github.com/zena/zena

It could come from zena (the testing stuff has been largely adapted =20
from rails). I started to hack around and see if I could display the =20
ProgressBar. The problem seems to be that the run_count is 0.
I'll try to implement an option to display the ProgressBar instead of =20=

test list (once the ProgressBar works).
Possibly, I'll look into it.

T.
Gaspard
 
T

Trans

Well, I could only get so far. I get the following when running 'rake
test':

trans@logisys:zena$ rake test
(in /home/trans/programs/vendor/zena)
** zena 0.9.0 r1001 starting

** WARNING: drb server not running. Upload progress will not work.
* WARNING: you should start the drb server with 'lib/
upload_progress_server.rb start'

ImageMagick not found. Using dummy.
** zena 0.9.0 r1001 starting

** WARNING: drb server not running. Upload progress will not work.
* WARNING: you should start the drb server with 'lib/
upload_progress_server.rb start'

ImageMagick not found. Using dummy.
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/
lib/rake/rake_test_loader.rb" "test/functional/
discussion_controller_test.rb" "test/functional/
comments_controller_test.rb" "test/functional/
virtual_classes_controller_test.rb" "test/functional/
data_entries_controller_test.rb" "test/functional/
calendar_controller_test.rb" "test/functional/
version_controller_test.rb" "test/functional/
groups_controller_test.rb" "test/functional/search_controller_test.rb"
"test/functional/documents_controller_test.rb" "test/functional/
note_controller_test.rb" "test/functional/
relations_controller_test.rb" "test/functional/
session_controller_test.rb" "test/functional/
application_controller_test.rb" "test/functional/
sites_controller_test.rb" "test/functional/links_controller_test.rb"
"test/functional/users_controller_test.rb" "test/functional/
preferences_controller_test.rb" "test/functional/
iformats_controller_test.rb" "test/functional/
nodes_controller_test.rb"
** zena 0.9.0 r1001 starting

** WARNING: drb server not running. Upload progress will not work.
* WARNING: you should start the drb server with 'lib/
upload_progress_server.rb start'

ImageMagick not found. Using dummy.
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/../../
activesupport/lib/active_support/core_ext/module/aliasing.rb:31:in
`alias_method': undefined method `label' for class
`ActionView::Helpers::FormBuilder' (NameError)
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/core_ext/module/aliasing.rb:
31:in `alias_method_chain'
from /usr/lib/ruby/gems/1.8/gems/gettext-1.93.0/lib/gettext/rails.rb:
317
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/trans/programs/vendor/zena/app/controllers/application.rb:
1
... 18 levels...
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5:in `load'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5:in `each'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/
lib/rake/rake_test_loader.rb" "test/integration/navigation_test.rb"
"test/integration/multiple_hosts_test.rb" "test/integration/
multiversion_test.rb"
** zena 0.9.0 r1001 starting

** WARNING: drb server not running. Upload progress will not work.
* WARNING: you should start the drb server with 'lib/
upload_progress_server.rb start'

ImageMagick not found. Using dummy.
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/../../
activesupport/lib/active_support/core_ext/module/aliasing.rb:31:in
`alias_method': undefined method `label' for class
`ActionView::Helpers::FormBuilder' (NameError)
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/core_ext/module/aliasing.rb:
31:in `alias_method_chain'
from /usr/lib/ruby/gems/1.8/gems/gettext-1.93.0/lib/gettext/rails.rb:
317
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
from /home/trans/programs/vendor/zena/vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/trans/programs/vendor/zena/app/controllers/application.rb:
1
... 18 levels...
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5:in `load'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5:in `each'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/
rake_test_loader.rb:5
Unknown database 'zena_test'
/home/trans/programs/vendor/zena/config/environment.rb:107:in
`real_connect'
/home/trans/programs/vendor/zena/config/environment.rb:107:in
`connect'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/mysql_adapter.rb:158:in `initialize'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/mysql_adapter.rb:82:in `new'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/mysql_adapter.rb:82:in
`mysql_connection'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
262:in `send'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
262:in `connection='
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
230:in `retrieve_connection'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
78:in `connection_without_query_cache'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/query_cache.rb:76:in `query_caches'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/query_cache.rb:80:in `query_cache'
/home/trans/programs/vendor/zena/vendor/rails/activerecord/lib/
active_record/query_cache.rb:107:in `connection'
/home/trans/programs/vendor/zena/vendor/rails/railties/lib/tasks/
databases.rake:120
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
`invoke_with_call_chain'

...

T.
 
G

Gaspard Bucher

It's nice trying to test zena, but installing all the proper
dependencies is quite some work... The problem you are facing is
related to gettext. Your version is 1.93 and from the README file:

Does not work with gettext > 1.90.0 or RedCloth > 3.x

(I do not know what this issue is exactly about but I won't work on a
fix until we move to rails 2 for the 1.0 release)

Gaspard
 
G

Gaspard Bucher

I start working today and manually included the test count, the
progress bar just.. works !

I must find why the test count is '0' in zena...

My hack to display the progress bar (it still shows failed tests)
instead of the list is also working. I will cleanup and try to enable
it only through an option. I'll then post the changes to github.com/
gaspard/turn for you to see. My question is:

How do you pass options to "turn" when you use the require 'turn'
method ?

Gaspard
 
T

Trans

I start working today and manually included the test count, the =A0
progress bar just.. works !

I must find why the test count is '0' in zena...

My hack to display the progress bar (it still shows failed tests) =A0
instead of the list is also working. I will cleanup and try to enable =A0
it only through an option. I'll then post the changes to github.com/
gaspard/turn for you to see. My question is:

How do you pass options to "turn" when you use the require 'turn' =A0
method ?

Yep. That is on the "TODO" list. Not sure yet how that will pan out,
though I assume we will have to either use global var(s) or allow for
a config file.

I'll do some work on this today. If I can easily do so I want to
separate all output into a separate class that all the runners can
share.

T.
 
G

Gaspard Bucher

Did you receive my pull request from github ?

I passed options using class variables.

Gaspard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,647
Latest member
NelleMacy9

Latest Threads

Top