1. 07 6月, 2018 3 次提交
    • M
      Support floating point minimum coverage treshold · 802542d7
      Mislav Marohnić 提交于
      802542d7
    • M
      45e575e7
    • M
      Measure code coverage between tests · ca87a511
      Mislav Marohnić 提交于
      Go has code coverage tooling for test mode, which temporarily rewrites
      the source code to insert annotations which will activate during the
      test run and track progress of executed code. Then, upon process
      completion, that information is dumped into a coverage report.
      
      We can't use this approach for hub, at least not without substantial
      changes. First of all, hub's test coverage is mostly "from the outside",
      utilizing Cucumber to invoke the binary with different arguments and
      inspect the outputs and result. There are some tests in go, but they are
      minimal compared to the cukes.
      
      Second, hub frequently aborts the process on errors via `os.Exit(1)`,
      and those scenarios need to be tested too. However, if the process exits
      prematurely, the code coverage report will never be generated.
      
      To work around this, I first used the go tool that annotates the source:
      
          go tool cover -mode=set -var=LiveCoverage myfile.go
      
      This injects `LiveCoverage.Count[pos] = 1` lines at appropriate places
      all over the source code, and generates a mapping of line/column
      positions in the original source.
      
      Then I rewrite those lines to become a method invocation:
      
          coverage.Record(LiveCoverage, pos)
      
      The new `Record` method will immediately append the information to a
      code coverage report file as soon as it's invoked. This ensures that
      there is coverage information even if the process gets aborted.
      
      This approach works the same for go tests as well as for cukes. They all
      append to the same file. Finally, the rest of Go tooling is used to
      generate an HTML report of code coverage:
      
          go tool cover -html=cover.out
      ca87a511
  2. 23 1月, 2018 1 次提交
  3. 07 2月, 2014 1 次提交
    • M
      Improve bootstrap, build and test scripts · 38db23dd
      Mislav Marohnić 提交于
      Old `script/bootstrap` & `script/build` were unfriendly to Go newbies
      because they require the user having GOPATH set in their environment,
      and either `godep` installed or `hg` to be able to fetch godep.
      
      However, since dependencies are vendored, we don't have any real build
      dependencies except Go itself.
      
      - `script/bootstrap` now checks Go and installs Ruby test bundle
      - `script/build` skips compiling if binary is up to date
      - `script/test` runs both Go and Cucumber test suites
      38db23dd
  4. 08 1月, 2014 1 次提交
  5. 02 1月, 2014 1 次提交
  6. 02 12月, 2013 1 次提交
  7. 15 11月, 2013 1 次提交
  8. 14 11月, 2013 1 次提交
  9. 11 10月, 2013 2 次提交
  10. 10 8月, 2013 1 次提交
  11. 10 7月, 2013 1 次提交