InnoZ / MAS_Interface

Apache License 2.0
1 stars 0 forks source link

fix specs #80

Open 00Bock opened 6 years ago

00Bock commented 6 years ago

specs are currently failing. any clues why?

bbock@InnoZinOz:~/Repositories/MAS_Interface$ rake
/home/bbock/.rubies/ruby-2.3.1/bin/ruby -I/home/bbock/.gem/ruby/2.3.1/gems/rspec-core-3.5.4/lib:/home/bbock/.gem/ruby/2.3.1/gems/rspec-support-3.5.0/lib /home/bbock/.gem/ruby/2.3.1/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
You're running an old version of PhantomJS, update to >= 2.1.1 for a better experience.
.F...FF.......FF*DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This
still causes `String`s to be parsed as if they were in `Time.zone`,
and `Time`s to be converted to `Time.zone`.

To keep the old behavior, you must add the following to your initializer:

    config.active_record.time_zone_aware_types = [:datetime]

To silence this deprecation warning, add the following:

    config.active_record.time_zone_aware_types = [:datetime, :time]
 (called from plans at /home/bbock/Repositories/MAS_Interface/app/models/scenario.rb:118)
DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This
still causes `String`s to be parsed as if they were in `Time.zone`,
and `Time`s to be converted to `Time.zone`.

To keep the old behavior, you must add the following to your initializer:

    config.active_record.time_zone_aware_types = [:datetime]

To silence this deprecation warning, add the following:

    config.active_record.time_zone_aware_types = [:datetime, :time]
 (called from plans at /home/bbock/Repositories/MAS_Interface/app/models/scenario.rb:118)
.........

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Plan add some examples to (or delete) /home/bbock/Repositories/MAS_Interface/spec/models/plan_spec.rb
     # Not yet implemented
     # ./spec/models/plan_spec.rb:4

Failures:

  1) Create Scenario is accessable with login
     Failure/Error: visit root_path

     Capybara::Poltergeist::StatusFailError:
       Request to 'http://127.0.0.1:34413/' failed to reach server, check DNS and/or server status
     # /home/bbock/.gem/ruby/2.3.1/gems/poltergeist-1.14.0/lib/capybara/poltergeist/browser.rb:376:in `command'
     # /home/bbock/.gem/ruby/2.3.1/gems/poltergeist-1.14.0/lib/capybara/poltergeist/browser.rb:35:in `visit'
     # /home/bbock/.gem/ruby/2.3.1/gems/poltergeist-1.14.0/lib/capybara/poltergeist/driver.rb:97:in `visit'
     # /home/bbock/.gem/ruby/2.3.1/gems/capybara-2.12.1/lib/capybara/session.rb:252:in `visit'
     # /home/bbock/.gem/ruby/2.3.1/gems/capybara-2.12.1/lib/capybara/dsl.rb:52:in `block (2 levels) in <module:DSL>'
     # ./spec/rails_helper.rb:85:in `login'
     # ./spec/features/create_scenario_spec.rb:9:in `block (2 levels) in <top (required)>'

  2) Scenario Explorer click on district with scenario
     Failure/Error:
       def initialize(district_id, year, name, folder = OUTPUT_PATH, rails_env = Rails.env)
         @district_id = district_id
         @year = year
         @name = name
         @folder = folder
         @rails_env = rails_env
         raise "#{year} must be between 2017 and 2040" unless year_range.include?(year)
         run_matsim
         calculate_stats
         add_scenario_name

     ArgumentError:
       wrong number of arguments (given 2, expected 3..5)
     # ./app/models/matsim_starter.rb:6:in `initialize'
     # ./spec/features/scenario_explorer_spec.rb:6:in `new'
     # ./spec/features/scenario_explorer_spec.rb:6:in `block (2 levels) in <top (required)>'

  3) Scenario Explorer click on district without scenario
     Failure/Error:
       def initialize(district_id, year, name, folder = OUTPUT_PATH, rails_env = Rails.env)
         @district_id = district_id
         @year = year
         @name = name
         @folder = folder
         @rails_env = rails_env
         raise "#{year} must be between 2017 and 2040" unless year_range.include?(year)
         run_matsim
         calculate_stats
         add_scenario_name

     ArgumentError:
       wrong number of arguments (given 2, expected 3..5)
     # ./app/models/matsim_starter.rb:6:in `initialize'
     # ./spec/features/scenario_explorer_spec.rb:6:in `new'
     # ./spec/features/scenario_explorer_spec.rb:6:in `block (2 levels) in <top (required)>'

  4) MatsimStarter creates a scenario
     Failure/Error:
       def initialize(district_id, year, name, folder = OUTPUT_PATH, rails_env = Rails.env)
         @district_id = district_id
         @year = year
         @name = name
         @folder = folder
         @rails_env = rails_env
         raise "#{year} must be between 2017 and 2040" unless year_range.include?(year)
         run_matsim
         calculate_stats
         add_scenario_name

     ArgumentError:
       wrong number of arguments (given 2, expected 3..5)
     # ./app/models/matsim_starter.rb:6:in `initialize'
     # ./spec/models/matsim_starter_spec.rb:12:in `new'
     # ./spec/models/matsim_starter_spec.rb:12:in `block (2 levels) in <top (required)>'

  5) MatsimStarter raises runtime error if matsim does not create scenario
     Failure/Error: expect { described_class.new(nil, 2017) }.to raise_error(RuntimeError, error)

       expected RuntimeError with "Matsim scenario creation not completed. User 'matsim' existing? Look into matsim logfiles for more information.", got #<ArgumentError: wrong number of arguments (given 2, expected 3..5)> with backtrace:
         # ./app/models/matsim_starter.rb:6:in `initialize'
         # ./spec/models/matsim_starter_spec.rb:19:in `new'
         # ./spec/models/matsim_starter_spec.rb:19:in `block (3 levels) in <top (required)>'
         # ./spec/models/matsim_starter_spec.rb:19:in `block (2 levels) in <top (required)>'
     # ./spec/models/matsim_starter_spec.rb:19:in `block (2 levels) in <top (required)>'

Finished in 51.68 seconds (files took 3.01 seconds to load)
26 examples, 5 failures, 1 pending

Failed examples:

rspec ./spec/features/create_scenario_spec.rb:8 # Create Scenario is accessable with login
rspec ./spec/features/scenario_explorer_spec.rb:12 # Scenario Explorer click on district with scenario
rspec ./spec/features/scenario_explorer_spec.rb:18 # Scenario Explorer click on district without scenario
rspec ./spec/models/matsim_starter_spec.rb:9 # MatsimStarter creates a scenario
rspec ./spec/models/matsim_starter_spec.rb:17 # MatsimStarter raises runtime error if matsim does not create scenario

/home/bbock/.rubies/ruby-2.3.1/bin/ruby -I/home/bbock/.gem/ruby/2.3.1/gems/rspec-core-3.5.4/lib:/home/bbock/.gem/ruby/2.3.1/gems/rspec-support-3.5.0/lib /home/bbock/.gem/ruby/2.3.1/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
bbock@InnoZinOz:~/Repositories/MAS_Interface$ 
00Bock commented 6 years ago

can anyone @BenSto @kjoscha help?

BenSto commented 6 years ago

To me it seems the specs are generally broken. Because one Error says we initialize a class in the specs with 2 arguments but it needs 3..5 now. So I think the specs will need some effort to be correct again...

BenSto commented 6 years ago

It is also missing in the docs that there is now a DB user 'matsim' needed.