I’ve just updated my celerity gem and it seems to fix all of the warnings that were flooding my scripts before.
Performance is still a touch disappointing with our website, but the changes make it much more usable (and there’s an option to turn javascript off now according to the docs at http://rubyforge.org/forum/forum.php?forum_id=34490).
After moving my hosting, the basic content is back online, minus the last two posts. Sorry for the interruption!
After repeated issues trying to get what I thought would be a simple ‘If controller’ working in JMeter, it looks like my issue is to do with the poor examples on the JMeter site. Or else something is making my version and or/installation behave differently.
While the example provided on the JMeter site would have led me to use “${valid_data}”==”Y” as the Condition, with the ‘Interpret Condition as Variable Expression’ field unchecked, doing so was causing a silent failure.
After checking the log files, I could see this error:
“jmeter.control.IfController: missing ; before statement ”
After following some diagnostic advice that failed to work (the log function just seemed to repeatedly spit out my condition as a string, not evaluate it), and randomly experimenting with combinations, I still hadn’t managed to make it work as the log function was also seemingly not passing back the return value. So I removed it and then discovered that I’d somehow managed to make it work. The solution was to add a semicolon at the end:
“${valid_data}”==”Y”;
That was all it took. All good. Hope this helps someone.
When I’m running tests and tools, I frequently want to know how far through I am. I’d built a class to help with this a while back, but Corey Goldberg’s recent post on a python version prompted me to post this Ruby version.
First, you’ll need to save this to progress_bar.rb:
class Progress_bar
attr_accessor :items_to_do, :items_done
def initialize(items_to_do, items_done=0)
reset(items_to_do, items_done)
end
def percent_complete
return (@items_complete*1.0/@items_to_do*1.0)*100
end
def advance(steps_to_advance=1)
@items_complete+=steps_to_advance
end
def reset(items_to_do, items_done=0)
@items_to_do=items_to_do
@items_complete=items_done
end
def report
$stderr.print "\r#{progress_bar} #{@items_complete} of #{@items_to_do} done"
end
def progress_bar
complete_bar=(percent_complete/2.0).floor
incomplete_bar=((100-percent_complete)/2.0).ceil
return "[#{"*"*complete_bar}#{"-"*incomplete_bar}]"
end
end
You can then mix this in to so that when you iterate through collections, you can report on your progress. Handy for data-driven tests:
require 'progress_bar.rb'
module Enumerable
def each_with_progress
progress=Progress_bar.new(self.size)
self.each do |item |
progress.advance
yield item
progress.report
end
end
end
# Examples:
b={1=>"a",2=>"b"}
puts "Iterating through hash"
b.each_with_progress do | val |
# do stuff
sleep 2
end
puts
puts "Iterating through array"
c=[1,2,3,4]
c.each_with_progress do | val |
# do stuff
sleep 2
end
puts "Manual control..."
pb=Progress_bar.new(40,20)
5.times do
pb.advance
pb.report
sleep 1
end
5.times do
pb.advance(2)
sleep 1
pb.report
end
If you run from the command line, your output will look something like this:
[*******************************************-------] 35 of 40 done
This should all appear on a single line, although anything sent to standard output will force this to go to a new line. I never managed to get ANSI terminal display libraries working.
Enjoy!
Presstimate:
The number you give to get a manager off your back when you’re being hassled to give an estimate; Your best guess of what estimate of effort management will accept, not how long the work will actually take.
I knew the market wasn’t quite what it was, but this job ad today surprised even me.
Â
ANZTB (http://www.anztb.org/) are hosting a free half day workshop with Rex Black on Risk-based testing. The workshop is on December 8th in Sydney and December 9th in Melbourne. Contact Karen Haig at info@anztb.org if you’re interested in attending. As of this morning there were 17 places left for Melbourne.
I’ve had past conversations with others on the topic of intellectual property rights of employees in Australia, and had always been under the belief that pretty much anything I did in a creative capacity would belong to my employer. Today I was pointed to this article, which suggests that’s not really the case.
Of course, for simplicity and to avoid any legal action, most people will still take care to separate their entrepreneurial activities as much as possible from their work. Colleagues frequently leave their current role to go off and fully develop something they’ve been working on secretly.
So if you’re interested, this article has a good discussion of the state of play for employees, employers and their IP rights -Â
http://www.findlawaustralia.com.au/articles/default.asp?task=read&id=16492&site=CN
Things should resume soon. I’m touring the Korean countryside and should be back at work mid-November. Until then, expect this site to be quiet. You can follow updates at http://www.twitter.com/xflibbleinkorea/, or http://www.quinert.com/korea/
When filling out my tax return this year, I was pleased to see that finally, I am no longer ‘IT Analyst – Other’.
I am now a Software Tester!
About time.