From 6a73ee86f8f690ad809ac5750f95050f9f4ae188 Mon Sep 17 00:00:00 2001 From: nozakis Date: Tue, 6 Nov 2018 20:21:52 -0600 Subject: [PATCH 1/6] Clarify GETTING_STARTED.md in regards to rspec test failures and time zones --- GETTING_STARTED.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index e68259d57f..38278fd3e5 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -72,6 +72,10 @@ Tests, both unit and integration, are based on RSpec. To run the test suite, fir Then the tests can be run with: bundle exec rspec spec + +Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop. Get in touch with the [#dev][slack-dev] channel on Slack to troubleshoot issues and determine if they will preclude you from contributing to OFN. + +Additionally, make sure that the time zone on your machine matches the one defined in `config/application.yml`. If there is a discrepancy, it may cause some RSpec tests to fail. The project is configured to use [Zeus][zeus] to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page][zeus] for usage instructions. @@ -102,3 +106,5 @@ You can run rubocop against your changes using: [zeus]: https://github.com/burke/zeus [rubocop]: https://rubocop.readthedocs.io/en/latest/ [karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma +[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU + From a7032a8822c2af4830631628e021c9d539bf16e0 Mon Sep 17 00:00:00 2001 From: Samuel Nozaki Date: Wed, 7 Nov 2018 17:05:11 -0600 Subject: [PATCH 2/6] Clarify that the time zone should be Melbourne --- GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 38278fd3e5..89c7826424 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -75,7 +75,7 @@ Then the tests can be run with: Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop. Get in touch with the [#dev][slack-dev] channel on Slack to troubleshoot issues and determine if they will preclude you from contributing to OFN. -Additionally, make sure that the time zone on your machine matches the one defined in `config/application.yml`. If there is a discrepancy, it may cause some RSpec tests to fail. +Additionally, make sure that the time zone on your machine matches the one defined in `config/application.yml` (it should be Melbourne). Setting your machine's time zone to any other zone has the potential to cause test failures. The project is configured to use [Zeus][zeus] to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page][zeus] for usage instructions. From 1216567be9b92d2b7ca3636c5ec67661235056ce Mon Sep 17 00:00:00 2001 From: Kevin Christianson Date: Wed, 7 Nov 2018 22:08:23 -0600 Subject: [PATCH 3/6] Add Troubleshooting section with an alternative database setup --- GETTING_STARTED.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 89c7826424..7dcb0e0a6d 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -46,7 +46,7 @@ First, you need to create the database user the app will use by manually typing $ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f00d'" ``` -This will create the "ofn" user as superuser and allowing it to create databases. +This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting guide](#creating-the-database) for an alternative. Once done, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot. @@ -97,7 +97,23 @@ You can run rubocop against your changes using: rubocop +### Troubleshooting +Below are fixes to potential issues that can happen during the installation process. If these don't solve the problem, or it's not listed, feel free to reach out to the [Developer Community][slack-dev] on slack. We usually respond pretty quickly. + +#### Creating the database + +If the ```$ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f00d'"``` command doesn't work, you can run the following commands instead: +```sh +$ createuser --superuser --pwprompt ofn +Enter password for new role: f00d +Enter it again: f00d +$ createdb open_food_network_dev --owner=ofn +$ createdb open_food_network_test --owner=ofn +``` +If these commands succeed, you should be able to [continue the setup process](#get-it-running). + +### Resources [developer-wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki [sierra]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-macOS-(Sierra) [el-capitan]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X-(El-Capitan) From 7dce6e118082e173e7aa5510d7310cd2dc64743f Mon Sep 17 00:00:00 2001 From: Kevin Christianson Date: Thu, 8 Nov 2018 09:18:34 -0600 Subject: [PATCH 4/6] Remove weird red "for" text in Troubleshooting --- GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 7dcb0e0a6d..5a95c5390f 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -46,7 +46,7 @@ First, you need to create the database user the app will use by manually typing $ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f00d'" ``` -This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting guide](#creating-the-database) for an alternative. +This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting section](#creating-the-database) for an alternative. Once done, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot. @@ -104,7 +104,7 @@ Below are fixes to potential issues that can happen during the installation proc #### Creating the database If the ```$ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f00d'"``` command doesn't work, you can run the following commands instead: -```sh +``` $ createuser --superuser --pwprompt ofn Enter password for new role: f00d Enter it again: f00d From 364a00074b799e2d5939d62092b1a8b86ec61b56 Mon Sep 17 00:00:00 2001 From: haseleyi Date: Thu, 15 Nov 2018 01:08:41 +1100 Subject: [PATCH 5/6] Remove Resources header --- GETTING_STARTED.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 5a95c5390f..c6307fcbc5 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -72,7 +72,7 @@ Tests, both unit and integration, are based on RSpec. To run the test suite, fir Then the tests can be run with: bundle exec rspec spec - + Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop. Get in touch with the [#dev][slack-dev] channel on Slack to troubleshoot issues and determine if they will preclude you from contributing to OFN. Additionally, make sure that the time zone on your machine matches the one defined in `config/application.yml` (it should be Melbourne). Setting your machine's time zone to any other zone has the potential to cause test failures. @@ -113,7 +113,6 @@ $ createdb open_food_network_test --owner=ofn ``` If these commands succeed, you should be able to [continue the setup process](#get-it-running). -### Resources [developer-wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki [sierra]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-macOS-(Sierra) [el-capitan]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X-(El-Capitan) @@ -123,4 +122,3 @@ If these commands succeed, you should be able to [continue the setup process](#g [rubocop]: https://rubocop.readthedocs.io/en/latest/ [karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma [slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU - From 07e246db397d5e198c9b55b83ffda74d5d51afd7 Mon Sep 17 00:00:00 2001 From: haseleyi Date: Wed, 21 Nov 2018 15:55:42 -0800 Subject: [PATCH 6/6] Remove outdated time zone precaution from Getting Started wiki --- GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index c6307fcbc5..45b44be4b6 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -75,7 +75,7 @@ Then the tests can be run with: Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop. Get in touch with the [#dev][slack-dev] channel on Slack to troubleshoot issues and determine if they will preclude you from contributing to OFN. -Additionally, make sure that the time zone on your machine matches the one defined in `config/application.yml` (it should be Melbourne). Setting your machine's time zone to any other zone has the potential to cause test failures. +Note: The time zone on your machine should match the one defined in `config/application.yml`. The project is configured to use [Zeus][zeus] to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page][zeus] for usage instructions.