amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.58k stars 208 forks source link

spec tests running before database gets created while using sqlite #1213

Closed renich closed 4 years ago

renich commented 4 years ago

Description

After creating the sample app (with sqlite), it tries to run some tests and fails due to the database not existing yet.

Steps to Reproduce

amber new -d sqlite pet-tracker
cd pet-tracker
amber generate scaffold Pet name:string breed:string age:integer
amber db create migrate
amber watch

Expected behavior: [What you expect to happen] Stuff should just work

Actual behavior: [What actually happens] There is a route error and what appears to be spec errors.

Reproduces how often: [What percentage of the time does it reproduce?] Happens every time.

Versions

Amber CLI (amberframework.org) - v0.35.0 Crystal 0.35.0 (2020-06-09)

LLVM: 10.0.0 Default target: x86_64-unknown-linux-gnu

Additional Information

Here's a test run:

[renich@introdesk amber]$ cat test_app.bash 
#!/usr/bin/env bash

amber new -d sqlite pet-tracker
cd pet-tracker
amber generate scaffold Pet name:string breed:string age:integer
amber db create migrate

cat << EOF

Now, just run:

    amber watch

EOF

[renich@introdesk amber]$ ./test_app.bash 
2020-06-17T22:58:37.650421Z   INFO - generate: Rendering App pet-tracker in /home/renich/Desktop/crystal/amber/pet-tracker
05:58:37 generate (Info) Rendering App pet-tracker in /home/renich/Desktop/crystal/amber/pet-tracker
2020-06-17T22:58:37.669274Z   INFO - generate: new       .amber.yml
05:58:37 generate (Info) new       .amber.yml
2020-06-17T22:58:37.669495Z   INFO - generate: new       .encryption_key
05:58:37 generate (Info) new       .encryption_key
2020-06-17T22:58:37.669659Z   INFO - generate: new       .gitignore
05:58:37 generate (Info) new       .gitignore
2020-06-17T22:58:37.669855Z   INFO - generate: new       .travis.yml
05:58:37 generate (Info) new       .travis.yml
2020-06-17T22:58:37.670021Z   INFO - generate: new       Dockerfile
05:58:37 generate (Info) new       Dockerfile
2020-06-17T22:58:37.670195Z   INFO - generate: new       README.md
05:58:37 generate (Info) new       README.md
2020-06-17T22:58:37.670361Z   INFO - generate: new       config/application.cr
05:58:37 generate (Info) new       config/application.cr
2020-06-17T22:58:37.670547Z   INFO - generate: new       config/database.cr
05:58:37 generate (Info) new       config/database.cr
2020-06-17T22:58:37.670708Z   INFO - generate: new       config/environments/development.yml
05:58:37 generate (Info) new       config/environments/development.yml
2020-06-17T22:58:37.670880Z   INFO - generate: new       config/environments/production.yml
05:58:37 generate (Info) new       config/environments/production.yml
2020-06-17T22:58:37.671052Z   INFO - generate: new       config/environments/test.yml
05:58:37 generate (Info) new       config/environments/test.yml
2020-06-17T22:58:37.671282Z   INFO - generate: new       config/i18n.cr
05:58:37 generate (Info) new       config/i18n.cr
2020-06-17T22:58:37.671499Z   INFO - generate: new       config/initializers/mailer.cr
05:58:37 generate (Info) new       config/initializers/mailer.cr
2020-06-17T22:58:37.671719Z   INFO - generate: new       config/logger.cr
05:58:37 generate (Info) new       config/logger.cr
2020-06-17T22:58:37.671872Z   INFO - generate: new       config/routes.cr
05:58:37 generate (Info) new       config/routes.cr
2020-06-17T22:58:37.672035Z   INFO - generate: new       config/settings.cr
05:58:37 generate (Info) new       config/settings.cr
2020-06-17T22:58:37.672263Z   INFO - generate: new       config/webpack/common.js
05:58:37 generate (Info) new       config/webpack/common.js
2020-06-17T22:58:37.672407Z   INFO - generate: new       config/webpack/development.js
05:58:37 generate (Info) new       config/webpack/development.js
2020-06-17T22:58:37.672543Z   INFO - generate: new       config/webpack/entry.js
05:58:37 generate (Info) new       config/webpack/entry.js
2020-06-17T22:58:37.672667Z   INFO - generate: new       config/webpack/production.js
05:58:37 generate (Info) new       config/webpack/production.js
2020-06-17T22:58:37.672790Z   INFO - generate: new       db/migrations/.gitkeep
05:58:37 generate (Info) new       db/migrations/.gitkeep
2020-06-17T22:58:37.672914Z   INFO - generate: new       db/seeds.cr
05:58:37 generate (Info) new       db/seeds.cr
2020-06-17T22:58:37.673033Z   INFO - generate: new       docker-compose.yml
05:58:37 generate (Info) new       docker-compose.yml
2020-06-17T22:58:37.673187Z   INFO - generate: new       package.json
05:58:37 generate (Info) new       package.json
2020-06-17T22:58:37.673383Z   INFO - generate: new       public/crossdomain.xml
05:58:37 generate (Info) new       public/crossdomain.xml
2020-06-17T22:58:37.674048Z   INFO - generate: new       public/favicon.ico
05:58:37 generate (Info) new       public/favicon.ico
2020-06-17T22:58:37.674212Z   INFO - generate: new       public/favicon.png
05:58:37 generate (Info) new       public/favicon.png
2020-06-17T22:58:37.674411Z   INFO - generate: new       public/js/client_reload.js
05:58:37 generate (Info) new       public/js/client_reload.js
2020-06-17T22:58:37.674546Z   INFO - generate: new       public/robots.txt
05:58:37 generate (Info) new       public/robots.txt
2020-06-17T22:58:37.674685Z   INFO - generate: new       shard.yml
05:58:37 generate (Info) new       shard.yml
2020-06-17T22:58:37.674819Z   INFO - generate: new       spec/spec_helper.cr
05:58:37 generate (Info) new       spec/spec_helper.cr
2020-06-17T22:58:37.674940Z   INFO - generate: new       src/assets/fonts/.gitkeep
05:58:37 generate (Info) new       src/assets/fonts/.gitkeep
2020-06-17T22:58:37.675053Z   INFO - generate: new       src/assets/images/.gitkeep
05:58:37 generate (Info) new       src/assets/images/.gitkeep
2020-06-17T22:58:37.675214Z   INFO - generate: new       src/assets/images/logo.svg
05:58:37 generate (Info) new       src/assets/images/logo.svg
2020-06-17T22:58:37.675353Z   INFO - generate: new       src/assets/javascripts/main.js
05:58:37 generate (Info) new       src/assets/javascripts/main.js
2020-06-17T22:58:37.675502Z   INFO - generate: new       src/assets/stylesheets/main.scss
05:58:37 generate (Info) new       src/assets/stylesheets/main.scss
2020-06-17T22:58:37.675637Z   INFO - generate: new       src/controllers/application_controller.cr
05:58:37 generate (Info) new       src/controllers/application_controller.cr
2020-06-17T22:58:37.675771Z   INFO - generate: new       src/controllers/home_controller.cr
05:58:37 generate (Info) new       src/controllers/home_controller.cr
2020-06-17T22:58:37.675886Z   INFO - generate: new       src/locales/en.yml
05:58:37 generate (Info) new       src/locales/en.yml
2020-06-17T22:58:37.675991Z   INFO - generate: new       src/mailers/application_mailer.cr
05:58:37 generate (Info) new       src/mailers/application_mailer.cr
2020-06-17T22:58:37.676146Z   INFO - generate: new       src/pet-tracker.cr
05:58:37 generate (Info) new       src/pet-tracker.cr
2020-06-17T22:58:37.676290Z   INFO - generate: new       src/views/home/index.slang
05:58:37 generate (Info) new       src/views/home/index.slang
2020-06-17T22:58:37.676428Z   INFO - generate: new       src/views/layouts/_nav.slang
05:58:37 generate (Info) new       src/views/layouts/_nav.slang
2020-06-17T22:58:37.676535Z   INFO - generate: new       src/views/layouts/_session.slang
05:58:37 generate (Info) new       src/views/layouts/_session.slang
2020-06-17T22:58:37.676649Z   INFO - generate: new       src/views/layouts/application.slang
05:58:37 generate (Info) new       src/views/layouts/application.slang
2020-06-17T22:58:37.676771Z   INFO - generate: new       src/views/layouts/mailer.slang
05:58:37 generate (Info) new       src/views/layouts/mailer.slang
2020-06-17T22:58:37.676831Z   INFO - generate: Installing Dependencies
05:58:37 generate (Info) Installing Dependencies
Resolving dependencies
Fetching https://github.com/amberframework/amber.git
Fetching https://github.com/amberframework/granite.git
Fetching https://github.com/crystal-lang/json_mapping.cr.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/amberframework/quartz-mailer.git
Fetching https://github.com/arcage/crystal-email.git
Fetching https://github.com/crystal-lang/crystal-mysql.git
Fetching https://github.com/amberframework/micrate.git
Fetching https://github.com/amberframework/jasper-helpers.git
Fetching https://github.com/icyleaf/markd.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/crystal-lang/yaml_mapping.cr.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/mosop/teeplate.git
Fetching https://github.com/phoffer/inflector.cr.git
Fetching https://github.com/jeromegn/slang.git
Fetching https://github.com/luckyframework/shell-table.cr.git
Fetching https://github.com/amberframework/garnet-spec.git
Fetching https://github.com/amberframework/citrine-i18n.git
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/TechMagister/liquid.cr.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/elorest/compiled_license.git
Fetching https://github.com/amberframework/cli.git
Fetching https://github.com/amberframework/amber-router.git
Fetching https://github.com/veelenga/ameba.git
Fetching https://github.com/stefanwille/crystal-redis.git
Fetching https://github.com/crystal-community/future.cr.git
Fetching https://github.com/paulcsmith/selenium-webdriver-crystal.git
Fetching https://github.com/TechMagister/i18n.cr.git
Fetching https://github.com/amberframework/optarg.git
Fetching https://github.com/mosop/string_inflection.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/amberframework/callback.git
Shard "garnet_spec" version (0.1.1) doesn't match tag version (0.2.0)
Installing amber_router (0.3.0)
Installing callback (0.7.1)
Installing string_inflection (0.2.1)
Installing optarg (0.8.0)
Installing cli (0.9.2)
Installing compiled_license (0.1.3)
Installing kilt (0.6.0)
Installing inflector (0.1.8)
Installing json_mapping (0.1.0)
Installing liquid (0.3.3)
Installing db (0.9.0)
Installing micrate (0.8.0)
Installing pg (0.21.1)
Installing mysql (0.11.1)
Installing sqlite3 (0.16.0)
Installing pool (0.2.3)
Installing redis (2.6.0)
Installing shell-table (0.9.2 at 078a04e)
Installing slang (1.7.1)
Installing future (0.1.0)
Installing teeplate (0.10.1)
Installing exception_page (0.1.4)
Installing yaml_mapping (0.1.0)
Installing amber (0.35.0)
Installing granite (0.21.0)
Installing email (0.6.1)
Installing quartz_mailer (0.7.1)
Installing markd (0.2.0)
Installing jasper_helpers (0.2.5)
Installing i18n (0.3.1)
Installing citrine-i18n (0.4.0)
Installing selenium (0.3.0 at 427376b)
Installing garnet_spec (0.2.0)
Installing ameba (0.12.1)
Postinstall of ameba: make bin && make run_file
Writing shard.lock
2020-06-17T22:59:07.158822Z   INFO - generate: Generating Amber::CLI::Scaffold
05:59:07 generate (Info) Generating Amber::CLI::Scaffold
2020-06-17T22:59:07.160223Z   INFO - generate: new       spec/models/pet_spec.cr
05:59:07 generate (Info) new       spec/models/pet_spec.cr
2020-06-17T22:59:07.160405Z   INFO - generate: new       spec/models/spec_helper.cr
05:59:07 generate (Info) new       spec/models/spec_helper.cr
2020-06-17T22:59:07.160585Z   INFO - generate: new       src/models/pet.cr
05:59:07 generate (Info) new       src/models/pet.cr
2020-06-17T22:59:07.160943Z   INFO - generate: new       db/migrations/20200617225907159_create_pet.sql
05:59:07 generate (Info) new       db/migrations/20200617225907159_create_pet.sql
2020-06-17T22:59:07.161361Z   INFO - generate: rewritten src/views/layouts/_nav.slang
05:59:07 generate (Info) rewritten src/views/layouts/_nav.slang
2020-06-17T22:59:07.161562Z   INFO - generate: new       src/views/pet/_form.slang
05:59:07 generate (Info) new       src/views/pet/_form.slang
2020-06-17T22:59:07.161729Z   INFO - generate: new       src/views/pet/edit.slang
05:59:07 generate (Info) new       src/views/pet/edit.slang
2020-06-17T22:59:07.161897Z   INFO - generate: new       src/views/pet/index.slang
05:59:07 generate (Info) new       src/views/pet/index.slang
2020-06-17T22:59:07.162066Z   INFO - generate: new       src/views/pet/new.slang
05:59:07 generate (Info) new       src/views/pet/new.slang
2020-06-17T22:59:07.162236Z   INFO - generate: new       src/views/pet/show.slang
05:59:07 generate (Info) new       src/views/pet/show.slang
Format ./config/routes.cr
2020-06-17T22:59:07.198118Z   INFO - generate: new       spec/controllers/pet_controller_spec.cr
05:59:07 generate (Info) new       spec/controllers/pet_controller_spec.cr
2020-06-17T22:59:07.198355Z   INFO - generate: new       spec/controllers/spec_helper.cr
05:59:07 generate (Info) new       spec/controllers/spec_helper.cr
2020-06-17T22:59:07.198583Z   INFO - generate: new       src/controllers/pet_controller.cr
05:59:07 generate (Info) new       src/controllers/pet_controller.cr
2020-06-17T22:59:07.210309Z   INFO - command: For sqlite3, the database will be created during the first migration.
05:59:07 command (Info) For sqlite3, the database will be created during the first migration.

