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

zip files that cause grader exceptions #23

Open
bill-auger opened this issue Jul 12, 2016 · 47 comments
Open

zip files that cause grader exceptions #23

bill-auger opened this issue Jul 12, 2016 · 47 comments

Comments

@bill-auger
Copy link
Member

bill-auger commented Jul 12, 2016

if the auto-grader is giving errors for your HW5 submission please drag and drop your zip file into a comment below

HusainJaffer, gpincheiraa, weiherj, nbartowski, siderio2 files result in this error:

Running student tests found in features/ spec/:

/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -S bundle exec cucumber  --profile default

/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -I/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/lib:/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-support-3.3.0/lib /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

nbartowski and zarak seem to have hit the perennial factory girl issue

nbartowski's file gives

  1) Movie finding movie list with same director as Star Wars should return list of movies with same director
     Failure/Error: @movie = FactoryGirl.create(:movie, :title => 'Star Wars',
     ActiveRecord::RecordNotUnique:
       SQLite3::ConstraintException: UNIQUE constraint failed: movies.id: INSERT INTO "movies" ("title", "rating", "release_date", "director", "id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)

  2) Movie finding movie list with same director as Star Wars should not return movies with a different director
     Failure/Error: @movie = FactoryGirl.create(:movie, :title => 'Star Wars',
     ActiveRecord::RecordNotUnique:
       SQLite3::ConstraintException: UNIQUE constraint failed: movies.id: INSERT INTO "movies" ("title", "rating", "release_date", "director", "id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)

zarak's file gives

FactoryGirl::DuplicateDefinitionError: Factory already registered: movie

i have not investigated any of these yet

@HunterJaffer
Copy link

HunterJaffer commented Jul 12, 2016

ARCHIVE_HIDDEN

@gpincheiraa
Copy link

gpincheiraa commented Jul 12, 2016

ARCHIVE_HIDDEN

@HunterJaffer
Copy link

@bill-auger Do you by any chance know, if anyone from 2016 has gotten 100/100 for HW5 so far?

@bill-auger
Copy link
Member Author

@HusainJaffer

i think there maybe something buggy with the grader for this assignment - i was able to get 100% but i had to do something very naughty - #24 is a discussion about it

@bill-auger
Copy link
Member Author

student weiherj archive

ARCHIVE_HIDDEN

@HunterJaffer
Copy link

@bill-auger I was thinking of maybe blocking cucumber from loading in the .rb files in features/spec directory,and I also changed the homepage path to '/movies'

@alireza-a
Copy link

alireza-a commented Jul 13, 2016

ARCHIVE_HIDDEN

@jeanwei
Copy link

jeanwei commented Jul 13, 2016

ARCHIVE_HIDDEN

@anklinuxboy
Copy link

anklinuxboy commented Jul 14, 2016

ARCHIVE_HIDDEN

My autograder output.

All rpsec tests pass and 16/17 cucumber tests pass. Don't know how to debug.
Your submission was recorded at 2016-07-14 03:46:28 +0000 : submission is on time.
Score: 0/100
There was a fatal error with your submission. It either timed out or caused an exception.

@tansaku
Copy link
Contributor

tansaku commented Jul 15, 2016

@anklinuxboy I'm seeing this error for your code when I run against the grader locally:

/Users/tansaku/Documents/GitHub/saasbook/rag/lib/graders/feature_grader/hw4_grader.rb:157:in `block (2 levels) in setup_rails_app': == 20111119180638 CreateMovies: migrating ===================================== (RuntimeError)
-- create_table(:movies)
   -> 0.0012s
== 20111119180638 CreateMovies: migrated (0.0012s) ============================

== 20120130161449 AddMoreMovies: migrating ====================================
== 20120130161449 AddMoreMovies: migrated (0.0144s) ===========================

== 20160714005819 AddDirector: migrating ======================================
-- add_column(:movies, :director, :string)
   -> 0.0006s
== 20160714005819 AddDirector: migrated (0.0006s) =============================

== 20160714010253 AddDirectorToMovie: migrating ===============================
-- add_column(:movies, :director, :string)
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in up at /Users/tansaku/Documents/GitHub/saasbook/rag/submissions/506af89a6181960fc69f47f1fbc8d708/assignment4/2016-07-15-10-57-18/db/migrate/20111119180638_create_movies.rb:10)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: duplicate column name: director: ALTER TABLE "movies" ADD "director" varchar/Users/tansaku/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'

looks like you have multiple migrations

@tansaku
Copy link
Contributor

tansaku commented Jul 15, 2016

@HusainJaffer Running locally I see this error for the your zip file:


Failures:

  1) MoviesController GET #index assigns all movies as @movies
     Failure/Error: expect(assigns(:movies)).to eq([movie])

       expected: [#<Movie id: 11, title: "Aladdin", rating: "G", description: nil, release_date: "1992-11-25 00:00:00", created_at: "2016-07-15 10:08:09", updated_at: "2016-07-15 10:08:09", director: "James mooo">]
            got: #<ActiveRecord::Relation [#<Movie id: 1, title: "Aladdin", rating: "G", description: nil, release_date: "1992-11-25 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 2, title: "The Terminator", rating: "R", description: nil, release_date: "1984-10-26 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 3, title: "When Harry Met Sally", rating: "R", description: nil, release_date: "1989-07-21 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 4, title: "The Help", rating: "PG-13", description: nil, release_date: "2011-08-10 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 5, title: "Chocolat", rating: "PG-13", description: nil, release_date: "2001-01-05 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 6, title: "Amelie", rating: "R", description: nil, release_date: "2001-04-25 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 7, title: "2001: A Space Odyssey", rating: "G", description: nil, release_date: "1968-04-06 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 8, title: "The Incredibles", rating: "PG", description: nil, release_date: "2004-11-05 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 9, title: "Raiders of the Lost Ark", rating: "PG", description: nil, release_date: "1981-06-12 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, #<Movie id: 10, title: "Chicken Run", rating: "G", description: nil, release_date: "2000-06-21 00:00:00", created_at: "2016-07-15 10:08:01", updated_at: "2016-07-15 10:08:01", director: nil>, ...]>

       (compared using ==)
...

Finished in 0.18305 seconds (files took 2.12 seconds to load)
31 examples, 1 failure

Failed examples:

rspec ./spec/controllers/movies_controller_spec.rb:36 # MoviesController GET #index assigns all movies as @movies

@tansaku
Copy link
Contributor

tansaku commented Jul 15, 2016

@HusainJaffer, @gpincheiraa, @weiherj, @alireza-a, @anklinuxboy - I'd encourage you to all re-submit - I've just updated the grader to provide more details feedback on the issues you've been encountering.

Please also do ensure that everything runs for you locally before you submit to the autograder. Looking at some of these errors it seems like they should have been showing up for you on your local machines or C9.

@gpincheiraa
Copy link

@tansaku Thanks. I was sured that my homework in my local machine works. rspec passing all the tests and cucumber scenarios too.
I don't understand why in the autograder some test are failing, but i will work in those and try again. Thanks for adding more information in the log. Now I see the problems in rspec.

@weiherj
Copy link

weiherj commented Jul 15, 2016

@tansaku Thanks. The added feedback from the autograder was very helpful. I found my issue and fixed it.

@alireza-a
Copy link

do the tests depend on a specific version of "rspec-rails" ?

@jcbc98
Copy link

jcbc98 commented Jul 16, 2016

I have a strange one that I managed to fix on my own. Here's what I saw from my first submission:

screen shot 2016-07-15 at 9 07 10 pm

By changing the failing rspec example (which was fine as-is on C9) to use 'invalid' instead of '1', it passes when run by the autograder.

BTW, my coverage report on C9 says 100%, which I did not achieve with the autograder (but I got enough credit to get full points).

If it would be useful for me to post my zip files (failing and/or not failing, with or without coverage directory) here, just let me know.

@enkanba
Copy link

enkanba commented Jul 16, 2016

I cannot submit hw5.zip

I get the following error when clicking "Check":
"Unable to deliver your submission to grader (Reason: cannot connect to server). Please try again later."

However I was able to submit it first time (I got a lot of errors although everything was passing in my c9)

@nbartowski
Copy link

nbartowski commented Jul 17, 2016

I (Norm Meyer) also had a completely successful rspec and cucumber output on cloud 9 but had failures on the grader. There also seems to be some coverage issues with the grader. I did everything in the assignment, the only uncovered area was a few lines of the MoviesController index method, which was outside of the scope of the assignment. I only received 40/100 pts. but have successfully completed all parts (or at least a much larger portion than 40%).

autograder output:


Your submission was recorded at 2016-07-17 21:05:56 +0000 : submission is on time.
Score: 40.0/100.0
----------------------------------------
Running student tests found in features/ spec/:
----BEGIN CUCUMBER----
--------------------------------------------------------------------------------
Using the default profile...
Feature: search for movies by director

  As a movie buff
  So that I can find movies with my favorite director
  I want to include and serach on director information in movies I enter

  Background: movies in database      # features/search_by_director.feature:7
    Given the following movies exist: # features/step_definitions/movie_steps.rb:3
      | title        | rating | director     | release_date |
      | Star Wars    | PG     | George Lucas | 1977-05-25   |
      | Blade Runner | PG     | Ridley Scott | 1982-06-25   |
      | Alien        | R      |              | 1979-05-25   |
      | THX-1138     | R      | George Lucas | 1971-03-11   |

  Scenario: add director to existing movie                # features/search_by_director.feature:16
    When I go to the edit page for "Alien"                # features/step_definitions/web_steps.rb:48
    And I fill in "Director" with "Ridley Scott"          # features/step_definitions/web_steps.rb:60
    And I press "Update Movie Info"                       # features/step_definitions/web_steps.rb:52
    Then the director of "Alien" should be "Ridley Scott" # features/step_definitions/movie_steps.rb:11

  Scenario: find movie with same director                       # features/search_by_director.feature:22
    Given I am on the details page for "Star Wars"              # features/step_definitions/web_steps.rb:44
    When I follow "Find Movies With Same Director"              # features/step_definitions/web_steps.rb:56
    Then I should be on the Similar Movies page for "Star Wars" # features/step_definitions/web_steps.rb:230
    And I should see "THX-1138"                                 # features/step_definitions/web_steps.rb:105
    But I should not see "Blade Runner"                         # features/step_definitions/web_steps.rb:123

  Scenario: can't find similar movies if we don't know director (sad path) # features/search_by_director.feature:29
    Given I am on the details page for "Alien"                             # features/step_definitions/web_steps.rb:44
    Then I should not see "Ridley Scott"                                   # features/step_definitions/web_steps.rb:123
    When I follow "Find Movies With Same Director"                         # features/step_definitions/web_steps.rb:56
    Then I should be on the home page                                      # features/step_definitions/web_steps.rb:230
    And I should see "'Alien' has no director info"                        # features/step_definitions/web_steps.rb:105

3 scenarios (3 passed)
17 steps (17 passed)
0m0.697s
Coverage report generated for Cucumber Features to /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/coverage. 41 / 54 LOC (75.93%) covered.
--------------------------------------------------------------------------------
----END CUCUMBER----
----BEGIN RSPEC----
--------------------------------------------------------------------------------
/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -I/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/lib:/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-support-3.3.0/lib /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
............FF

Failures:

  1) Movie finding movie list with same director as Star Wars should return list of movies with same director
     Failure/Error: @movie = FactoryGirl.create(:movie, :title => 'Star Wars',
     ActiveRecord::RecordNotUnique:
       SQLite3::ConstraintException: UNIQUE constraint failed: movies.id: INSERT INTO "movies" ("title", "rating", "release_date", "director", "id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:108:in `step'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:108:in `block in each'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:107:in `loop'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:107:in `each'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:314:in `to_a'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:314:in `block in exec_query'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:293:in `exec_query'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:76:in `exec_insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:108:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/relation.rb:64:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:524:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/counter_cache.rb:139:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/locking/optimistic.rb:75:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb:132:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:306:in `block in _create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:306:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/timestamp.rb:57:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:504:in `create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:302:in `block in create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:302:in `create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:142:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/validations.rb:43:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:291:in `block in save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:291:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/configuration.rb:14:in `block in initialize'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `[]'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `create'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:12:in `block in result'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `tap'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `result'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory.rb:42:in `run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:23:in `block in run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications.rb:166:in `instrument'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:22:in `run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
     # ./spec/models/movie_spec.rb:6:in `block (3 levels) in '

  2) Movie finding movie list with same director as Star Wars should not return movies with a different director
     Failure/Error: @movie = FactoryGirl.create(:movie, :title => 'Star Wars',
     ActiveRecord::RecordNotUnique:
       SQLite3::ConstraintException: UNIQUE constraint failed: movies.id: INSERT INTO "movies" ("title", "rating", "release_date", "director", "id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:108:in `step'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:108:in `block in each'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:107:in `loop'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/statement.rb:107:in `each'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:314:in `to_a'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:314:in `block in exec_query'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:293:in `exec_query'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:76:in `exec_insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:108:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/relation.rb:64:in `insert'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:524:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/counter_cache.rb:139:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/locking/optimistic.rb:75:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb:132:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:306:in `block in _create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:306:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/timestamp.rb:57:in `_create_record'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:504:in `create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:302:in `block in create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:302:in `create_or_update'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/persistence.rb:142:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/validations.rb:43:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:291:in `block in save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:291:in `save!'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/configuration.rb:14:in `block in initialize'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `[]'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `create'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:12:in `block in result'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `tap'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `result'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory.rb:42:in `run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:23:in `block in run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications.rb:166:in `instrument'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:22:in `run'
     # /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
     # ./spec/models/movie_spec.rb:6:in `block (3 levels) in '

Finished in 0.10245 seconds (files took 4.09 seconds to load)
14 examples, 2 failures

Failed examples:

rspec ./spec/models/movie_spec.rb:12 # Movie finding movie list with same director as Star Wars should return list of movies with same director
rspec ./spec/models/movie_spec.rb:16 # Movie finding movie list with same director as Star Wars should not return movies with a different director

Coverage report generated for Cucumber Features, RSpec to /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/coverage. 48 / 54 LOC (88.89%) covered.

/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -S bundle exec cucumber  --profile default
/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -I/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/lib:/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-support-3.3.0/lib /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

----------------------------------------

----------------------------------------
Checking coverage for:
  controllers >= 90.00%
  models >= 90.00%
----------------------------------------
  all files: 88.89%% coverage
  controllers: 88.89%% coverage
  models: 100.00%% coverage
  mailers: 100.00%% coverage
  helpers: 75.00%% coverage
  libraries: 100.00%% coverage

Failed coverage test (controllers coverage too low).
  Score: 0/20.0
----------------------------------------

----------------------------------------
Running reference Cucumber scenarios:
Disabling profiles...
Feature: search for movies by director

  As a movie buff
  So that I can find movies with my favorite director
  I want to include and serach on director information in movies I enter

  Background: movies in database      # /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/required_features/director.feature:7
    Given the following movies exist: # features/step_definitions/movie_steps.rb:3
      | title        | rating | director     | release_date |
      | Star Wars    | PG     | George Lucas | 1977-05-25   |
      | Blade Runner | PG     | Ridley Scott | 1982-06-25   |
      | Alien        | R      |              | 1979-05-25   |
      | THX-1138     | R      | George Lucas | 1971-03-11   |

  Scenario: add director to existing movie                # /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/required_features/director.feature:16
    When I go to the edit page for "Alien"                # features/step_definitions/web_steps.rb:48
    And I fill in "Director" with "Ridley Scott"          # features/step_definitions/web_steps.rb:60
    And I press "Update Movie Info"                       # features/step_definitions/web_steps.rb:52
    Then the director of "Alien" should be "Ridley Scott" # features/step_definitions/movie_steps.rb:11

  Scenario: find movie with same director                       # /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/required_features/director.feature:22
    Given I am on the details page for "Star Wars"              # features/step_definitions/web_steps.rb:44
    When I follow "Find Movies With Same Director"              # features/step_definitions/web_steps.rb:56
    Then I should be on the Similar Movies page for "Star Wars" # features/step_definitions/web_steps.rb:230
    And I should see "THX-1138"                                 # features/step_definitions/web_steps.rb:105
    But I should not see "Blade Runner"                         # features/step_definitions/web_steps.rb:123

  Scenario: can't find similar movies if we don't know director (sad path)   # /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/required_features/director.feature:29
    Given I am on the details page for "Alien"                               # features/step_definitions/web_steps.rb:44
    Then I should not see "Ridley Scott"                                     # features/step_definitions/web_steps.rb:123
    When I follow "Find Movies With Same Director"                           # features/step_definitions/web_steps.rb:56
    Then I should either be on the home page or the RottenPotatoes home page # features/step_definitions/saas_web_steps.rb:1
    And I should see "'Alien' has no director info"                          # features/step_definitions/web_steps.rb:105

3 scenarios (3 passed)
17 steps (17 passed)
0m0.603s

 *** ERROR: # *** 
Coverage report generated for Cucumber Features, RSpec to /home/ubuntu/rag/submissions/70d6935c07a665f035a2a04f50cc3c85/assignment4/2016-07-17-21-13-37/coverage. 41 / 54 LOC (75.93%) covered.
Test passed. (+0.5)
  3 out of 3 scenarios passed
  Score: 40/40
----------------------------------------
Total score: 40.0 / 100.0
Completed in 33.36257589 seconds.

ARCHIVE_HIDDEN\

@tansaku
Copy link
Contributor

tansaku commented Jul 18, 2016

@jcbc98 thanks for the additional feedback - it would be very helpful if you could post your zip file here as it's difficult to process your feedback effectively without it - many thanks in advance ...

@tansaku
Copy link
Contributor

tansaku commented Jul 18, 2016

@alireza-a - that's a good question about a dependency on a version of rspec-rails. It's possible. In this assignment you are submitting parts of an app and they are being merged into another app for the grader to operate.

@RobertStroud
Copy link
Contributor

RobertStroud commented Jul 18, 2016

I am having problems with the scenarios to sort movies alphabetically and by release date - in both cases, the output from the scenario looks like this:

  Scenario: sort movies alphabetically                 # features/sort_movies.feature:24
    When I follow "Movie Title"                        # features/step_definitions/web_steps.rb:56
    Then I should see all the movies                   # features/step_definitions/movie_steps.rb:15

      expected: 10
           got: 20

      (compared using ==)
       (RSpec::Expectations::ExpectationNotMetError)
      ./features/step_definitions/movie_steps.rb:19:in `block (2 levels) in '
      ./features/step_definitions/movie_steps.rb:17:in `/I should see all the movies/'
      features/sort_movies.feature:26:in `Then I should see all the movies'
    And I should see "Aladdin" before "The Terminator" # features/step_definitions/movie_steps.rb:23

ARCHIVE_HIDDEN

The relevant code in movie_steps.rb is:

Then /I should see all the movies/ do
  # Make sure that all the movies in the app are visible in the table
  within("tbody") do
    rows = all("tr").count
    expect(rows).to eq 10
  end
end

These tests pass without any problem when I run them locally and I don't understand why they would be failing remotely because I am supplying the view that contains the table whose rows are counted.

(Incidentally, I originally used find_all("tr"), but that requires a more recent version of Capybara - for some reason, the autograder isn't picking up the latest version)

@tansaku
Copy link
Contributor

tansaku commented Jul 18, 2016

@RobertStroud - thanks for submitting this - I've been investigating and so far cannot see why the grader does not like this. In the short term I recommend switching your step to something else like:

Then /I should see all the movies/ do
  # Make sure that all the movies in the app are visible in the table
  Movie.all.each do |m|
    expect(page).to have_content m.title
  end
end

It's not as pure an acceptance test, but I think it might work for you in this case. It's a glass box test where we are allowing ourselves privileged access to the database - not ideal for an acceptance test, but probably a reasonable step to get you out of your current fix ...

@RobertStroud
Copy link
Contributor

@tansaku - thanks. That did the trick. I'm now getting 100% for the coursework... 👍

@jcbc98
Copy link

jcbc98 commented Jul 18, 2016

My first submission:
rottenpotatoes1.zip

My final submission (includes the coverage directory):
rottenpotatoes_FINAL.zip

@zarak
Copy link

zarak commented Jul 18, 2016

@at first I was having issues with the sad path and test coverage. After trying to debug those problems, the grader is complaining about this problem. I'm not getting this error on Cloud9.

Your submission was recorded at 2016-07-18 19:23:44 +0000 : submission is on time.
Score: 0/1
rake aborted!
FactoryGirl::DuplicateDefinitionError: Factory already registered: movie
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/decorator.rb:10:in `method_missing'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/decorator/disallows_duplicates_registry.rb:6:in `register'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl.rb:70:in `block in register_factory'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl.rb:69:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl.rb:69:in `register_factory'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/syntax/default.rb:20:in `factory'
/home/ubuntu/rag/submissions/9034b1f5d11deea35ec85af6faed5085/assignment4/2016-07-18-19-31-24/spec/factories/movie.rb:2:in `block in '
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/syntax/default.rb:49:in `instance_eval'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/syntax/default.rb:49:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/syntax/default.rb:7:in `define'
/home/ubuntu/rag/submissions/9034b1f5d11deea35ec85af6faed5085/assignment4/2016-07-18-19-31-24/spec/factories/movie.rb:1:in `'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/find_definitions.rb:20:in `block (2 levels) in find_definitions'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/find_definitions.rb:19:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/find_definitions.rb:19:in `block in find_definitions'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/find_definitions.rb:15:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl-4.5.0/lib/factory_girl/find_definitions.rb:15:in `find_definitions'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/factory_girl_rails-4.6.0/lib/factory_girl_rails/railtie.rb:21:in `block in '
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:36:in `call'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application/finisher.rb:62:in `block in '
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
/home/ubuntu/rag/submissions/9034b1f5d11deea35ec85af6faed5085/assignment4/2016-07-18-19-31-24/config/environment.rb:5:in `'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:328:in `require'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:328:in `require_environment!'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:457:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

ARCHIVE_HIDDEN

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@jcbc98 @zarak thanks for this - will investigate

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@zarak have replicated locally - this might help:

http://stackoverflow.com/questions/9300231/factory-already-registered-user-factorygirlduplicatedefinitionerror

Looking at your code I see you do have your factory defined twice:

[tansaku@Samuels-MBP:~/Documents/GitHub/saasbook/rag/submissions/506af89a6181960fc69f47f1fbc8d708/assignment4/2016-07-19-10-32-57 (103_tr_count_issue)]$ 
→ more spec/factories.rb 
FactoryGirl.define do
  factory :movie do
    title "Star Wars"
    rating "PG"
    release_date { 10.years.ago }
    director "George Lucas"
  end
end
[tansaku@Samuels-MBP:~/Documents/GitHub/saasbook/rag/submissions/506af89a6181960fc69f47f1fbc8d708/assignment4/2016-07-19-10-32-57 (103_tr_count_issue)]$ 
→ more spec/factories/movie.rb
FactoryGirl.define do
  factory :movie do
    title "Star Wars"
    rating  "PG"
    director "George Lucas"
    release_date { 10.years.ago }
  end
end

not sure why that's not giving you a problem on C9, but is an issue that needs fixing ... try removing one or other of those files and re-submitting

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@enkaba are you sorted now? see this thread for help if not: https://courses.edx.org/courses/course-v1:BerkeleyX+CS169.1x+3T2015SP/discussion/forum/i4x-edx-templates-course-Empty/threads/578b1e09af36f3051300031c

@nbartowski are you still stuck? I'm just going to investigate your issue, as I think it's the last blocker outstanding on this thread ...

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@nbartowski I think this might be the issue, the grade runs an additional migration that inserts a load of movies into the database for testing:

class AddMoreMovies < ActiveRecord::Migration
  MORE_MOVIES = [
    {:title => 'Aladdin', :rating => 'G', :release_date => '25-Nov-1992'},
    {:title => 'The Terminator', :rating => 'R', :release_date => '26-Oct-1984'},
    {:title => 'When Harry Met Sally', :rating => 'R', :release_date => '21-Jul-1989'},
    {:title => 'The Help', :rating => 'PG-13', :release_date => '10-Aug-2011'},
    {:title => 'Chocolat', :rating => 'PG-13', :release_date => '5-Jan-2001'},
    {:title => 'Amelie', :rating => 'R', :release_date => '25-Apr-2001'},
    {:title => '2001: A Space Odyssey', :rating => 'G', :release_date => '6-Apr-1968'},
    {:title => 'The Incredibles', :rating => 'PG', :release_date => '5-Nov-2004'},
    {:title => 'Raiders of the Lost Ark', :rating => 'PG', :release_date => '12-Jun-1981'},
    {:title => 'Chicken Run', :rating => 'G', :release_date => '21-Jun-2000'},
  ]
  def up
    MORE_MOVIES.each do |movie|
      Movie.create!(movie)
    end
  end

  def down
    MORE_MOVIES.each do |movie|
      Movie.find_by_title_and_rating(movie[:title], movie[:rating]).destroy
    end
  end
end

It's not good practice and I can't immediately change it, but possibly this information can allow you to adjust your test to avoid colliding with it ...

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@RobertStroud I think the comment above ^^^ also explains why you saw the 20 rows rather than the 10 ...

@zarak
Copy link

zarak commented Jul 19, 2016

@tansaku Thanks very much for looking into this. I did have duplicate definitions at one point, but then I deleted them. I exhaustively searched my project directory on cloud9 for duplicate definitions using find to make sure there was nothing there. Yet somehow when creating the zip file, it included the duplicate files. I should have checked the zip file itself more closely!

@tansaku
Copy link
Contributor

tansaku commented Jul 19, 2016

@zarak - not a problem - I think the thing is that when you re-zip with the same name it doesn't delete the older files in the zip - I think that's been the source of several problems. It's probably good practice to delete old zip files, or at least delete them when there's anything odd going on :-)

@zarak
Copy link

zarak commented Jul 19, 2016

@tansaku Oh yes, that was it then. It should have tipped me off when the zip operation said updating instead of adding. I also just saw the notice regarding zip files on the grader page. Lesson learned.

@nbartowski I had the same issue with ActiveRecord collisions in the grader and was able to sort it out by following @tansaku's advice above.

@RobertStroud
Copy link
Contributor

@tansaku - thanks. I agree that this looks like the reason I saw 20 rows rather than 10 rows. But that raises the issue of how best to write the unit test if you don't know how many movies there are, or if the auto grader adds some extra movies that you don't know about.

You said that the approach you suggested earlier (iterating over the Movies object) was not pure as an acceptance test, so what would be the cleanest solution?

-----Original Message-----
From: Sam Joseph [email protected]
To: saasbook/hw-acceptance-unit-test-cycle [email protected]
CC: Robert Stroud [email protected]; Mention [email protected]
Sent: Tue, 19 Jul 2016 10:51
Subject: Re: [saasbook/hw-acceptance-unit-test-cycle] zip files that cause grader exceptions (#23)

@RobertStroud I think the comment above ^^^ also explains why you saw the 20 rows rather than the 10 ...

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@enkanba
Copy link

enkanba commented Jul 19, 2016

@tansaku Yes, thanks. It was a problem with file size.

@nbartowski
Copy link

@tansaku - thanks. Your info above helped. I had defined the :id for my FactoryGirl movie as '1'. This was in conflict because the autograder already had a movie record with id of '1'. I changed the :id = '47' and everything work. Thanks a ton for the help.

One comment, but please don't spend time replying - you've already spent significant time helping and this is not that important, this is just feedback for future offerings of the course- I lost 20 pts because my controller coverage was too low (88.89%; I think you required 90%). When I looked at my coverage, the only lines not included were a few in the index method, which I didn't write (i.e. I downloaded the class version of the homework from github). I was under the impression from the directions that we didn't need to write tests for the index method, and I didn't as this assignment ended up taking significantly more time than the previous four and I couldn't afford anymore time. So my suggestion I guess is either: lower the percentage coverage required for the controller in future offerings or include the index method in the list of additional methods to write unit tests for in the instructions. Also, it looked like you either got all 20 pts or none at all. Maybe there could be a formula for how many pts one gets, as I wrote unit tests for create, update, destroy, and the new method to find movies with the same director. I'm not worried about my score, so no need to do anything now, this is just feedback

Thanks again to you and the other TA's for all the hardwork. Overall, this was an excellent course and I learned a lot of valuable info. I'm looking forward to the next class in september!

@nbartowski
Copy link

@zarak thanks for the feedback!

@siderio2
Copy link

siderio2 commented Jul 19, 2016

ARCHIVE_HIDDEN

I have passed all tests and scenarios on C9 environment, but when I upload this file, it says that Cucumber tests run fine, but almost none of the RSpecs. Here's what the autograder says:

Your submission was recorded at 2016-07-19 17:03:54 +0000 : submission is on time.
Score: 40.0/100.0
----------------------------------------
Running student tests found in features/ spec/:
----BEGIN CUCUMBER----
--------------------------------------------------------------------------------
Using the default profile...
Feature: search for movies by director

  As a movie buff
  So that I can find movies with my favorite director
  I want to include and serach on director information in movies I enter

  Background: movies in database      # features/search_for_movies_by_director.feature:7
    Given the following movies exist: # features/step_definitions/movie_steps.rb:2
      | title        | rating | director     | release_date |
      | Star Wars    | PG     | George Lucas | 1977-05-25   |
      | Blade Runner | PG     | Ridley Scott | 1982-06-25   |
      | Alien        | R      |              | 1979-05-25   |
      | THX-1138     | R      | George Lucas | 1971-03-11   |

  Scenario: add director to existing movie                # features/search_for_movies_by_director.feature:16
    When I go to the edit page for "Alien"                # features/step_definitions/web_steps.rb:48
    And I fill in "Director" with "Ridley Scott"          # features/step_definitions/web_steps.rb:60
    And I press "Update Movie Info"                       # features/step_definitions/web_steps.rb:52
    Then the director of "Alien" should be "Ridley Scott" # features/step_definitions/movie_steps.rb:11

  Scenario: find movie with same director                       # features/search_for_movies_by_director.feature:22
    Given I am on the details page for "Star Wars"              # features/step_definitions/web_steps.rb:44
    When I follow "Find Movies With Same Director"              # features/step_definitions/web_steps.rb:56
    Then I should be on the Similar Movies page for "Star Wars" # features/step_definitions/web_steps.rb:230
    And I should see "THX-1138"                                 # features/step_definitions/web_steps.rb:105
    But I should not see "Blade Runner"                         # features/step_definitions/web_steps.rb:123

  Scenario: can't find similar movies if we don't know director (sad path) # features/search_for_movies_by_director.feature:29
    Given I am on the details page for "Alien"                             # features/step_definitions/web_steps.rb:44
    Then I should not see "Ridley Scott"                                   # features/step_definitions/web_steps.rb:123
    When I follow "Find Movies With Same Director"                         # features/step_definitions/web_steps.rb:56
    Then I should be on the home page                                      # features/step_definitions/web_steps.rb:230
    And I should see "'Alien' has no director info"                        # features/step_definitions/web_steps.rb:105

3 scenarios (3 passed)
17 steps (17 passed)
0m0.693s
Coverage report generated for Cucumber Features to /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/coverage. 43 / 56 LOC (76.79%) covered.
--------------------------------------------------------------------------------
----END CUCUMBER----
----BEGIN RSPEC----
--------------------------------------------------------------------------------
/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -I/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/lib:/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-support-3.3.0/lib /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
FFFFF.

Failures:

  1) MoviesController similar_movies the movie has director info should call the model method that searches similar movies
     Failure/Error: expect(Movie).to receive(:similar_movies).with("1").
       (Movie(id: integer, title: string, rating: string, description: text, release_date: datetime, created_at: datetime, updated_at: datetime, director: string) (class)).similar_movies("1")
           expected: 1 time with arguments: ("1")
           received: 0 times
     # ./spec/controllers/movies_controller_spec.rb:12:in `block (4 levels) in '

  2) MoviesController similar_movies the movie has director info should select the similar_movies template for rendering
     Failure/Error: expect(response).to render_template(:similar_movies)
       expecting <"similar_movies"> but rendering with <[]>
     # ./spec/controllers/movies_controller_spec.rb:19:in `block (4 levels) in '

  3) MoviesController similar_movies the movie has director info should make the similar_movies results avaliable to that template
     Failure/Error: expect(assigns(:similar_movies_arr)).to eq (@fake_results)

       expected: [#, #]
            got: nil

       (compared using ==)
     # ./spec/controllers/movies_controller_spec.rb:24:in `block (4 levels) in '

  4) MoviesController similar_movies the movie has no director info should redirect to index with messagge
     Failure/Error: expect(flash[:notice]).to eq ("'Alien' has no director info")

       expected: "'Alien' has no director info"
            got: "'Aladdin' has no director info"

       (compared using ==)
     # ./spec/controllers/movies_controller_spec.rb:32:in `block (4 levels) in '

  5) Movie similar_movies should find movies by the same director
     Failure/Error: expect(Movie.similar_movies(1)).to eq ([@movie1, @movie2])

       expected: [#, #]
            got: []

       (compared using ==)

       Diff:
       @@ -1,19 +1,2 @@
       -[#,
       - #]
       +[]
     # ./spec/models/movie_spec.rb:12:in `block (3 levels) in '

Finished in 0.14142 seconds (files took 4.25 seconds to load)
6 examples, 5 failures

Failed examples:

rspec ./spec/controllers/movies_controller_spec.rb:11 # MoviesController similar_movies the movie has director info should call the model method that searches similar movies
rspec ./spec/controllers/movies_controller_spec.rb:16 # MoviesController similar_movies the movie has director info should select the similar_movies template for rendering
rspec ./spec/controllers/movies_controller_spec.rb:21 # MoviesController similar_movies the movie has director info should make the similar_movies results avaliable to that template
rspec ./spec/controllers/movies_controller_spec.rb:28 # MoviesController similar_movies the movie has no director info should redirect to index with messagge
rspec ./spec/models/movie_spec.rb:11 # Movie similar_movies should find movies by the same director

Coverage report generated for Cucumber Features, RSpec to /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/coverage. 43 / 56 LOC (76.79%) covered.

/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -S bundle exec cucumber  --profile default
/home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -I/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/lib:/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-support-3.3.0/lib /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

----------------------------------------

----------------------------------------
Checking coverage for:
  controllers >= 90.00%
  models >= 90.00%
----------------------------------------
  all files: 76.79%% coverage
  controllers: 73.33%% coverage
  models: 100.00%% coverage
  mailers: 100.00%% coverage
  helpers: 75.00%% coverage
  libraries: 100.00%% coverage

Failed coverage test (controllers coverage too low).
  Score: 0/20.0
----------------------------------------

----------------------------------------
Running reference Cucumber scenarios:
Disabling profiles...
Feature: search for movies by director

  As a movie buff
  So that I can find movies with my favorite director
  I want to include and serach on director information in movies I enter

  Background: movies in database      # /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/required_features/director.feature:7
    Given the following movies exist: # features/step_definitions/movie_steps.rb:2
      | title        | rating | director     | release_date |
      | Star Wars    | PG     | George Lucas | 1977-05-25   |
      | Blade Runner | PG     | Ridley Scott | 1982-06-25   |
      | Alien        | R      |              | 1979-05-25   |
      | THX-1138     | R      | George Lucas | 1971-03-11   |

  Scenario: add director to existing movie                # /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/required_features/director.feature:16
    When I go to the edit page for "Alien"                # features/step_definitions/web_steps.rb:48
    And I fill in "Director" with "Ridley Scott"          # features/step_definitions/web_steps.rb:60
    And I press "Update Movie Info"                       # features/step_definitions/web_steps.rb:52
    Then the director of "Alien" should be "Ridley Scott" # features/step_definitions/movie_steps.rb:11

  Scenario: find movie with same director                       # /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/required_features/director.feature:22
    Given I am on the details page for "Star Wars"              # features/step_definitions/web_steps.rb:44
    When I follow "Find Movies With Same Director"              # features/step_definitions/web_steps.rb:56
    Then I should be on the Similar Movies page for "Star Wars" # features/step_definitions/web_steps.rb:230
    And I should see "THX-1138"                                 # features/step_definitions/web_steps.rb:105
    But I should not see "Blade Runner"                         # features/step_definitions/web_steps.rb:123

  Scenario: can't find similar movies if we don't know director (sad path)   # /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/required_features/director.feature:29
    Given I am on the details page for "Alien"                               # features/step_definitions/web_steps.rb:44
    Then I should not see "Ridley Scott"                                     # features/step_definitions/web_steps.rb:123
    When I follow "Find Movies With Same Director"                           # features/step_definitions/web_steps.rb:56
    Then I should either be on the home page or the RottenPotatoes home page # features/step_definitions/saas_web_steps.rb:1
    And I should see "'Alien' has no director info"                          # features/step_definitions/web_steps.rb:105

3 scenarios (3 passed)
17 steps (17 passed)
0m0.582s

 *** ERROR: # *** 
Coverage report generated for Cucumber Features, RSpec to /home/ubuntu/rag/submissions/a2da3b76ce1136fb99705aaad0951f61/assignment4/2016-07-19-17-11-41/coverage. 43 / 56 LOC (76.79%) covered.
Test passed. (+0.5)
  3 out of 3 scenarios passed
  Score: 40/40
----------------------------------------
Total score: 40.0 / 100.0
Completed in 34.174971325 seconds.

@tansaku
Copy link
Contributor

tansaku commented Jul 20, 2016

thanks for submitting this @siderio2 - sorry I couldn't review before the deadline - need to focus on peer reviews now I'm afraid - will try and come back to this when I can - I get the sense that this won't have prevented you from getting a certificate ...?

@siderio2
Copy link

Hello, Sam.Nope, no problem with the certificate. It's just that I want to understand what I did wrong. So when you have some time to spend on it, I would really appreciate if we can get an answer, but  doesn't mind if it's tomorrow or next week.Congrats for the great work you and your partners are doing, excelent course, really. ________________________Desiderio Martínez Silva
Desarrollador WEB
[email protected]                  +34 651093946

El Miércoles 20 de julio de 2016 15:51, Sam Joseph <[email protected]> escribió:

thanks for submitting this @siderio2 - sorry I couldn't review before the deadline - need to focus on peer reviews now I'm afraid - will try and come back to this when I can - I get the sense that this won't have prevented you from getting a certificate ...?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@efiguerc
Copy link

efiguerc commented Oct 3, 2017

Hi @bill-auger I and other 2 persons are having bundle grading issues. So could you help us please!

reference:

  1. https://courses.edx.org/courses/course-v1:BerkeleyX+CS169.1x+1T2017SP/discussion/forum/i4x-edx-templates-course-Empty/threads/59b10f5150ef220a1c00047a

Also the course page says the files should be within a 'hw5' directory and the corresponding repo readme states that the files should be within a 'rottenpotatoes' directory.
references:

  1. https://courses.edx.org/courses/course-v1:BerkeleyX+CS169.1x+1T2017SP/courseware/7ae5048e43664f2991f69feb03fda55d/18c422c6f28c4797b86765af602c71c1/
  2. https://github.com/efiguerc/hw-acceptance-unit-test-cycle

ARCHIVE_HIDDEN

@bill-auger
Copy link
Member Author

bill-auger commented Oct 3, 2017

@efiguerc -

what exactly is the error? is it like any of the others mentioned in this thread? if not then could you post the entire grader output here or in a pastbin?

regarding the folder name it should certainly be 'rottenpotatoes' as it exists in this repo - some time ago the directory was named 'hw5' - i remember writing the patch to the README then - if he courseware page says 'hw5' then it must need updating

https://github.com/saasbook/hw-acceptance-unit-test-cycle/pull/19/files

@bill-auger
Copy link
Member Author

bill-auger commented Oct 3, 2017

just FYI to anyone new with admin access here - where ever you see "ARCHIVE_HIDDEN" there is a hidden homework submission - you would need to click the pencil button to edit the comment in order to access the file - this is becuase edX does not allow posting of complete homework assignment publicly so we hide them manually in this way

@efiguerc
Copy link

efiguerc commented Oct 3, 2017

@bill-auger - This is the complete message:

Your submission was recorded at 2017-10-03 23:08:33 +0000 : submission is on time.
Score: 0/1
The latest bundler is 1.15.3, but you are currently running 1.15.1.
To update, run `gem install bundler`
rake aborted!
LoadError: cannot load such file -- sprockets/rails/task
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sprockets-rails-2.3.2/lib/sprockets/railtie.rb:82:in `require'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/sprockets-rails-2.3.2/lib/sprockets/railtie.rb:82:in `block in '
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:237:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:237:in `block in run_tasks_blocks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:245:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:245:in `each_registered_block'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:237:in `run_tasks_blocks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:451:in `block in run_tasks_blocks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/engine/railties.rb:13:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/engine/railties.rb:13:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/application.rb:451:in `run_tasks_blocks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/engine.rb:453:in `load_tasks'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
/home/ubuntu/rag/submissions/5522a22342656a7dd8965e34d077a07d/assignment4/2017-10-03-23-08-40/Rakefile:7:in `'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli.rb:360:in `exec'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli.rb:20:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/cli.rb:10:in `start'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/exe/bundle:35:in `block in '
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bundler-1.15.1/exe/bundle:27:in `'
/home/ubuntu/.rvm/gems/ruby-2.2.2/bin/bundle:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.2.2/bin/bundle:23:in `
'
/home/ubuntu/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `
'
(See full trace by running task with --trace)

@efiguerc
Copy link

efiguerc commented Oct 9, 2017

Hi @bill-auger any news on the above bundle error?

@bill-auger
Copy link
Member Author

@efiguerc -

oh sry - i am not actually signed up for the class this time - i have been a TA for this course for a long time so i knew this issue well - i still get alerts on it though and thought i would help triage but i was expecting someone else would investigate it beyond that

i just sent a message on the auto-graders channel so the admins may have a look at this

@tansaku
Copy link
Contributor

tansaku commented Oct 11, 2017

@efiguerc I was working on this issue yesterday and may have fixed it - give it another try

@saasbook saasbook deleted a comment from efiguerc Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests