Граф коммитов

21 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 81ad4dd64b Revert "[ci] Use `gofmt` to avoid `go fmt` downloading dependencies"
This reverts commit 75c5410110.
2020-04-13 12:59:36 +02:00
Mislav Marohnić dcec289400 Remove support for Go < 1.11 2020-03-05 14:42:30 +01:00
Mislav Marohnić 1fbca9670d [test] Fix install_test
https://travis-ci.org/github/hub/jobs/605285000
2019-10-31 02:48:18 +01:00
Mislav Marohnić 875d4288bf [help] Enable `hub help --web <command>`
- `share/man/man1/*.html` now live in `share/doc/hub-doc/*.html`
- `help.format` git config values "web" & "html" now supported
2019-10-31 01:58:47 +01:00
Mislav Marohnić 75c5410110 [ci] Use `gofmt` to avoid `go fmt` downloading dependencies
`go fmt` doesn't seem to respect `-mod=vendor`
https://github.com/golang/go/issues/27841

Instead try using `gofmt` which doesn't trigger downloading dependencies
in the first place. However, `gofmt` affects files under `vendor/`, so
we reset that before checking for changes.
2019-10-03 01:12:53 +02:00
Mislav Marohnić a81bf2bb7d Test install script in CI 2018-06-14 12:04:31 +02:00
Mislav Marohnić 1c5978f36c Extract checking of formatting to shell function 2018-06-14 11:57:23 +02:00
Mislav Marohnić 818224bfa0 Skip `go fmt` CI check for Go 1.8
`go fmt ./...` affects the `vendor/` directory before Go 1.9.
2018-06-09 18:17:54 +02:00
Mislav Marohnić f650a22525 Extract code coverage summary to its own script 2018-06-09 18:10:52 +02:00
Mislav Marohnić 00e1b9957d Remove obsolete build steps
This was from the time when we tried to have hub build even if it wasn't
checkout out within a local GOPATH. This change assumes a working Go
environment.
2018-06-08 20:57:27 +02:00
Mislav Marohnić 802542d713 Support floating point minimum coverage treshold 2018-06-07 17:46:35 +02:00
Mislav Marohnić 45e575e759 Enable passing list of cukes to `script/test` for faster runs 2018-06-07 16:07:20 +02:00
Mislav Marohnić ca87a5116e Measure code coverage between tests
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
2018-06-07 14:44:56 +02:00
Mislav Marohnić 76eec4d287 Have CI fail if go code wasn't properly formatted 2018-01-22 22:37:25 +01:00
Mislav Marohnić 38db23dd62 Improve bootstrap, build and test scripts
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
2014-02-07 12:44:56 +01:00
Jingwen Owen Ou d0eeb375bc Add comments to scripts 2014-01-07 14:22:14 -08:00
Jingwen Owen Ou 4daf45dd62 Update README to install/update from source
We lock down dependencies with Godep so `go build` won't work
2014-01-01 11:18:24 -08:00
Jingwen Owen Ou 0210d4c638 Upgrade to Go 1.2 2013-12-01 22:03:20 -08:00
Jingwen Owen Ou a98278ac15 Update scripts to point to godep 2013-11-14 08:39:25 -08:00
Jingwen Owen Ou ebc91a30f9 Add #! to scripts 2013-10-10 20:32:46 -07:00
Jingwen Owen Ou abbc4113a3 Add some basic scripts 2013-10-10 20:26:16 -07:00