Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #328 from vania-pooh/master
Browse files Browse the repository at this point in the history
Added version information to /ping (fixes #327)
  • Loading branch information
aandryashin authored Jan 9, 2018
2 parents ec76bcb + be2cba9 commit f0d4011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ func ping(w http.ResponseWriter, _ *http.Request) {
Uptime string `json:"uptime"`
LastReloadTime string `json:"lastReloadTime"`
NumRequests uint64 `json:"numRequests"`
}{time.Since(startTime).String(), conf.LastReloadTime.String(), getSerial()})
Version string `json:"version"`
}{time.Since(startTime).String(), conf.LastReloadTime.String(), getSerial(), gitRevision})
}

const videoPath = "/video/"
Expand Down
4 changes: 4 additions & 0 deletions selenoid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
func init() {
enableFileUpload = true
videoOutputDir, _ = ioutil.TempDir("", "selenoid-test")
gitRevision = "test-revision"
srv = httptest.NewServer(handler())
}

Expand Down Expand Up @@ -562,6 +563,9 @@ func TestPing(t *testing.T) {
AssertThat(t, hasLastReloadTime, Is{true})
_, hasNumRequests := data["numRequests"]
AssertThat(t, hasNumRequests, Is{true})
version, hasVersion := data["version"]
AssertThat(t, hasVersion, Is{true})
AssertThat(t, version, EqualTo{"test-revision"})
}

func TestServeAndDeleteFile(t *testing.T) {
Expand Down

0 comments on commit f0d4011

Please sign in to comment.