Jesper Rønn-Jensen
2006-Jul-24 18:45 UTC
[Rails] Creating performance test fixtures from development db? How?
Hi all! I''m looking into the testing chapter of Agile Web Development 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! -- Jesper R?nn-Jensen http://justaddwater.dk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060724/eda967ff/attachment-0001.html
Dan Kohn
2006-Jul-24 19:00 UTC
[Rails] Creating performance test fixtures from development db? How?
You want the to_fixture plugin. http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml- reference-data - dan -- Dan Kohn <mailto:dan@dankohn.com> <http://www.dankohn.com/> <tel:+1-415-233-1000> On Jul 24, 2006, at 11:45 AM, Jesper R?nn-Jensen wrote:> Hi all! > > I''m looking into the testing chapter of Agile Web Development 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! > > -- > Jesper R?nn-Jensen > http://justaddwater.dk/ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060724/adc3d25e/attachment.html
Jesper Rønn-Jensen
2006-Jul-24 19:26 UTC
[Rails] Creating performance test fixtures from development db? How?
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 Kohn <dan@dankohn.com> wrote:> > You want the to_fixture plugin. > > http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data >http://justaddwater.dk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060724/70d15d30/attachment.html
Jesper Rønn-Jensen
2006-Jul-24 20:46 UTC
[Rails] Creating performance test fixtures from development db? How?
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:in `read_fixture_files'' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:279:in `initialize'' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:251:in `create_fixtures'' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:250:in `create_fixtures'' ./config/../vendor/rails/activerecord/lib/active_record/base.rb:794:in `silence'' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:248:in `create_fixtures'' ./config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:565:in `load_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:in `setup'' ./ruby/lib/ruby/1.8/test/unit/testcase.rb:69:in `run'' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'' ./ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'' ./ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:in `run_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:in `start'' ./radrails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272 On 7/24/06, Jesper R?nn-Jensen <jesperrr@gmail.com> wrote:> > 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 Kohn <dan@dankohn.com> 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) jesper.ronn-jensen@capgemini.com (Corporate e-mail) jesperrr@gmail.com (Private e-mail and Google Talk IM) IM: jesper_ronn@hotmail.com (MSN) LinkedIn: http://linkedin.com/in/jesper http://justaddwater.dk/ (weblog) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060724/19fcc56e/attachment.html