Creating performance test fixtures from development db? How?

Hi all!

I’m looking into the testing chapter of Agile Web D. With Rails
(2nd ed.).
I want to performance test my app, but I’m too lazy to write fixtures
for
performance test.
I’d rather use the data from my development db (because the data is so
close
to the production data).
How do I get the data into the test db without writing fixtures?

Could you please point me to an example of how to do this?

Thanks!

You want the to_fixture plugin.

http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-
reference-data

        - dan


Dan K. mailto:[email protected]
http://www.dankohn.com/ tel:+1-415-233-1000

Thanks Dan.
I’ll look into that right away. Hopefully it has support for HABTM
relations
too.

Once again, thanks for your fast answer.

/Jesper

On 7/24/06, Dan K. [email protected] wrote:

You want the to_fixture plugin.

http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data

http://justaddwater.dk/

Oh darn.
The plugin doesn’t really manage to save decent fixtures of my UTF-8
tables.
The fixtures just don’t work when running the tests afterwards. Any
ideas?

Here’s what I tried so far:

I’ve tried converting the .rb files in the plugin to UTF-8 still no
success.

Right now, I’m testing with the word “Café” (accent over the “e”), and
it
goes out in the Yaml file as: “Caf\xC3\xA9”

Error trace from my rake test below:
(where “\xC3\xB8” should have been the Danish letter “ø”, o slash )

Any thoughts on how to make it work?

Exception: a YAML error occured parsing
./config/…/test/fixtures/competences.yml.
Please note that YAML must be consistently indented using spaces. Tabs
are
not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was: ArgumentError: syntax error on line 1198, col 41:
: "eksport\xC3\xB8rregistrering" comp' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:311:inread_fixture_files’
./config/…/vendor/rails/activerecord/lib/active_record/fixtures.rb:279:in
initialize' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:251:increate_fixtures’
./config/…/vendor/rails/activerecord/lib/active_record/fixtures.rb:250:in
create_fixtures' ./config/../vendor/rails/activerecord/lib/active_record/base.rb:794:insilence’
./config/…/vendor/rails/activerecord/lib/active_record/fixtures.rb:248:in
create_fixtures' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:565:inload_fixtures’
./config/…/vendor/rails/activerecord/lib/active_record/fixtures.rb:512:in
setup_with_fixtures' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:547:insetup’
./ruby/lib/ruby/1.8/test/unit/testcase.rb:69:in run' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:inrun’
./ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in run' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:inrun’
./ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in run' ./ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:inrun_suite’
./radrails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:107:in
start_mediator' ./radrails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:52:instart’
./radrails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272

On 7/24/06, Jesper Rønn-Jensen [email protected] wrote:

On 7/24/06, Dan K. [email protected] wrote:

You want the to_fixture plugin.

http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data

http://justaddwater.dk/


Jesper Rønn-Jensen
Capgemini Danmark A/S
Oernegaardsvej 16
DK - 2820 Gentofte
Denmark

+45 23 73 62 20 (Mobile)
+45 70 11 22 01 (Fax)
www.capgemini.com (Website)
[email protected] (Corporate e-mail)
[email protected] (Private e-mail and Google Talk IM)
IM: [email protected] (MSN)
LinkedIn: http://linkedin.com/in/jesper
http://justaddwater.dk/ (weblog)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs