Go to file
Changjun Ji a13481ecd1
Merge pull request #15 from CarlJi/0522
add example into README document
2020-05-24 16:33:50 +08:00
.github/workflows upload coverage report to codecov 2020-05-23 16:38:17 +08:00
cmd add goc profile command (#11) 2020-05-23 10:14:11 +08:00
pkg add goc profile command (#11) 2020-05-23 10:14:11 +08:00
tests Migrate qbox/goc to qiniu/goc (#8) 2020-05-21 14:30:41 +08:00
.gitignore add goc profile command (#11) 2020-05-23 10:14:11 +08:00
go.mod Migrate qbox/goc to qiniu/goc (#8) 2020-05-21 14:30:41 +08:00
go.sum add example into README document 2020-05-24 16:31:03 +08:00
goc.go adjust project directory structure to be more friendly to use (#10) 2020-05-21 14:58:40 +08:00
LICENSE Update License (#1) 2020-05-07 21:03:36 +08:00
OWNERS init the directory structure and create OWNERS file (#2) 2020-05-09 15:34:47 +08:00
README.md add example into README document 2020-05-24 16:31:03 +08:00

goc

Go Report Card codecov GoDoc

goc is a comprehensive coverage testing system for The Go Programming Language, especially for some complex scanrioslike system testing code coverage collecting and accurate testing.

Note:

This readme and related documentation are Work in Progress.

Installation

To install goc tool, you need to install Go first (version 1.11+ is required), then:

go get -u github.com/qiniu/goc

Examples

You can use goc tool in many scenarios.

Code Coverage Collection for your Golang System Tests

Goc can collect code coverages at run time for your long-run golang applications. To do that, normally just need three steps:

  1. use goc server to start a service registry center:
    ➜  simple-go-server git:(master) ✗ goc server
    
  2. use goc build to build the target service, and run the generated binary. Here let's take the simeple-go-server project as example:
    ➜  simple-go-server git:(master) ✗ goc build .
    ... // omit logs
    ➜  simple-go-server git:(master) ✗ ./simple-go-server  
    
  3. use goc profile to get the code coverage profile of the started simple server above:
    ➜  simple-go-server git:(master) ✗ goc profile
    mode: atomic
    enricofoltran/simple-go-server/main.go:30.13,48.33 13 1
    enricofoltran/simple-go-server/main.go:48.33,50.3 1 0
    enricofoltran/simple-go-server/main.go:52.2,65.12 5 1
    enricofoltran/simple-go-server/main.go:65.12,74.46 7 1
    enricofoltran/simple-go-server/main.go:74.46,76.4 1 0
    ...   
    
    Enjoy, Have Fun!

RoadMap

  • Support code coverage collection for system testing.
  • Support develop mode towards accurate testing.
  • Support code coverage diff based on Pull Requst.
  • Support code coverage counters clear for the services under test in runtime.
  • Optimize the performance costed by code coverage counters.

Contributing

We welcome all kinds of contribution, including bug reports, feature requests, documentation improvements, UI refinements, etc.

License

Goc is released under the Apache 2.0 license. See LICENSE.txt