Skip to content

Commit

Permalink
Clean up new repository and add coverage reports
Browse files Browse the repository at this point in the history
 * Remove duplicated .editorconfig
 * Introduce global style check to only run it once on CI
 * Make crosscompile optional -> build is green before they are finished.
 * Move crosscompile builds to the end so they are build last
  • Loading branch information
ruflin committed Dec 2, 2015
1 parent 9fd67b4 commit 3d09d57
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 78 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Directories
/.idea
/build

# Files
.DS_Store
22 changes: 12 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,30 @@ os:
- osx

env:
- TARGETS="-C libbeat check"
- TARGETS="check"
# - TARGETS="testsuite ES_HOST=elasticsearch-173"
- TARGETS="-C libbeat testsuite ES_HOST=elasticsearch-210"
- TARGETS="-C topbeat testsuite"
- TARGETS="-C filebeat testsuite"
- TARGETS="-C packetbeat testsuite"
- TARGETS="-C libbeat crosscompile"
- TARGETS="-C topbeat check testsuite"
- TARGETS="-C filebeat check testsuite"
- TARGETS="-C filebeat crosscompile"
- TARGETS="-C packetbeat check testsuite"

matrix:
exclude:
- os: osx
env: TARGETS="check"
- os: osx
env: TARGETS="-C filebeat crosscompile"
- os: osx
env: TARGETS="-C libbeat crosscompile"
- os: osx
env: TARGETS="-C libbeat testsuite ES_HOST=elasticsearch-210"
fast_finish: true
allow_failures:
- env: TARGETS="-C libbeat crosscompile"
- env: TARGETS="-C filebeat crosscompile"


addons:
apt:
Expand All @@ -48,11 +55,6 @@ before_install:
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

# TODO: needed ?
addonsbefore_install:
- ln -s $TRAVIS_BUILD_DIR $HOME/gopath/src/libbeat


install:
- true

Expand All @@ -66,7 +68,7 @@ notifications:

after_success:
# Copy full.cov to coverage.txt because codecov.io requires this file
- test -f filebeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f filebeat/filebeat/build/coverage/full.cov
- test -f filebeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f filebeat/build/coverage/full.cov
- test -f packetbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f packetbeat/build/coverage/full.cov
- test -f topbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f topbeat/build/coverage/full.cov
- test -f libbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f libbeat/build/coverage/full.cov
Expand Down
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
BUILD_DIR=build
COVERAGE_DIR=${BUILD_DIR}/coverage

# Runs testsuites for all beats
testsuite:
make -C filebeat testsuite
make -C packetbeat testsuite
make -C topbeat testsuite
make -C winlogbeat testsuite
make -C libbeat testsuite

.PHONY: coverage-report
coverage-report:
mkdir -p ${COVERAGE_DIR}
# Writes atomic mode on top of file
echo 'mode: atomic' > ./${COVERAGE_DIR}/full.cov
# Collects all coverage files and skips top line with mode
-tail -q -n +2 ./filebeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./packetbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./topbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./winlogbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./libbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
go tool cover -html=./${COVERAGE_DIR}/full.cov -o ${COVERAGE_DIR}/full.html


clean:
make -C filebeat clean
make -C packetbeat clean
make -C topbeat clean
make -C winlogbeat clean
make -C libbeat clean

check:
make -C filebeat check
make -C packetbeat check
make -C topbeat check
make -C winlogbeat check
make -C libbeat check
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Travis](https://travis-ci.org/elastic/beats.svg?branch=master)](https://travis-ci.org/elastic/beats)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/p7y92i6pp2v7vnrd/branch/master?svg=true)](https://ci.appveyor.com/project/elastic-beats/beats/branch/master)
[![GoReportCard](http://goreportcard.com/badge/elastic/beats)](http://goreportcard.com/report/elastic/beats)
[![codecov.io](https://codecov.io/github/elastic/beats/coverage.svg?branch=master)](https://codecov.io/github/elastic/beats?branch=master)

# Beats - Lightweight shippers for Elasticsearch & Logstash

Expand Down
17 changes: 0 additions & 17 deletions libbeat/.editorconfig

This file was deleted.

17 changes: 0 additions & 17 deletions packetbeat/.editorconfig

This file was deleted.

17 changes: 0 additions & 17 deletions topbeat/.editorconfig

This file was deleted.

17 changes: 0 additions & 17 deletions winlogbeat/.editorconfig

This file was deleted.

0 comments on commit 3d09d57

Please sign in to comment.