Now, just run:

    amber watch

[renich@introdesk amber]$ cd pet-tracker/
[renich@introdesk pet-tracker]$ amber watch
2020-06-17T22:59:23.124981Z   INFO - watch.run: Building...
05:59:23 watch.run (Info) Building...
2020-06-17T22:59:32.405822Z   INFO - watch.run: Compiled in 00:00:09.280734325
05:59:32 watch.run (Info) Compiled in 00:00:09.280734325
2020-06-17T22:59:32.406849Z   INFO - watch.spec: Starting...
05:59:32 watch.spec (Info) Starting...
2020-06-17T22:59:32.407737Z   INFO - watch.npm: Building...
05:59:32 watch.npm (Info) Building...
2020-06-17T22:59:32.412269Z   INFO - amber.server: Amber 0.35.0 serving application "Pet-tracker" at http://0.0.0.0:3000
05:59:32 amber.server (Info) Amber 0.35.0 serving application "Pet-tracker" at http://0.0.0.0:3000
2020-06-17T22:59:32.412467Z   INFO - amber.server: Server started in development.
05:59:32 amber.server (Info) Server started in development.
2020-06-17T22:59:32.412552Z   INFO - amber.server: Startup Time 00:00:00.000293164
05:59:32 amber.server (Info) Startup Time 00:00:00.000293164
2020-06-17T22:59:32.412820Z   INFO - amber.support.client_reload: Watching 6 files (browser reload)...
05:59:32 amber.support.client_reload (Info) Watching 6 files (browser reload)...
EEEEEEE   .........] / extract:to-object-path: sill extract @babel/helper-define-map@7.10.1

