Documentation and linting improvements (#108)

* Simplifying documentation for getting started: Removed outdated information about install Golang on different platforms and instead included a link to the official Golang website which has more up to date information. Instructions for installing docker-compose have also been added.

* Added documentation to all exported functions and structs.

* Unexported some structures and functions that were needlessly exported.

* Adding golang CI default configuration which can be useful while developing and may be turned on later in the CI.

* Moving build process in CI to xenial.

* Reducing line size. in some files and shadowing in some test cases.
This commit is contained in:
Renan DelValle 2019-06-12 11:22:59 -07:00 committed by GitHub
parent 6dc4bf93b9
commit df8fc2fba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 347 additions and 274 deletions

View file

@ -77,17 +77,17 @@ func TestNonExistentEndpoint(t *testing.T) {
t.Run("WithRetries", func(t *testing.T) {
// Attempt to connect to a bad endpoint
r, err := realis.NewRealisClient(
badClient, err := realis.NewRealisClient(
realis.SchedulerUrl(badEndpoint),
realis.TimeoutMS(200000),
realis.BackOff(backoff),
)
require.NoError(t, err)
require.NotNil(t, r)
defer r.Close()
require.NotNil(t, badClient)
defer badClient.Close()
_, err = r.GetTasksWithoutConfigs(taskQ)
_, err = badClient.GetTasksWithoutConfigs(taskQ)
// Check that we do error out of retrying
require.Error(t, err)
@ -101,7 +101,7 @@ func TestNonExistentEndpoint(t *testing.T) {
t.Run("FailOnLookup", func(t *testing.T) {
// Attempt to connect to a bad endpoint
r, err := realis.NewRealisClient(
badClient, err := realis.NewRealisClient(
realis.SchedulerUrl(badEndpoint),
realis.TimeoutMS(200000),
realis.BackOff(backoff),
@ -109,10 +109,10 @@ func TestNonExistentEndpoint(t *testing.T) {
)
require.NoError(t, err)
require.NotNil(t, r)
defer r.Close()
require.NotNil(t, badClient)
defer badClient.Close()
_, err = r.GetTasksWithoutConfigs(taskQ)
_, err = badClient.GetTasksWithoutConfigs(taskQ)
// Check that we do error out of retrying
require.Error(t, err)
@ -195,12 +195,6 @@ func TestRealisClient_ReestablishConn(t *testing.T) {
assert.NoError(t, err)
}
func TestGetCACerts(t *testing.T) {
certs, err := realis.GetCerts("./examples/certs")
require.NoError(t, err)
assert.Equal(t, len(certs.Subjects()), 2)
}
func TestRealisClient_CreateJob_Thermos(t *testing.T) {
role := "vagrant"