commit
304aaf0504
@ -44,7 +44,6 @@ Goc can collect code coverages at runtime for your long-run golang applications.
|
|||||||
enricofoltran/simple-go-server/main.go:74.46,76.4 1 0
|
enricofoltran/simple-go-server/main.go:74.46,76.4 1 0
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
Enjoy, Have Fun!
|
|
||||||
|
|
||||||
## RoadMap
|
## RoadMap
|
||||||
- [x] Support code coverage collection for system testing.
|
- [x] Support code coverage collection for system testing.
|
||||||
|
@ -220,13 +220,13 @@ func registerSelf(address string) ([]byte, error) {
|
|||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
resp, err := http.DefaultClient.Do(req)
|
||||||
if err != nil && isNetworkError(err) {
|
if err != nil && isNetworkError(err) {
|
||||||
log.Printf("[goc][WARN]error occured:%v, try again", err)
|
log.Printf("[goc][WARN]error occurred:%v, try again", err)
|
||||||
resp, err = http.DefaultClient.Do(req)
|
resp, err = http.DefaultClient.Do(req)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("registed faile, err:%v", err)
|
return nil, fmt.Errorf("failed to register into coverage center, err:%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
@ -235,7 +235,7 @@ func registerSelf(address string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
err = fmt.Errorf("registed failed, response code %d", resp.StatusCode)
|
err = fmt.Errorf("failed to register into coverage center, response code %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
return body, err
|
return body, err
|
||||||
|
@ -92,7 +92,7 @@ var _ = Describe("E2E", func() {
|
|||||||
Expect(err).To(BeNil(), "the binary cannot be disassembled")
|
Expect(err).To(BeNil(), "the binary cannot be disassembled")
|
||||||
|
|
||||||
cnt := strings.Count(string(out), "GoCover")
|
cnt := strings.Count(string(out), "GoCover")
|
||||||
Expect(cnt).To(BeNumerically(">", 0), "GoCover varibale should be in the binary")
|
Expect(cnt).To(BeNumerically(">", 0), "GoCover variable should be in the binary")
|
||||||
|
|
||||||
cnt = strings.Count(string(out), "main.registerSelf")
|
cnt = strings.Count(string(out), "main.registerSelf")
|
||||||
Expect(cnt).To(BeNumerically(">", 0), "main.registerSelf function should be in the binary")
|
Expect(cnt).To(BeNumerically(">", 0), "main.registerSelf function should be in the binary")
|
||||||
|
Loading…
Reference in New Issue
Block a user