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

Add users with deterministic username and password to development seed. #7211

Merged
merged 1 commit into from Sep 3, 2014

Conversation

5 participants
@cirosantilli
Copy link
Contributor

commented Jun 26, 2014

While developing, I want to see the system from the point of view of multiple users (often one on each browser).

Like #5896, but that was declined because of the option, so no option here. Also this touches only users.

This is worth even without an option.

  • we develop much more often than we take screenshots
  • given enough faker users, the predictable ones will disappear
@TeatroIO

This comment has been minimized.

Copy link

commented Jun 26, 2014

I've prepared a stage. Click to open.

(1..5).each do |i|
begin
User.seed(:id, [{
id: i + 10,

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.

confirmed_at: DateTime.now,
password: 'asdfasdf'
}])
print '.'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

}])
print '.'
rescue ActiveRecord::RecordNotSaved
print 'F'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

(1..5).each do |i|
begin
User.seed(:id, [
{

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Use 2 spaces for indentation in an array, relative to the start of the line where the left bracket is.

confirmed_at: DateTime.now,
password: 'asdfasdf'
}])
print '.'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

}])
print '.'
rescue ActiveRecord::RecordNotSaved
print 'F'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

confirmed_at: DateTime.now,
password: 'asdfasdf'
])
print '.'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

])
print '.'
rescue ActiveRecord::RecordNotSaved
print 'F'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Jun 26, 2014

Do not write to stdout. Use Rails' logger if you want to log.

@cirosantilli

This comment has been minimized.

Copy link
Contributor Author

commented Jun 26, 2014

Shall I ignore the "do not write to stdout" warning as it is used everywhere else?

@cirosantilli cirosantilli changed the title Add users with predictable username and password Add users with deterministic username and password. Jul 9, 2014

@cirosantilli cirosantilli changed the title Add users with deterministic username and password. Add users with deterministic username and password to development seed. Jul 9, 2014

@jvanbaarsen

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2014

@cirosantilli Yeah I think that would be ok for now

@jvanbaarsen

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2014

I mark this one as ready to merge. But I think @randx has to make a final decision about what he thinks about this.

(1..5).each do |i|
begin
User.seed(:id, [
id: i + 10,

This comment has been minimized.

Copy link
@dzaporozhets

dzaporozhets Aug 13, 2014

Member

please change to i + 20.

name: "User #{i}",
email: "user#{i}@mail.com",
confirmed_at: DateTime.now,
password: 'asdfasdf'

This comment has been minimized.

Copy link
@dzaporozhets

dzaporozhets Aug 13, 2014

Member

lets use something easier. like 12345678

name: "User #{i}",
email: "user#{i}@mail.com",
confirmed_at: DateTime.now,
password: '12345678'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Aug 13, 2014

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@cirosantilli

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2014

Updated the points. Out of curiosity: why start at 20? To leave head room for more users?

@dzaporozhets

This comment has been minimized.

Copy link
Member

commented Sep 1, 2014

@cirosantilli it was my mistake. I though seed above use i + 10. But it uses just i :)

id: i + 20,
username: "user#{i}",
name: "User #{i}",
email: "user#{i}@mail.com",

This comment has been minimized.

Copy link
@dzaporozhets

dzaporozhets Sep 1, 2014

Member

I suggest we use example.com

This comment has been minimized.

Copy link
@cirosantilli

cirosantilli Sep 1, 2014

Author Contributor

Agreed.

@cirosantilli cirosantilli force-pushed the cirosantilli:predictable-user branch from 78ac22f to 327462d Sep 1, 2014

confirmed_at: DateTime.now,
password: '12345678'
])
print '.'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Sep 1, 2014

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

])
print '.'
rescue ActiveRecord::RecordNotSaved
print 'F'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Sep 1, 2014

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@cirosantilli cirosantilli force-pushed the cirosantilli:predictable-user branch from 327462d to 57fddea Sep 1, 2014

@cirosantilli

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2014

Updated.

dzaporozhets added a commit that referenced this pull request Sep 3, 2014

Merge pull request #7211 from cirosantilli/predictable-user
Add users with deterministic username and password to development seed.

@dzaporozhets dzaporozhets merged commit c1b31de into gitlabhq:master Sep 3, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build could not complete due to an error
Details
@dzaporozhets

This comment has been minimized.

Copy link
Member

commented Sep 3, 2014

@cirosantilli thank you

@cirosantilli cirosantilli deleted the cirosantilli:predictable-user branch Sep 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.