Failures:

  1) PetControllerTest renders pet index template

       no such table: pets (SQLite3::Exception)ll extract setimmediate@1.0.5
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  2) PetControllerTest renders pet show template

       no such table: pets (SQLite3::Exception)
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  3) PetControllerTest renders pet new template

       no such table: pets (SQLite3::Exception)
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  4) PetControllerTest renders pet edit template

       no such table: pets (SQLite3::Exception)
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  5) PetControllerTest creates a pet

       no such table: pets (SQLite3::Exception)
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  6) PetControllerTest updates a pet

       no such table: pets (SQLite3::Exception)ill extract string_decoder@1.1.1
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

  7) PetControllerTest deletes a pet

       no such table: pets (SQLite3::Exception)
         from lib/sqlite3/src/sqlite3/statement.cr:81:5 in 'check'
         from lib/sqlite3/src/sqlite3/statement.cr:4:5 in 'initialize'
         from lib/sqlite3/src/sqlite3/statement.cr:2:3 in 'new'
         from lib/sqlite3/src/sqlite3/connection.cr:20:5 in 'build_prepared_statement'
         from lib/db/src/db/connection.cr:40:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:58:9 in 'build'
         from lib/db/src/db/pool_prepared_statement.cr:37:16 in 'build_statement'
         from lib/db/src/db/pool_statement.cr:43:22 in 'initialize'
         from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
         from lib/db/src/db/database.cr:95:7 in 'build_prepared_statement'
         from lib/db/src/db/database.cr:90:40 in 'fetch_or_build_prepared_statement'
         from lib/db/src/db/session_methods.cr:23:9 in 'build'
         from lib/db/src/db/query_methods.cr:275:7 in 'exec'
         from lib/granite/src/adapter/sqlite.cr:27:9 in 'clear'
         from lib/granite/src/granite/transactions.cr:6:7 in 'clear'
         from spec/models/pet_spec.cr:6:5 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:338:7 in 'run_before_each_hooks'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:44:7 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:330:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from ../../../../../../usr/share/crystal/src/spec/context.cr:147:7 in 'run'
         from ../../../../../../usr/share/crystal/src/spec/dsl.cr:270:7 in '->'
         from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:45:14 in 'main'
         from ../../../../../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
         from __libc_start_main
         from _start
         from ???

