diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b0fd9b2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ +Thank you for making a pull request! + +A few things to be aware of as you're working on your PR: + +## WIP Tag +Incomplete PRs are more than welcome - it can be useful to collaborate before implementation of an idea +is complete. However, if your PR is not ready for merge, please add [WIP] to the end of the title (work-in-progress). + +## Tests +Before committing, you are encouraged to run the small but growing test suite. This is accomplished by +`make test`. + +## CI +Each push to a branch connected to a PR will be run through GLAuth's CI system. Please use these to your +advantage. In particular, the Travis integration tests rely on the LDAP queries returning with a set +result, so if your changes will change the output, Travis will likely fail. + +To update, run `make fast && make updatetest && make test`. This will delete the output snapshots provided +and make new ones. You can then inspect the changes and commit them. + +Similarly, check codeclimate and try to fix what you find there if it fails. diff --git a/Makefile b/Makefile index 803799f..ac1c195 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,8 @@ setup: bindata format runtest: ./scripts/travis/integration-test.sh cleanup - +updatetest: + ./scripts/travis/integration-test.sh bindata: go get -u github.com/jteeuwen/go-bindata/... && ${GOPATH}/bin/go-bindata -pkg=main assets && gofmt -w bindata.go diff --git a/scripts/travis/integration-test.sh b/scripts/travis/integration-test.sh index 93f92eb..fcd60c2 100755 --- a/scripts/travis/integration-test.sh +++ b/scripts/travis/integration-test.sh @@ -4,6 +4,15 @@ export CLEANUP="$1" ## Main Methods + +# Dep check + +command -v oathtool ; +if [[ "$?" = "1" ]] ; then + echo "Please install oathtool or add it to \$PATH before continuing." + exit 1; +fi + # Get the git working directory base if travis build dir isn't set if [[ "$TRAVIS_BUILD_DIR" == "" ]] ; then export TRAVIS_BUILD_DIR="$(git rev-parse --show-toplevel)"