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

Do we need to run the full test suite both with and without elasticsearch? #1035

Open
CloCkWeRX opened this issue Aug 23, 2016 · 6 comments
Open

Comments

@CloCkWeRX
Copy link
Collaborator

We do

env:
  matrix:
    - GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='true'
    - GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='false'

and

script:
- script/gemfile_check
- bundle exec script/check_contributors_md
- bundle exec rake db:migrate --trace
- bundle exec rspec spec/

But only a small amount of tests around searches rely on elasticsearch. The rest are aftercommit hooks:

  after_commit { |sn| sn.crop.__elasticsearch__.index_document if sn.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }

Should we:

  • Only run elastic search specific tests with GROWSTUFF_ELASTICSEARCH=true
  • Refactor away from after commit hooks for actions or otherwise inject the elastic search provider indepent of saving/creating. IE: Creating a Crop, Seed or Planting via a controller from a user action and indexing it makes sense; but does it make sense to index content for rspec level tests? Or does it just introduce the network into test cases?

This could shave a few minutes off builds by being more specific; as well as cut down on the number of times we have to re-run the whole suite.

@cesy
Copy link
Member

cesy commented Aug 26, 2016

This seems like a good chance to use tags and only run the tests we need to with elasticsearch, yes.

@pozorvlak
Copy link
Member

pozorvlak commented Sep 1, 2016 via email

@maco
Copy link
Member

maco commented Sep 1, 2016

👍

On Thu, Sep 1, 2016 at 1:16 PM pozorvlak [email protected] wrote:

I agree with @cesy: let's only run elasticsearch-specific tests with
elastic search on (and let's make sure there's a test for those post-commit
hooks).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1035 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYfcKRJrGFmDhp6qVOCL-b2yujZO6gyks5qlwhdgaJpZM4JrZS6
.

@CloCkWeRX
Copy link
Collaborator Author

@CloCkWeRX
Copy link
Collaborator Author

So... 5028621 may have just reduced our flakey test behaviour significantly.

@maco
Copy link
Member

maco commented Nov 29, 2016 via email

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

5 participants