bolstycjw / datatable

Datatables for rails
https://github.com/brolycjw/datatable
MIT License
4 stars 1 forks source link

Please describe how to run tests #6

Open lauer opened 6 years ago

lauer commented 6 years ago

In first try the rake test didn't work, because the requirement of running bin/rails db:migrate inside the dummy project.

$ rake test
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/archive-zip-0.7.0/lib/archive/zip/entry.rb:935: warning: assigned but unused variable - raw_data
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/archive-zip-0.7.0/lib/archive/zip/extra_field/unix.rb:137: warning: method redefined; discarding old dump_local
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/archive-zip-0.7.0/lib/archive/zip/extra_field/unix.rb:127: warning: previous definition of dump_local was here
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/delegation.rb:10: warning: `*' interpreted as argument prefix
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/decorated_association.rb:14: warning: shadowing outer local variable - context
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/delegation.rb:10: warning: method redefined; discarding old find
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/delegation.rb:10: warning: previous definition of find was here
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/collection_decorator.rb:51: warning: method redefined; discarding old context=
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/collection_decorator.rb:68: warning: method redefined; discarding old replace
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-3.0.1/lib/draper/delegation.rb:10: warning: previous definition of replace was here
Migrations are pending. To resolve this issue, run:

        bin/rails db:migrate RAILS_ENV=development
rake aborted!
Command failed with status (1)

Tasks: TOP => test
(See full trace by running task with --trace)

And then after running the db:migratesome tests still fails.

F

Failure:
DatatableIntegrationTest#test_visiting_the_index [/Users/jgl/dev/gems/datatable/test/integration/datatable_integration_test.rb:13]:
expected to find visible css "table tr td" 4 times, found 2 matches: "11 12 13 14 15 16", "* It is generally better to create a new file per style scope. * *= require bootstrap/dist/css/bootstrap *= require datatable-bs4 *= require_tree . *= require_self". Also found "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", which matched the selector but not all filters.

/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_visiting_the_index' for class `Minitest::Result' (NameError)
bolstycjw commented 6 years ago

Updated the readme with the guide to run tests, it is right at the bottom.

cd test/dummy
yarn install or npm install
bin/rails db:migrate:reset
lauer commented 6 years ago

Thanks, but there is there a test error


Error:
DatatableIntegrationTest#test_visiting_the_index:
Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : DataTables warning: table id=DataTables_Table_0 - Ajax error. For more information about this error, please see http://datatables.net/tn/7}
  (Session info: headless chrome=65.0.3325.162)
  (Driver info: chromedriver=2.37.543654 (a46b62e9900f5ac48951f8ad68d9e03eded4cc8d),platform=Mac OS X 10.13.3 x86_64)
/Users/jgl/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_visiting_the_index' for class `Minitest::Result' (NameError)

Have you considering to add Travis as CI to the repository?

bolstycjw commented 6 years ago

Did the error happen on a fresh clone? I tried the steps shown on a fresh clone and could not reproduce the error.

As for Travis, I might look into it when I have time this coming weekend.