News for hackers. Stuff that matters.
Re:Show HN: Keratin AuthN – Accounts and Auth Microservice i... by je42 on Wednesday November 08, 2017 @01:23PM (#15655282)
almost no test coverage. did i miss them ? for proper use in production you would need to have hundreds of unittests and a whole bunch of component + integration and e2e tests.
Re:Show HN: Keratin AuthN – Accounts and Auth Microservice i... by cainlevy on Wednesday November 08, 2017 @01:30PM (#15655368)
Tests are colocated inside packages (folders) using a `_test.go` convention.

Service tests[1] are the main unit tests, and use mock implementations of the data store interfaces.

Data (DAO) tests[2] are generally run across every implementation using only the public interface. This helps me stay sane with the mock implementations.

The API tests[3] are integration tests, and use Go's excellent httptest package to boot a real server and execute real HTTP commands.

[1] https://github.com/keratin/authn-server/tree/master/services

[2] https://github.com/keratin/authn-server/tree/master/data

[3] https://github.com/keratin/authn-server/tree/master/api/acco...

Re:Show HN: Keratin AuthN – Accounts and Auth Microservice i... by praxxis on Wednesday November 08, 2017 @01:26PM (#15655318)
There are tests - they're colocated with the source, not in a separate tests folder, e.g. https://github.com/keratin/authn-server/tree/master/services
Re:Show HN: Keratin AuthN – Accounts and Auth Microservice i... by Lord_Zero on Wednesday November 08, 2017 @01:33PM (#15655410)
Check the make file:

https://github.com/keratin/authn-server/blob/master/Makefile...

Notice it runs "go test $(shell glide nv)"

`glide nv` is a command that gets you all packages except the vendor directory https://github.com/Masterminds/glide#glide-novendor-aliased-...

then read the go doc for test https://golang.org/cmd/go/#hdr-Test_packages:

> 'Go test' recompiles each package along with any files with names matching the file pattern "*_test.go".

Re:Show HN: Keratin AuthN – Accounts and Auth Microservice i... by plexicle on Wednesday November 08, 2017 @01:35PM (#15655438)
Yeah, you missed them.