Finished in 4.29 milliseconds
7 examples, 0 failures, 7 errors, 0 pending

Failed examples:

crystal spec spec/controllers/pet_controller_spec.cr:38 # PetControllerTest renders pet index template
crystal spec spec/controllers/pet_controller_spec.cr:46 # PetControllerTest renders pet show template
crystal spec spec/controllers/pet_controller_spec.cr:57 # PetControllerTest renders pet new template
crystal spec spec/controllers/pet_controller_spec.cr:67 # PetControllerTest renders pet edit template
crystal spec spec/controllers/pet_controller_spec.cr:78 # PetControllerTest creates a pet
crystal spec spec/controllers/pet_controller_spec.cr:87 # PetControllerTest updates a pet
crystal spec spec/controllers/pet_controller_spec.cr:97 # PetControllerTest deletes a pet

> node-sass@4.14.1 install /home/renich/Desktop/crystal/amber/pet-tracker/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/renich/.npm/node-sass/4.14.1/linux-x64-72_binding.node

> node-sass@4.14.1 postinstall /home/renich/Desktop/crystal/amber/pet-tracker/node_modules/node-sass
> node scripts/build.js

Binary found at /home/renich/Desktop/crystal/amber/pet-tracker/node_modules/node-sass/vendor/linux-x64-72/binding.node
Testing binary
Binary is fine
added 823 packages from 421 contributors and audited 825 packages in 14.49s

25 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

audited 825 packages in 4.195s

25 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

2020-06-17T22:59:52.673959Z   INFO - watch.npm: Starting...
05:59:52 watch.npm (Info) Starting...
2020-06-17T22:59:52.676490Z   INFO - watch.spec: Exited
05:59:52 watch.spec (Info) Exited

> pet-tracker@0.1.0 watch /home/renich/Desktop/crystal/amber/pet-tracker
> webpack -w --config config/webpack/development.js

webpack is watching the files…

2020-06-17T22:59:56.433897Z   INFO - amber.support.client_reload: File changed: ./public/dist
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist
2020-06-17T22:59:56.434010Z   INFO - amber.support.client_reload: File changed: ./public/dist/images
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist/images
2020-06-17T22:59:56.434158Z   INFO - amber.support.client_reload: File changed: ./public/dist/images/logo.svg
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist/images/logo.svg
2020-06-17T22:59:56.434298Z   INFO - amber.support.client_reload: File changed: ./public/dist/main.bundle.css
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist/main.bundle.css
2020-06-17T22:59:56.434420Z   INFO - amber.support.client_reload: File changed: ./public/dist/main.bundle.js
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist/main.bundle.js
2020-06-17T22:59:56.434571Z   INFO - amber.support.client_reload: File changed: ./public/dist/index.html
05:59:56 amber.support.client_reload (Info) File changed: ./public/dist/index.html
2020-06-17T22:59:56.434703Z   INFO - amber.support.client_reload: Watching 6 files (browser reload)...
05:59:56 amber.support.client_reload (Info) Watching 6 files (browser reload)...

