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

documentation for this app's tests #8

Open
quadrophobiac opened this issue Aug 9, 2017 · 5 comments
Open

documentation for this app's tests #8

quadrophobiac opened this issue Aug 9, 2017 · 5 comments

Comments

@quadrophobiac
Copy link
Collaborator

On a fresh download and install of this application tests executed with bundle exec rake fail due to database "bothan_deploy_test" does not exist.
Am I missing something? There's hints that this application uses sidekiq (and also in the procfile). Is this required for the tests to run.
Not sure if its related but bundle exec rake db:migrate also fails with ActiveRecord::NoDatabaseError: FATAL: database "bothan_deploy" does not exist
@pezholio @Floppy @pikesley I don't know which of you worked on this one but could you provide me some pointers here so I can flesh out this repos README accurately?

@quadrophobiac
Copy link
Collaborator Author

quadrophobiac commented Aug 10, 2017

bundle exec rake db:create:all followed by bundle exec rake db:migrate establishes a database that can be used but the tests (bundle exec rake) still has 13 out of 14 failures.
7 of those return this error (the ones relating to DB access)

Failure/Error: bothan = Bothan.create(app_id: '34234234', token: 'my-token')
      
      ActiveRecord::StatementInvalid:
        PG::UndefinedTable: ERROR:  relation "bothans" does not exist

@quadrophobiac
Copy link
Collaborator Author

I think the tests are failing due to missing variables from local .env. The heroku instance indicates requirements of github, herokku and redis ENV variables in addition to the pusher and bothan specific variables that are part of bothan's ENV file. Would appreciate some advice on how to understand/determine which variables are required locally in order that I know how to tackle issues like this in future

@Floppy
Copy link
Contributor

Floppy commented Aug 15, 2017

only the variables available in travis (look at the build logs to see them if encrypted) are needed for tests to pass, whether locally or anywhere else. Others may be needed (from the Heroku list) for actually running in dev.

@quadrophobiac
Copy link
Collaborator Author

quadrophobiac commented Aug 15, 2017

Thanks @Floppy - nabbing those env variables has reduced failing tests to 8, all related to postgres somehow. Then running bundle exec rake db:reset fixed all but one of the remaining specs

@Floppy
Copy link
Contributor

Floppy commented Aug 15, 2017

have you run the migration with RAILS_ENV=test?

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

No branches or pull requests

2 participants