-
Notifications
You must be signed in to change notification settings - Fork 855
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
Update .travis.yml #412
Update .travis.yml #412
Conversation
|
Awesome! Maybe add the badge to the README while you're at it? |
spec/models/user_spec.rb
Outdated
| @@ -6,7 +6,7 @@ | |||
| expect { User.make!(:username => "") }.to raise_error | |||
| expect { User.make!(:username => "*") }.to raise_error | |||
|
|
|||
| User.make!(:username => "test") | |||
| User.make!(:username => "test") unless User.find_by(username: 'test') | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Is this papering over a test failing to clean the database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixed a failure on two runs:
- https://travis-ci.org/lobsters/lobsters/builds/283332809?utm_source=github_status&utm_medium=notification
- https://travis-ci.org/lobsters/lobsters/builds/283330930?utm_source=github_status&utm_medium=notification
We have transnational fixtures turned on, so we should be clearing the database after each run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh... that sure looks like either test data failed to get cleaned or some general pre-test hook is creating duplicate data. There's something wrong here, this unless shouldn't exist. I'm sorry I didn't think of this before hitting merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill dig at this more locally and try to see whats causing the issue.
|
Thanks, this is great to have on PRs. |
|
Reopening so I can't forget about the |
This reverts commit bbdcb1a.
.travis.yml
Outdated
| services: | ||
| - mysql | ||
| env: | ||
| - DATABASE_URL=mysql2://root:@localhost/lobsters_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: indentation :)
|
@pushcx The issue was the seeds.rb file had a definition for the test user which was getting loaded in before the test run. |
|
Great, thank you for running that down! |
Sets up services needed for test.