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

Issue 90 unittest #95

Closed
18 changes: 18 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test and coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Run coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
25 changes: 0 additions & 25 deletions internal/core/notification/notify_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/core/pipelinemgr/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ func TestGetStatus(t *testing.T) {
t.Run("jenkins", func(t *testing.T) {
assert.Nil(t, nil)
})
}
}
6 changes: 3 additions & 3 deletions utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestAesCrypto(t *testing.T) {
crypted := base64.StdEncoding.EncodeToString(AesEny([]byte("Hello")))
log.Printf("%s", crypted)
assert.NotEmpty(t, crypted)
encrypted := base64.StdEncoding.EncodeToString(AesEny([]byte("Hello")))
log.Printf("%s", encrypted)
assert.NotEmpty(t, encrypted)
}
12 changes: 12 additions & 0 deletions utils/uuid_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package utils

import (
"github.com/stretchr/testify/assert"
"testing"
)

func Test_NEWUUID_SHOULD_NOT_EMPTY(t *testing.T) {
uuid := NewUUID()

assert.NotEmpty(t, uuid)
}