-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Solr #810
Solr #810
Conversation
Oops, mistyped "icedtea-7-plugin". Trying again. |
One more time with |
Making: env:
- RAILS_ENV=test line in .travis.yml instead of prefixing the command with |
It's been running 22 minutes! |
Ok, well we probably have to turn off solr for tests at least if it's going to take that long... Resources: https://github.com/collectiveidea/sunspot_test/blob/master/README.md http://www.subelsky.com/2007_10_01_archive.html?m=1 https://github.com/dcrec1/acts_as_solr_reloaded/blob/master/README.markdown |
I'm trying using |
Hmm, so by seeding the database, we seem to need to start up Solr for |
I pushed ddb14b4 which removes |
Ok I get error Taking a break! |
I assumed so because otherwise you won't have a fully working environment. There is no "testing" database, it is setup on the fly for testing. |
Hmm, I keep getting
and it says https://travis-ci.org/publiclab/plots2/builds/158977363#L2297 Any ideas here? |
Port 8981 is the test environment, as specified in |
This indicates that we might need to insert a "try" check to ensure Solr has had a chance to start up properly: http://stackoverflow.com/questions/7325885/connection-rejected-from-solr-in-rspec#7327654 It's for rspec, but we could likely add a similar "rescue" for our own tests... before :all do
`sunspot-solr start`
begin
Sunspot.remove_all!
rescue Errno::ECONNREFUSED
sleep 1 && retry
end
end |
Or perhaps we really do need to install https://github.com/collectiveidea/sunspot_test to automatically manage solr startup for tests. |
You can recreate the testing environment if you install Those are the only requirements for running the tests locally and interacting with the testing environment interactively and directly. The commands for setting up the testing environment (which creates a Debian 8 container complete with dependencies), are detailed in the You can enter the container with |
Sebastian, do you happen to know if the |
It really is returning success. It might be that Solr is not ready to respond to clients yet. A similar issue happens with Mysql, that's why I had to introduce the Another, cleaner option would be to use a "wait-for-port-to-open" script, such as this one https://github.com/vishnubob/wait-for-it |
I tried sleep 25 to no avail. These are seconds, not ms, right? |
Yup. I suggest building the container locally and experimenting directly El 10/09/16 a las 12:03, Jeffrey Warren escribió:
|
Since this is a docker container based issue, Couldn't we use an image of solr or sunspot_solr from docker hub. after this PR, solr is going to stay in the system for every build that we're making. right ? |
Well, I think solr is actually running ok now. I think it's either a timing On Sep 10, 2016 1:27 PM, "Ujitha Perera" notifications@github.com wrote:
|
Like, you could wget to the different ports and echo the response codes in On Sep 10, 2016 2:22 PM, "Jeffrey Warren" jeff@unterbahn.com wrote:
|
@ujithaperera Yes, using a prebuilt image from docker hub would be great. It would need to be defined in |
I'd do this myself, but I am running in Ubuntu on a Chromebook, and docker is not supported. @ujithaperera -- I'm going to try running:
|
Still trying different variations; i'll probably squash all these commits at some point, but this preserves a record of everything I've tried. http://stackoverflow.com/questions/9041722/solr-reports-connection-refused-when-running-import#9041769 has some tips on unresponsive solr applications, but this one was pretty interesting -- it says it can't connect to mysql, while running the solr startup command with Does this indicate that solr is not running in development, which would be required for |
Hmm, actually, why is it trying to run |
Oh, sorry, misread -- config/database.yml.example specifies mysql for both. Oops, never mind! But we only have one database set up on docker -- "plots" -- and |
Great, working on the failing tests now -- they seem pretty minor. |
OK -- @ujithaperera -- can you take a look at the currently failing tests? They seem relatively minor, and we're almost there. Please make your changes to a new branch and pull request against this one using:
Thanks!! |
Actually I was able to fix the time-based errors using ======================================================================================================================================================================
.....................E
======================================================================================================================================================================
Error: test_should_get_questions_search_and_render_template_if_question_match_found(QuestionsSearchControllerTest): ActionView::Template::Error: undefined method `len
gth' for nil:NilClass
app/views/searches/normal_search.html.erb:16:in `_app_views_searches_normal_search_html_erb__887431197_66770904'
app/controllers/questions_search_controller.rb:25:in `index'
test/functional/questions_search_controller_test.rb:12:in `block in <class:QuestionsSearchControllerTest>'
======================================================================================================================================================================
........E
======================================================================================================================================================================
Error: test_should_get_show(SearchesControllerTest): ArgumentError: wrong number of arguments (1 for 0)
app/models/search_record.rb:31:in `notes'
app/controllers/searches_controller.rb:44:in `show'
test/functional/searches_controller_test.rb:25:in `block in <class:SearchesControllerTest>'
======================================================================================================================================================================
........................................................................................... We'd /really/ like to get this merged and running, if possible. David, are you at all able to take a brief look at this? I think it's probably very simple for you as you wrote this part of the API, I believe? |
I'll take a look right now. |
Finally able to get the tests running--for some reason, I had to change the port for config/sunspot.yml to 8982 for all instances. I followed the instructions on your branch, but the port assignment was off. Getting into the real tests, now, so we can figure out that issue (or not--just not include it in the update) when/if I get a fix put together. |
Ah, hmm, for running tests I've been booting solr with "rake On Sep 19, 2016 10:36 PM, "David C Days" notifications@github.com wrote:
|
Ok--think I've figured out the problem for the question_search_controller_test.rb:
|
I'm testing a small fix now, but it looks like the problem is that the searches_controller.rb "def show" uses SearchRecord (app/models/search_record.rb), when you actually want your new class Search (app/models/search.rb). For a quick fix, I'm just adding "@search = Search.new" just under "def show", line 42. Testing that now. Heh...like I said, "search" in all its forms gets used a lot--that's why I made the RESTful api use "srch", so it could be differentiated. |
try to handle solr exceptions from the model rollback to making normal solr start process add solr installation steps to the readme add breif note about solr add sunspot_rails link remove unnessary comment remove duplicated gems add instructions for running tests with solr change search errors enable previous routing pattern fix mis-matches with new search controller remove byebug log add updated month to nodes search change numbering in filters add solr server start change commads sequence remove rails env add java and reorder installling steps remove allow-root add before install
fix broken search links change old search routes
add environment to solr start remove env icedtea-7-plugin in Dockerfile
time-based test failures fixed with Timecop; search/search_record ones remain
* Added nil? check to normal_search.html.erb; added reference to app/models/search.rb for searches_controller.rb show(): line 45 * Copied relevant functions over to app/models/search_record.rb and changed reference in SearchesController.show()
Odd, I get one more error,
|
OK - -changed line 20 of <%= node.drupal_node_revision.try(:first).body.first(350) %>... The |
chained try() methods
TESTS PASSED!!!!!! WOOOOHOOOOOOOO!!! |
OK, this is great, but when in development, I go to "advanced search" and type the name of a page and hit enter, i get a blank page showing "Required parameter missing: search". That said, the Advanced Search page already doesn't return anything on the production server, so perhaps we should move forward with this. @icarito, i'm a little worried that if the Solr server goes down, we'll see the "Connection refused" error, as apparently that'll happen any time we even load the Otherwise, all tests are passing and I'm ready to pull this in. |
Based on #781 781
rake test:all
schema.rb.example
has been updated if any database migrations were added