forked from christianselig/apollo-backend
-
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.
* some tests * more tests * tidy up go.mod * more tests * add postgres * beep * again * Set up schema * fix device test
- Loading branch information
1 parent
17019ce
commit f9b9c59
Showing
57 changed files
with
674 additions
and
550 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DATABASE_URL=postgres://andremedeiros@localhost/apollo_test?sslmode=disable | ||
DATABASE_CONNECTION_POOL_URL=postgres://andremedeiros@localhost/apollo_test?sslmode=disable | ||
REDIS_URL=redis://127.0.0.1:6379 | ||
STATSD_URL=127.0.0.1:8125 |
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,28 @@ | ||
linters: | ||
enable: | ||
- bodyclose # checks whether HTTP response body is closed successfully | ||
- errcheck # checks for unchecked errors in go programs | ||
- errname # checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error` | ||
- exportloopref # checks for pointers to enclosing loop variables | ||
- gochecknoinits # checks that no init functions are present in Go code | ||
- ifshort # checks that your code uses short syntax for if-statements whenever possible | ||
- importas # enforces consistent import aliases | ||
- ineffassign # detects when assignments to existing variables are not used | ||
- noctx # finds sending http request without context.Context | ||
- paralleltest # detects missing usage of t.Parallel() method in go tests | ||
- prealloc # finds slice declarations that could potentially be preallocated | ||
- rowserrcheck # checks whether Err of rows is checked successfully | ||
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed | ||
- tenv # detects using os.Setenv instead of t.Setenv | ||
- testpackage # makes you use a separate _test package | ||
- thelper # detects golang test helpers without t.Helper() call and checks consistency of test helpers | ||
- unconvert # removes unnecessary type conversions | ||
- unparam # removes unused function parameters | ||
fast: true | ||
|
||
issues: | ||
exclude-rules: | ||
# False positive: https://github.com/kunwardeep/paralleltest/issues/8. | ||
- linters: | ||
- paralleltest | ||
text: "does not use range value in test Run" |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
BREW_PREFIX ?= $(shell brew --prefix) | ||
DATABASE_URL ?= "postgres://$(USER)@localhost/apollo_test?sslmode=disable" | ||
|
||
test: | ||
@DATABASE_URL=$(DATABASE_URL) go test -race -v -timeout 1s ./... | ||
|
||
test-setup: $(BREW_PREFIX)/bin/migrate | ||
migrate -path migrations/ -database $(DATABASE_URL) up | ||
|
||
build: | ||
@go build ./cmd/apollo | ||
|
||
lint: | ||
@golangci-lint run | ||
|
||
$(BREW_PREFIX)/bin/migrate: | ||
@brew install golang-migrate | ||
|
||
.PHONY: all build deps lint test |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.