travis: staged travis builds

This PR introduces staging to our travis pipeline. Currently all
instances perform:

 - compilation of lnd
 - linting
 - compilation and installation of btcd binaries
 - installation of bitcoind binaries

In total this adds about 3 minutes to each of our 5 instances, resulting in
roughly 12 minutes of redundant execution time. Additionally, if if a build
fails to compile or lint we detect this 5 separate times, consuming precious
instances from other builds.

We alleviate this by adding an initial Build phase, which runs a single
instance performing the actions above. This has the benefit of quickly sanity
checking the pr before moving on to the more expensive unit or integration test
suites, and failing faster for common mistakes. It also warms up the build
caches for the Test stage in one fell swoop.

For instance, if 5 people push changes at the same time, they can all get
immediate feedback regarding compilation or linting issues, and potentially
save hours waiting for other people's test to finish or fail before finding out
they had a spelling error. This doesn't alleviate all possible issues, e.g. the
5 instances may already be consumed by test suites, but it does make a sizable
step towards minimizing time-to-failure in common scenarios.
This commit is contained in:
Conner Fromknecht 2019-12-04 19:53:20 -08:00
parent 00ec9148e9
commit d7af7934b8
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
2 changed files with 21 additions and 27 deletions

@ -14,33 +14,29 @@ go:
env: env:
global: global:
- GOCACHE=$HOME/.go-build - GOCACHE=$HOME/.go-build
matrix:
- RACE=true
- ITEST=true
- NEUTRINO_ITEST=true
- BITCOIND_ITEST=true
- COVER=true
sudo: required sudo: required
before_script: bash ./scripts/install_bitcoind.sh
jobs:
include:
- stage: Build
script: script:
- export GO111MODULE=on - make unit pkg=... case=_NONE_
- bash ./scripts/install_bitcoind.sh - make lint
- make btcd
# Run unit tests with race condition detector. - stage: Test
- 'if [ "$RACE" = true ]; then make travis-race ; fi' script: make travis-cover
name: Unit Cover
# Run btcd integration tests. - script: make travis-race
- 'if [ "$ITEST" = true ]; then make travis-itest; fi' name: Unit Race
- script: make itest
# Run neutrino integration tests. name: Btcd Integration
- 'if [ "$NEUTRINO_ITEST" = true ]; then make travis-itest backend=neutrino; fi' - script: make itest backend=bitcoind
name: Bitcoind Integration
# Run bitcoind integration tests. - script: make itest backend=neutrino
- 'if [ "$BITCOIND_ITEST" = true ]; then make travis-itest backend=bitcoind; fi' name: Neutrino Integration
# Run unit tests and generate coverage report.
- 'if [ "$COVER" = true ]; then make travis-cover; fi'
after_script: after_script:
- LOG_FILES=./lntest/itest/*.log - LOG_FILES=./lntest/itest/*.log

@ -135,11 +135,9 @@ goveralls: $(GOVERALLS_BIN)
$(GOVERALLS_BIN) -coverprofile=coverage.txt -service=travis-ci $(GOVERALLS_BIN) -coverprofile=coverage.txt -service=travis-ci
travis-race: lint btcd unit-race travis-race: btcd unit-race
travis-cover: lint btcd unit-cover goveralls travis-cover: btcd unit-cover goveralls
travis-itest: lint itest
# ============= # =============
# FLAKE HUNTING # FLAKE HUNTING