From a850e369ff2a7f13caa1de40e96cfee6cef5da54 Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Mon, 1 Oct 2018 09:57:25 -0500 Subject: [PATCH 1/2] use GOPATH for migration script; update postgraphile to watch db schema --- postgraphile/spec/server/runtime.spec.ts | 1 + postgraphile/src/adapters/postgraphile.ts | 1 + postgraphile/src/server/config.ts | 1 + scripts/create_migration | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/postgraphile/spec/server/runtime.spec.ts b/postgraphile/spec/server/runtime.spec.ts index 0d3d993d..3e62a9f4 100644 --- a/postgraphile/spec/server/runtime.spec.ts +++ b/postgraphile/spec/server/runtime.spec.ts @@ -27,6 +27,7 @@ describe('bootServer', () => { middleware: jasmine.createSpyObj(['call']), options: { pluginHook: jasmine.createSpy('pluginHook'), + watchPg: true, simpleSubscriptions: true, graphiql: true, webSocketMiddlewares: [] }, diff --git a/postgraphile/src/adapters/postgraphile.ts b/postgraphile/src/adapters/postgraphile.ts index 629f344e..c7013359 100644 --- a/postgraphile/src/adapters/postgraphile.ts +++ b/postgraphile/src/adapters/postgraphile.ts @@ -11,6 +11,7 @@ export interface PostgraphileMiddleware extends RequestHandler {} export interface PostgraphileOptions { pluginHook: PluginHookFn, simpleSubscriptions: boolean; + watchPg: boolean; graphiql: boolean; // NOTE (jchristie@8thlight.com) Shape of the middlewares is not // currently important to this application, but if a need arises, diff --git a/postgraphile/src/server/config.ts b/postgraphile/src/server/config.ts index 05dca1f3..c5acf974 100644 --- a/postgraphile/src/server/config.ts +++ b/postgraphile/src/server/config.ts @@ -27,6 +27,7 @@ export function buildServerConfig( const options: PostgraphileOptions = { pluginHook: pluginHook, simpleSubscriptions: true, + watchPg: true, graphiql: true, webSocketMiddlewares: [ expressSessionHandler, diff --git a/scripts/create_migration b/scripts/create_migration index 82be868e..27e4a1bc 100755 --- a/scripts/create_migration +++ b/scripts/create_migration @@ -2,7 +2,7 @@ if [ $# -eq 1 ] then - $GOBIN/migrate create -dir ./db/migrations -ext sql $1 + $GOPATH/bin/migrate create -dir ./db/migrations -ext sql $1 else echo "**An Error Occurred**" echo "Usage: ./scripts/create_migration " From 23b4537f355d7fcd48362fcf2ea54482f79be2bd Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Mon, 1 Oct 2018 10:17:53 -0500 Subject: [PATCH 2/2] update travis ci to run postgraphile tests --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index fd0b03fa..4f9f0565 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,14 +16,20 @@ before_install: - make installtools - bash ./scripts/install-postgres-10.sh - npm install -g ganache-cli + - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + - sudo apt-get update && sudo apt-get install yarn before_script: - go get -u github.com/pressly/sup/cmd/sup - sudo -u postgres createdb vulcanize_private - make migrate NAME=vulcanize_private - bash ./pkg/transformers/start_test_chain.sh + - cd postgraphile && yarn script: + - yarn test + - cd ../ - make test notifications: