Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test and coverage #2

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/cover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test
on: [push]
env:
GO111MODULE: "on"

jobs:
test:
name: Tests and Coverage
runs-on: ubuntu-latest
steps:

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go get -d -v

- name: Run tests and calculate code coverage
run: |
out=$(go test ./... -coverprofile cover.out)
out="${out//'%'/'%25'}"
out="${out//$'\n'/'%0A'}"
out="${out//$'\r'/'%0D'}"
echo -e "::set-env name=COVER::$out"
go tool cover -html=cover.out -o coverage.html

- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage.html

- name: Comment
uses: mshick/add-pr-comment@v1
with:
message: |
**code coverage: **
${{ env.COVER }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true # This is the default
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# go-data-routing

![Test](https://github.com/Zensey/go-data-routing/workflows/Test/badge.svg?branch=dev)


The library provides a pipeline engine for stream processing of data.
It is based on the concept of EIP (enterprise integration patterns).

Expand Down
3 changes: 2 additions & 1 deletion route_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (r *Probe) Run() {}

func TestEnrich(t *testing.T) {

for i := 0; i < 1000; i++ {
for i := 0; i < 100; i++ {
Enrich(t)
}
}
Expand Down Expand Up @@ -51,6 +51,7 @@ func Enrich(t *testing.T) {
}()
rc.Run()
rc.Print()

// check that all nodes are stoped
for _, r := range rc.routes {
for _, n := range *r {
Expand Down