Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Update unit tests & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EngHabu committed Apr 24, 2019
1 parent c8ad280 commit 87168f3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,19 @@ This repo follows [semantic versioning](https://semver.org/).
## Releases

This repository is hooked up with [goreleaser](https://goreleaser.com/). Maintainers are expected to create tags and let goreleaser compose the release message and create a release.

To create a new release, follow these steps:

- Create a PR with your changes.
- [Optional] Create an alpha tag on your branch and push that.
First get existing tags `git describe --abbrev=0 --tags`
Figure out the next alpha version (e.g. if tag is v1.2.3 then you should create a v1.2.4-alpha.0 tag)
Create a tag `git tag v1.2.4-alpha.0`
Push tag `git push --tags`
- Merge your changes and checkout master branch `git checkout master && git pull`
- Bump version tag and push to branch.
First get existing tags `git describe --abbrev=0 --tags`
Figure out the next release version (e.g. if tag is v1.2.3 then you should create a v1.2.4 tag or v1.3.0 or a v2.0.0 depending on what has changed. Refer to [Semantic Versioning](https://semver.org/) for information about when to bump each)
Create a tag `git tag v1.2.4`
Push tag `git push --tags`

6 changes: 2 additions & 4 deletions profutils/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"
"time"

"github.com/lyft/flytestdlib/config"
"net/http"

"github.com/lyft/flytestdlib/version"

Expand All @@ -32,7 +30,7 @@ const (
type BuildVersion struct {
Build string `json:"build"`
Version string `json:"version"`
Timestamp time.Time `json:"timestamp,string"`
Timestamp string `json:"timestamp,string"`
}

// Writes a string to the Http output stream
Expand Down
4 changes: 2 additions & 2 deletions profutils/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ func TestVersionHandler(t *testing.T) {
URL: &testURL,
}

version.BuildTime = time.Now()
version.BuildTime = time.Now().String()

http.DefaultServeMux.ServeHTTP(writer, request)
assert.Equal(t, http.StatusOK, writer.Status)
assert.NotNil(t, writer.Body)
bv := BuildVersion{}
assert.NoError(t, json.Unmarshal(writer.Body, &bv))
assert.Equal(t, bv.Timestamp.Unix(), version.BuildTime.Unix())
assert.Equal(t, bv.Timestamp, version.BuildTime)
assert.Equal(t, bv.Build, version.Build)
assert.Equal(t, bv.Version, version.Version)
}
Expand Down
2 changes: 1 addition & 1 deletion version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (dFormat) Format(e *logrus.Entry) ([]byte, error) {
func TestLogBuildInformation(t *testing.T) {

n := time.Now()
BuildTime = n
BuildTime = n.String()
buf := bytes.NewBufferString("")
logrus.SetFormatter(dFormat{})
logrus.SetOutput(buf)
Expand Down

0 comments on commit 87168f3

Please sign in to comment.