Newcomers' issues

Those are the issues I have faced during setup. If you have faced similar issues and have fixed please leave a comment or suggestion how to solve it.

openfoodnetwork

  • readline lib installed via homebrew. So I had to use rb-readline gem to make capybara-screenshot work inside integrations tests. But seems that brew install with-readline did the trick.
  • wkhtmltopdf-binary gem is out of date and fails in test and dev environemts for generating pdfs.
  • Sometimes failing time sensitive integration tests if application.yml has Australian timezone and local machine’s headless browser has i.e. UTC timezone. 9 hours difference moves up to next day and search filters fail.
  • From https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma by all istructions karma binary goes into ./node_modules/.bin/karma. npm install -g doesn’t install all dependencies globaly.
  • During /checkout I get undefined method 'tags_list'. Adding acts_as_taggable_on into Spree::Variant decorator seemed to help.
  • Spree Administration - Enterprise state/country options - unrelated fields use two different settings from application.yml. Meaning that user might see US states within Australia country which is not valid.

ofn-install on OSX/Vagrant/Ansible

  • There is no root user for vagrant and that is hardcoded as remote_user: root in playbooks/provision.yml
  • Ansible does not install letsencrypt. Seems that apt doesn’t know about it.

Can I check, what version of ofn-install did you use? The current master does have capability for installing LetsEncrypt.

There are some really useful points here, it would be good to capture as issues where appropriate. Perhaps @maikel or @oeoeaio could comment on which ones could be valid?

Some insight regarding this - Letsencrypt not installed in local vagrant · Issue #71 · openfoodfoundation/ofn-install · GitHub

There is one more failing test after running whole rspec suite:

Spree::OrdersController adding products to cart adds products to cart
Failure/Error: order = current_order_without_scoped_variants(create_order_if_necessary)

  ActiveRecord::InvalidForeignKey:
    PG::Error: ERROR:  insert or update on table "spree_orders" violates foreign key constraint "spree_orders_user_id_fk"
    DETAIL:  Key (user_id)=(14600) is not present in table "spree_users".
    : INSERT INTO "spree_orders" ("adjustment_total", "bill_address_id", "cart_id", "completed_at", "created_at", "currency", "customer_id", "distributor_id", "email", "item_total", "last_ip_address", "number", "order_cycle_id", "payment_state", "payment_total", "ship_address_id", "shipment_state", "shipping_method_id", "special_instructions", "state", "total", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23) RETURNING "id"
  # ./lib/spree/core/controller_helpers/order_decorator.rb:3:in `current_order_with_scoped_variants'
  # ./spec/performance/orders_controller_spec.rb:7:in `block (2 levels) in <top (required)>'
  # ./spec/performance/orders_controller_spec.rb:11:in `block (2 levels) in <top (required)>'
  # ------------------
  # --- Caused by: ---
  # PG::Error:
  #   ERROR:  insert or update on table "spree_orders" violates foreign key constraint "spree_orders_user_id_fk"
  #   DETAIL:  Key (user_id)=(14600) is not present in table "spree_users".
  #   ./lib/spree/core/controller_helpers/order_decorator.rb:3:in `current_order_with_scoped_variants'

On rspec ./spec/performance/orders_controller_spec.rb:18 # Spree::OrdersController adding products to cart adds products to cart