06:00:28 request request | Started 2020-06-17 23:00:28 UTC
06:00:28 Request Request | Status: 200 Method: GET Pipeline: web Format: html
06:00:28 request request | Requested Url: /
06:00:28 request request | Time Elapsed: 698.61µs
06:00:28 headers headers | Host: ["localhost:3000"]
06:00:28 headers headers | User-Agent: ["Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"]
06:00:28 headers headers | Accept: ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"]
06:00:28 headers headers | Accept-Language: ["en-US,en;q=0.7,es-MX;q=0.3"]
06:00:28 headers headers | Accept-Encoding: ["gzip, deflate"]
06:00:28 headers headers | Upgrade-Insecure-Requests: ["1"]
06:00:28 headers headers | Connection: ["keep-alive"]
06:00:28 headers headers | Cookie: ["_ga=GA1.1.1537041642.1587669770; _fbp=fb.0.1587669770708.2000841867; adminer_permanent=; io=0E0K2V42LnWJAgI2AAAC; rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVG86HVJhY2s6OlNlc3Npb246OlNlc3Npb25JZAY6D0BwdWJsaWNfaWRJIkU3OTI1MGI4YjgxMDE0MmFlYjVhNDBiOGIwZDFmNTFmOWM3OGVmNDk0ZWJjNDA5YmJhMTdiZWExYWZmZDk4ZGRjBjsARkkiCWNzcmYGOwBGSSIxQ2pyRDJZOG1IZlZ4ZEdwUVZZSWZJSVhzVmF6RENPSEdjdEFvT0hiRjhEaz0GOwBGSSINdHJhY2tpbmcGOwBGewZJIhRIVFRQX1VTRVJfQUdFTlQGOwBUSSItNDU2MzMwNWU0MmMwZDI0NGU3M2U5MmY1NzU5NzFiZDJmNGMxODA5ZgY7AEY%3D--462b149b9d36305300d12be3f79c28d0e75646e9; i_like_gitea=5856b8e7d14e7987; redirect_to=%2Fuser%2Fsign_up; lang=en-US; adminer_sid=7156c2e5e5c444a292bf30db05706212; adminer_key=9a1b17afc8da284a582c26b9db84412b; amber.session=eyJfZmxhc2giOiJ7fSIsImNzcmYudG9rZW4iOiJncWdtaDhMT2QwRE4zSEx2OUlYNjRNRWJpM0VLSTVXTVJ0YUFPaTlxX3JjIn0%3D--fifTsDrwGoWS0oSH%2FUXtFTMnOCE%3D"]
06:00:28 cookies cookies | _ga: #<HTTP::Cookie:0x7f8e7fcbad90>
06:00:28 cookies cookies | _fbp: #<HTTP::Cookie:0x7f8e7fcbacb0>
06:00:28 cookies cookies | adminer_permanent: #<HTTP::Cookie:0x7f8e7fcbac40>
06:00:28 cookies cookies | io: #<HTTP::Cookie:0x7f8e7fcbabd0>
06:00:28 cookies cookies | rack.session: #<HTTP::Cookie:0x7f8e7fcbab60>
06:00:28 cookies cookies | i_like_gitea: #<HTTP::Cookie:0x7f8e7fcbaaf0>
06:00:28 cookies cookies | redirect_to: #<HTTP::Cookie:0x7f8e7fcbaa80>
06:00:28 cookies cookies | lang: #<HTTP::Cookie:0x7f8e7fcbaa10>
06:00:28 cookies cookies | adminer_sid: #<HTTP::Cookie:0x7f8e7fcba9a0>
06:00:28 cookies cookies | adminer_key: #<HTTP::Cookie:0x7f8e7fcba930>
06:00:28 cookies cookies | amber.session: #<HTTP::Cookie:0x7f8e7fcba8c0>
06:00:28 session session | _flash: {}
2020-06-17T23:00:29.693584Z   WARN - error: Error: 404
The request was not found. GET - /serviceworker.js (Amber::Exceptions::RouteNotFound)
  from lib/amber/src/amber/controller/static.cr:7:7 in 'index'
  from config/routes.cr:42:5 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'call'
  from lib/amber/src/amber/router/context.cr:78:5 in 'process_request'
  from lib/amber/src/amber/pipes/controller.cr:8:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/static.cr:85:11 in 'call_next_with_file_path'
  from lib/amber/src/amber/pipes/static.cr:45:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/error.cr:11:9 in 'call'
  from lib/amber/src/amber/pipes/pipeline.cr:20:11 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/request_processor.cr:50:11 in 'process'
  from ../../../../../../usr/share/crystal/src/http/server.cr:513:5 in 'handle_client'
  from ../../../../../../usr/share/crystal/src/http/server.cr:468:13 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ../../../../../../usr/share/crystal/src/fiber.cr:92:34 in '->'
  from ???

06:00:29 error (Warn) Error: 404
06:00:35 granite [31.0µs] SELECT "pets"."id", "pets"."name", "pets"."breed", "pets"."age" FROM "pets" : []
06:00:35 request request | Started 2020-06-17 23:00:35 UTC
06:00:35 Request Request | Status: 200 Method: GET Pipeline: web Format: html
06:00:35 request request | Requested Url: /pets
06:00:35 request request | Time Elapsed: 737.57µs
06:00:35 headers headers | Host: ["localhost:3000"]
06:00:35 headers headers | User-Agent: ["Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"]
06:00:35 headers headers | Accept: ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"]
06:00:35 headers headers | Accept-Language: ["en-US,en;q=0.7,es-MX;q=0.3"]
06:00:35 headers headers | Accept-Encoding: ["gzip, deflate"]
06:00:35 headers headers | Referer: ["http://localhost:3000/"]
06:00:35 headers headers | Upgrade-Insecure-Requests: ["1"]
06:00:35 headers headers | Connection: ["keep-alive"]
06:00:35 headers headers | Cookie: ["_ga=GA1.1.1537041642.1587669770; _fbp=fb.0.1587669770708.2000841867; adminer_permanent=; io=0E0K2V42LnWJAgI2AAAC; rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVG86HVJhY2s6OlNlc3Npb246OlNlc3Npb25JZAY6D0BwdWJsaWNfaWRJIkU3OTI1MGI4YjgxMDE0MmFlYjVhNDBiOGIwZDFmNTFmOWM3OGVmNDk0ZWJjNDA5YmJhMTdiZWExYWZmZDk4ZGRjBjsARkkiCWNzcmYGOwBGSSIxQ2pyRDJZOG1IZlZ4ZEdwUVZZSWZJSVhzVmF6RENPSEdjdEFvT0hiRjhEaz0GOwBGSSINdHJhY2tpbmcGOwBGewZJIhRIVFRQX1VTRVJfQUdFTlQGOwBUSSItNDU2MzMwNWU0MmMwZDI0NGU3M2U5MmY1NzU5NzFiZDJmNGMxODA5ZgY7AEY%3D--462b149b9d36305300d12be3f79c28d0e75646e9; i_like_gitea=5856b8e7d14e7987; redirect_to=%2Fuser%2Fsign_up; lang=en-US; adminer_sid=7156c2e5e5c444a292bf30db05706212; adminer_key=9a1b17afc8da284a582c26b9db84412b; amber.session=eyJfZmxhc2giOiJ7fSJ9--Fv%2FA9JoIJhcT%2BiqcOir8WQDxMfE%3D"]
06:00:35 cookies cookies | _ga: #<HTTP::Cookie:0x7f8e7e40db60>
06:00:35 cookies cookies | _fbp: #<HTTP::Cookie:0x7f8e7e40da80>
06:00:35 cookies cookies | adminer_permanent: #<HTTP::Cookie:0x7f8e7e40da10>
06:00:35 cookies cookies | io: #<HTTP::Cookie:0x7f8e7e40d9a0>
06:00:35 cookies cookies | rack.session: #<HTTP::Cookie:0x7f8e7e40d930>
06:00:35 cookies cookies | i_like_gitea: #<HTTP::Cookie:0x7f8e7e40d8c0>
06:00:35 cookies cookies | redirect_to: #<HTTP::Cookie:0x7f8e7e40d850>
06:00:35 cookies cookies | lang: #<HTTP::Cookie:0x7f8e7e40d7e0>
06:00:35 cookies cookies | adminer_sid: #<HTTP::Cookie:0x7f8e7e40d770>
06:00:35 cookies cookies | adminer_key: #<HTTP::Cookie:0x7f8e7e40d700>
06:00:35 cookies cookies | amber.session: #<HTTP::Cookie:0x7f8e7e40d690>
06:00:35 session session | _flash: {}
2020-06-17T23:00:36.599212Z   WARN - error: Error: 404
The request was not found. GET - /serviceworker.js (Amber::Exceptions::RouteNotFound)
  from lib/amber/src/amber/controller/static.cr:7:7 in 'index'
  from config/routes.cr:42:5 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'call'
  from lib/amber/src/amber/router/context.cr:78:5 in 'process_request'
  from lib/amber/src/amber/pipes/controller.cr:8:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/static.cr:85:11 in 'call_next_with_file_path'
  from lib/amber/src/amber/pipes/static.cr:45:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/error.cr:11:9 in 'call'
  from lib/amber/src/amber/pipes/pipeline.cr:20:11 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/request_processor.cr:50:11 in 'process'
  from ../../../../../../usr/share/crystal/src/http/server.cr:513:5 in 'handle_client'
  from ../../../../../../usr/share/crystal/src/http/server.cr:468:13 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ../../../../../../usr/share/crystal/src/fiber.cr:92:34 in '->'
  from ???

