Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#578 More extensive database seeding - bulk creating members, gardens and plantings #731

Merged
merged 4 commits into from
May 20, 2015

Conversation

oshiho3
Copy link
Contributor

@oshiho3 oshiho3 commented Mar 16, 2015

Made some improvement on the database seeding process, covering some items from issue #578. Just did this as I wanted to test performance on geo related processing.

This will let you...

  • Create N number of members and
  • Populate member's location
  • Populate garden's location
  • Creates a planting from various crops, sunniness and planted_from for each user.

The default number of members is still 3, but you can specify the number of members as...
rake db:seed member_size=100
or
rake db:reset member_size=100
Tested up to 1000 worked fine.

@oshiho3 oshiho3 changed the title bulk creating members, gardens and plantings #578 More extensive database seeding - bulk creating members, gardens and plantings Mar 16, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.65% when pulling 59d823f on oshiho3:578-database-seeding-improvement into 6505254 on Growstuff:dev.

:login_name => "test#{i}",
:email => "test#{i}@example.com",
:password => "password#{i}",
:tos_agreement => true
)
@user.confirm!
@user.skip_confirmation!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking at my code. Currently when a test user is loaded, content of the confirmation email for each user opens up in a browser. However, skip_confirmation automatically confirm the user and avoid generating thousands of confirmation emails/pages. My rationale is most of the time we ignore the confirmation pages, and if someone wants to test the confirmation email content specifically, it can be tested manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find those browser windows annoying; therefore, I love you right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your endorsement :-) yes, it was annoying me too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! I suspect .skip_confirmation is new since we
started using Devise but it is a very nice thing to be able to use, and
avoid those popup windows.

On 26/03/2015 8:08 am, Shiho Takagi wrote:

In db/seeds.rb
#731 (comment):

     :login_name => "test#{i}",
     :email => "test#{i}@example.com",
     :password => "password#{i}",
     :tos_agreement => true
 )
  • @user.confirm!
  • @user.skip_confirmation!

Thanks for looking at my code. Currently when a test user is loaded,
content of the confirmation email for each user opens up in a browser.
However, |skip_confirmation| automatically confirm the user and avoid
generating thousands of confirmation emails/pages. My rationale is
most of the time we ignore the confirmation pages, and if someone
wants to test the confirmation email content specifically, it can be
tested manually.


Reply to this email directly or view it on GitHub
https://github.com/Growstuff/growstuff/pull/731/files#r27166170.

Alex "Skud" Bayley
skud@growstuff.org
http://growstuff.org/

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.69% when pulling 1fe9a7d on oshiho3:578-database-seeding-improvement into d7ef598 on Growstuff:dev.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.69% when pulling 7e7b273 on oshiho3:578-database-seeding-improvement into d7ef598 on Growstuff:dev.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.69% when pulling 7e7b273 on oshiho3:578-database-seeding-improvement into d7ef598 on Growstuff:dev.

@oshiho3 oshiho3 force-pushed the 578-database-seeding-improvement branch from 7e7b273 to d95bd0e Compare April 4, 2015 12:22
@oshiho3
Copy link
Contributor Author

oshiho3 commented Apr 4, 2015

Added sunniness and planted_from field data population on plantings.
Also made all the user confirmation email skipped as some said they also don't want to see the page popping up.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.69% when pulling d95bd0e on oshiho3:578-database-seeding-improvement into d7ef598 on Growstuff:dev.

@oshiho3
Copy link
Contributor Author

oshiho3 commented Apr 4, 2015

Added sunniness and planted_from field on planting.
Also got rid of all the user confirmation popup since some said they like the idea.

@maco maco added this to the Release 9 milestone Apr 7, 2015
@Marlena
Copy link
Contributor

Marlena commented Apr 10, 2015

This will help move work forward on the pull request for sunniness and planting charts. Hope we can merge this one in soon.

@maco
Copy link
Member

maco commented Apr 10, 2015 via email

@Marlena
Copy link
Contributor

Marlena commented Apr 10, 2015

That's cool. I can see that there is a large queue. Working on pulling in the branch and just using that for now.

@Skud
Copy link
Contributor

Skud commented May 20, 2015

This looks great and I'm going to merge it :) I would support the idea of automatically creating 20 or so test users, as a default case, fwiw.

Skud added a commit that referenced this pull request May 20, 2015
#578 More extensive database seeding - bulk creating members, gardens and plantings
@Skud Skud merged commit 66402e5 into Growstuff:dev May 20, 2015
@oshiho3
Copy link
Contributor Author

oshiho3 commented May 21, 2015

Welcome back, @Skud! Yup, increasing the number of default users sounds good. I think I'll implement it in the next iteration along with other improvements in database seeding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants