forked from 99designs/gqlgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adam Scarr
committed
Aug 9, 2018
1 parent
ae82b94
commit 45e22cb
Showing
9 changed files
with
2,815 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,17 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
function cleanup { | ||
echo "Cleaning up containers..." | ||
docker kill $SERVER_CONTAINER 1>/dev/null 2>/dev/null || true | ||
docker rm --force -v $SERVER_CONTAINER 1>/dev/null 2>/dev/null || true | ||
} | ||
trap cleanup EXIT | ||
echo "### running jest integration spec" | ||
./node_modules/.bin/jest | ||
|
||
SERVER_CONTAINER=$(docker run -d \ | ||
-e PORT=1234 \ | ||
--name integration_server \ | ||
gqlgen/golang go run ./integration/server/server.go \ | ||
) | ||
|
||
sleep 2 | ||
echo "### validating introspected schema" | ||
./node_modules/.bin/graphql get-schema | ||
|
||
docker run \ | ||
-e SERVER_URL=http://integration_server:1234/query \ | ||
--link=integration_server \ | ||
gqlgen/node ./node_modules/.bin/jest | ||
|
||
echo "### server logs" | ||
docker logs $SERVER_CONTAINER | ||
|
||
exit $(docker inspect $SERVER_CONTAINER --format='{{.State.ExitCode}}') | ||
if ! diff <(tail -n +3 schema-expected.graphql) <(tail -n +3 schema-fetched.graphql) ; then | ||
echo "The expected schema has changed, you need to update schema-expected.graphql with any expected changes" | ||
exit 1 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"projects": { | ||
"Project Name": { | ||
"schemaPath": "schema-fetched.graphql", | ||
"extensions": { | ||
"endpoints": { | ||
"dev": { | ||
"url": "${env:SERVER_URL}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.