06:00:36 error (Warn) Error: 404
06:00:40 request request | Started 2020-06-17 23:00:40 UTC
06:00:40 Request Request | Status: 200 Method: GET Pipeline: web Format: html
06:00:40 request request | Requested Url: /pets/new
06:00:40 request request | Time Elapsed: 629.86µs
06:00:40 headers headers | Host: ["localhost:3000"]
06:00:40 headers headers | User-Agent: ["Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"]
06:00:40 headers headers | Accept: ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"]
06:00:40 headers headers | Accept-Language: ["en-US,en;q=0.7,es-MX;q=0.3"]
06:00:40 headers headers | Accept-Encoding: ["gzip, deflate"]
06:00:40 headers headers | Referer: ["http://localhost:3000/pets"]
06:00:40 headers headers | Upgrade-Insecure-Requests: ["1"]
06:00:40 headers headers | Connection: ["keep-alive"]
06:00:40 headers headers | Cookie: ["_ga=GA1.1.1537041642.1587669770; _fbp=fb.0.1587669770708.2000841867; adminer_permanent=; io=0E0K2V42LnWJAgI2AAAC; rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVG86HVJhY2s6OlNlc3Npb246OlNlc3Npb25JZAY6D0BwdWJsaWNfaWRJIkU3OTI1MGI4YjgxMDE0MmFlYjVhNDBiOGIwZDFmNTFmOWM3OGVmNDk0ZWJjNDA5YmJhMTdiZWExYWZmZDk4ZGRjBjsARkkiCWNzcmYGOwBGSSIxQ2pyRDJZOG1IZlZ4ZEdwUVZZSWZJSVhzVmF6RENPSEdjdEFvT0hiRjhEaz0GOwBGSSINdHJhY2tpbmcGOwBGewZJIhRIVFRQX1VTRVJfQUdFTlQGOwBUSSItNDU2MzMwNWU0MmMwZDI0NGU3M2U5MmY1NzU5NzFiZDJmNGMxODA5ZgY7AEY%3D--462b149b9d36305300d12be3f79c28d0e75646e9; i_like_gitea=5856b8e7d14e7987; redirect_to=%2Fuser%2Fsign_up; lang=en-US; adminer_sid=7156c2e5e5c444a292bf30db05706212; adminer_key=9a1b17afc8da284a582c26b9db84412b; amber.session=eyJfZmxhc2giOiJ7fSJ9--Fv%2FA9JoIJhcT%2BiqcOir8WQDxMfE%3D"]
06:00:40 cookies cookies | _ga: #<HTTP::Cookie:0x7f8e7fcbad20>
06:00:40 cookies cookies | _fbp: #<HTTP::Cookie:0x7f8e7fcbac40>
06:00:40 cookies cookies | adminer_permanent: #<HTTP::Cookie:0x7f8e7fcbabd0>
06:00:40 cookies cookies | io: #<HTTP::Cookie:0x7f8e7fcbab60>
06:00:40 cookies cookies | rack.session: #<HTTP::Cookie:0x7f8e7fcbaaf0>
06:00:40 cookies cookies | i_like_gitea: #<HTTP::Cookie:0x7f8e7fcbaa80>
06:00:40 cookies cookies | redirect_to: #<HTTP::Cookie:0x7f8e7fcbaa10>
06:00:40 cookies cookies | lang: #<HTTP::Cookie:0x7f8e7fcba9a0>
06:00:40 cookies cookies | adminer_sid: #<HTTP::Cookie:0x7f8e7fcba930>
06:00:40 cookies cookies | adminer_key: #<HTTP::Cookie:0x7f8e7fcba8c0>
06:00:40 cookies cookies | amber.session: #<HTTP::Cookie:0x7f8e7fcba850>
06:00:40 session session | _flash: {}
06:00:40 session session | csrf.token: 5T39vs-F7dFvYkRC2CN61pUerGVFymVUqyj9ZKReRKI
2020-06-17T23:00:41.339045Z   WARN - error: Error: 404
The request was not found. GET - /serviceworker.js (Amber::Exceptions::RouteNotFound)
  from lib/amber/src/amber/controller/static.cr:7:7 in 'index'
  from config/routes.cr:42:5 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'call'
  from lib/amber/src/amber/router/context.cr:78:5 in 'process_request'
  from lib/amber/src/amber/pipes/controller.cr:8:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/static.cr:85:11 in 'call_next_with_file_path'
  from lib/amber/src/amber/pipes/static.cr:45:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/error.cr:11:9 in 'call'
  from lib/amber/src/amber/pipes/pipeline.cr:20:11 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/request_processor.cr:50:11 in 'process'
  from ../../../../../../usr/share/crystal/src/http/server.cr:513:5 in 'handle_client'
  from ../../../../../../usr/share/crystal/src/http/server.cr:468:13 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ../../../../../../usr/share/crystal/src/fiber.cr:92:34 in '->'
  from ???

06:00:41 error (Warn) Error: 404
06:00:47 granite [42.0ms] INSERT INTO "pets" ("name", "breed", "age") VALUES (?, ?, ?): ["Test", "Pet", 28]
06:00:47 request request | Started 2020-06-17 23:00:47 UTC
06:00:47 Request Request | Status: 302 Method: POST Pipeline: web Format: html
06:00:47 request request | Requested Url: /pets/
06:00:47 request request | Time Elapsed: 42.86ms
06:00:47 headers headers | Host: ["localhost:3000"]
06:00:47 headers headers | User-Agent: ["Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"]
06:00:47 headers headers | Accept: ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"]
06:00:47 headers headers | Accept-Language: ["en-US,en;q=0.7,es-MX;q=0.3"]
06:00:47 headers headers | Accept-Encoding: ["gzip, deflate"]
06:00:47 headers headers | Content-Type: ["application/x-www-form-urlencoded"]
06:00:47 headers headers | Content-Length: ["125"]
06:00:47 headers headers | Referer: ["http://localhost:3000/pets/new"]
06:00:47 headers headers | Origin: ["http://localhost:3000"]
06:00:47 headers headers | Upgrade-Insecure-Requests: ["1"]
06:00:47 headers headers | Connection: ["keep-alive"]
06:00:47 headers headers | Cookie: ["_ga=GA1.1.1537041642.1587669770; _fbp=fb.0.1587669770708.2000841867; adminer_permanent=; io=0E0K2V42LnWJAgI2AAAC; rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVG86HVJhY2s6OlNlc3Npb246OlNlc3Npb25JZAY6D0BwdWJsaWNfaWRJIkU3OTI1MGI4YjgxMDE0MmFlYjVhNDBiOGIwZDFmNTFmOWM3OGVmNDk0ZWJjNDA5YmJhMTdiZWExYWZmZDk4ZGRjBjsARkkiCWNzcmYGOwBGSSIxQ2pyRDJZOG1IZlZ4ZEdwUVZZSWZJSVhzVmF6RENPSEdjdEFvT0hiRjhEaz0GOwBGSSINdHJhY2tpbmcGOwBGewZJIhRIVFRQX1VTRVJfQUdFTlQGOwBUSSItNDU2MzMwNWU0MmMwZDI0NGU3M2U5MmY1NzU5NzFiZDJmNGMxODA5ZgY7AEY%3D--462b149b9d36305300d12be3f79c28d0e75646e9; i_like_gitea=5856b8e7d14e7987; redirect_to=%2Fuser%2Fsign_up; lang=en-US; adminer_sid=7156c2e5e5c444a292bf30db05706212; adminer_key=9a1b17afc8da284a582c26b9db84412b; amber.session=eyJfZmxhc2giOiJ7fSIsImNzcmYudG9rZW4iOiI1VDM5dnMtRjdkRnZZa1JDMkNONjFwVWVyR1ZGeW1WVXF5ajlaS1JlUktJIn0%3D--MdZJ%2FhIGv8Dfr6UNXaqqmP2WsN8%3D"]
06:00:47 cookies cookies | _ga: #<HTTP::Cookie:0x7f8e7e40d380>
06:00:47 cookies cookies | _fbp: #<HTTP::Cookie:0x7f8e7e40d2a0>
06:00:47 cookies cookies | adminer_permanent: #<HTTP::Cookie:0x7f8e7e5f8f50>
06:00:47 cookies cookies | io: #<HTTP::Cookie:0x7f8e7e5f8e70>
06:00:47 cookies cookies | rack.session: #<HTTP::Cookie:0x7f8e7e5f8e00>
06:00:47 cookies cookies | i_like_gitea: #<HTTP::Cookie:0x7f8e7e5f8d90>
06:00:47 cookies cookies | redirect_to: #<HTTP::Cookie:0x7f8e7e5f8d20>
06:00:47 cookies cookies | lang: #<HTTP::Cookie:0x7f8e7e5f8c40>
06:00:47 cookies cookies | adminer_sid: #<HTTP::Cookie:0x7f8e7e5f8b60>
06:00:47 cookies cookies | adminer_key: #<HTTP::Cookie:0x7f8e7e5f8a10>
06:00:47 cookies cookies | amber.session: #<HTTP::Cookie:0x7f8e7e5f89a0>
06:00:47 params params | _csrf: lsPIS8Mw8wD4CCvTHqowRxsHp7wgpGOaawejm5XydFNz_jX1DLUe0Zdqb5HGiUqRjhkL2WVuBs7AL17_Maww8Q==
06:00:47 params params | name: Test
06:00:47 params params | breed: Pet
06:00:47 params params | age: 28
06:00:47 session session | _flash: {"success":"Pet has been created."}
06:00:47 session session | csrf.token: 5T39vs-F7dFvYkRC2CN61pUerGVFymVUqyj9ZKReRKI
06:00:47 granite [7.0µs] SELECT "pets"."id", "pets"."name", "pets"."breed", "pets"."age" FROM "pets" : []
06:00:47 request request | Started 2020-06-17 23:00:47 UTC
06:00:47 Request Request | Status: 200 Method: GET Pipeline: web Format: html
06:00:47 request request | Requested Url: /pets
06:00:47 request request | Time Elapsed: 609.58µs
06:00:47 headers headers | Host: ["localhost:3000"]
06:00:47 headers headers | User-Agent: ["Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"]
06:00:47 headers headers | Accept: ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"]
06:00:47 headers headers | Accept-Language: ["en-US,en;q=0.7,es-MX;q=0.3"]
06:00:47 headers headers | Accept-Encoding: ["gzip, deflate"]
06:00:47 headers headers | Referer: ["http://localhost:3000/pets/new"]
06:00:47 headers headers | Upgrade-Insecure-Requests: ["1"]
06:00:47 headers headers | Connection: ["keep-alive"]
06:00:47 headers headers | Cookie: ["_ga=GA1.1.1537041642.1587669770; _fbp=fb.0.1587669770708.2000841867; adminer_permanent=; io=0E0K2V42LnWJAgI2AAAC; rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVG86HVJhY2s6OlNlc3Npb246OlNlc3Npb25JZAY6D0BwdWJsaWNfaWRJIkU3OTI1MGI4YjgxMDE0MmFlYjVhNDBiOGIwZDFmNTFmOWM3OGVmNDk0ZWJjNDA5YmJhMTdiZWExYWZmZDk4ZGRjBjsARkkiCWNzcmYGOwBGSSIxQ2pyRDJZOG1IZlZ4ZEdwUVZZSWZJSVhzVmF6RENPSEdjdEFvT0hiRjhEaz0GOwBGSSINdHJhY2tpbmcGOwBGewZJIhRIVFRQX1VTRVJfQUdFTlQGOwBUSSItNDU2MzMwNWU0MmMwZDI0NGU3M2U5MmY1NzU5NzFiZDJmNGMxODA5ZgY7AEY%3D--462b149b9d36305300d12be3f79c28d0e75646e9; i_like_gitea=5856b8e7d14e7987; redirect_to=%2Fuser%2Fsign_up; lang=en-US; adminer_sid=7156c2e5e5c444a292bf30db05706212; adminer_key=9a1b17afc8da284a582c26b9db84412b; amber.session=eyJfZmxhc2giOiJ7XCJzdWNjZXNzXCI6XCJQZXQgaGFzIGJlZW4gY3JlYXRlZC5cIn0iLCJjc3JmLnRva2VuIjoiNVQzOXZzLUY3ZEZ2WWtSQzJDTjYxcFVlckdWRnltVlVxeWo5WktSZVJLSSJ9--KPw9RObqGonO8zvRAKRKWk2VRNU%3D"]
06:00:47 cookies cookies | _ga: #<HTTP::Cookie:0x7f8e7e5f87e0>
06:00:47 cookies cookies | _fbp: #<HTTP::Cookie:0x7f8e7e40d310>
06:00:47 cookies cookies | adminer_permanent: #<HTTP::Cookie:0x7f8e7e40d3f0>
06:00:47 cookies cookies | io: #<HTTP::Cookie:0x7f8e7e40d850>
06:00:47 cookies cookies | rack.session: #<HTTP::Cookie:0x7f8e7e40da10>
06:00:47 cookies cookies | i_like_gitea: #<HTTP::Cookie:0x7f8e7e40db60>
06:00:47 cookies cookies | redirect_to: #<HTTP::Cookie:0x7f8e7fcba070>
06:00:47 cookies cookies | lang: #<HTTP::Cookie:0x7f8e7fcba2a0>
06:00:47 cookies cookies | adminer_sid: #<HTTP::Cookie:0x7f8e7fcba380>
06:00:47 cookies cookies | adminer_key: #<HTTP::Cookie:0x7f8e7fcba3f0>
06:00:47 cookies cookies | amber.session: #<HTTP::Cookie:0x7f8e7fcba540>
06:00:47 session session | _flash: {}
06:00:47 session session | csrf.token: 5T39vs-F7dFvYkRC2CN61pUerGVFymVUqyj9ZKReRKI
2020-06-17T23:00:48.191023Z   WARN - error: Error: 404
The request was not found. GET - /serviceworker.js (Amber::Exceptions::RouteNotFound)
  from lib/amber/src/amber/controller/static.cr:7:7 in 'index'
  from config/routes.cr:42:5 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'call'
  from lib/amber/src/amber/router/context.cr:78:5 in 'process_request'
  from lib/amber/src/amber/pipes/controller.cr:8:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/static.cr:85:11 in 'call_next_with_file_path'
  from lib/amber/src/amber/pipes/static.cr:45:9 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
  from lib/amber/src/amber/pipes/error.cr:11:9 in 'call'
  from lib/amber/src/amber/pipes/pipeline.cr:20:11 in 'call'
  from ../../../../../../usr/share/crystal/src/http/server/request_processor.cr:50:11 in 'process'
  from ../../../../../../usr/share/crystal/src/http/server.cr:513:5 in 'handle_client'
  from ../../../../../../usr/share/crystal/src/http/server.cr:468:13 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ../../../../../../usr/share/crystal/src/fiber.cr:92:34 in '->'
  from ???

06:00:48 error (Warn) Error: 404
drujensen commented 4 years ago

Hi @renich Thanks for reporting this. This is because the test database was not created or migrated. Currently this is set in the test environment. This is similar to how rails works. After you create and migrate the development database, run:

AMBER_ENV=test amber db create migrate

If you do not want the specs to automatically run and prefer running those manually, you can remove it from the watch command by editing the .amber.yml file.

eliasjpr commented 4 years ago

Closing this issue given the problem was answered above