提交 23c2d96a 编写于 作者: 徐超越

Create codecov

Rename codecov to codecov.yml

Update codecov.yml

Update codecov.yml

wip-github-action

wip-github-action

remove tests under internal package
从internal目录下移除测试项目,因为在此包里的单测运行时会依赖外部环境(model.init()方法导致);

issue 90; 修改go ver为1.17

remove test.yml

make a failed case

Revert "make a failed case"

This reverts commit 9f3a7dd630baa7ee782e1272ad8fac197040b3ce.

t#
上级 bf90934e
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)
name: Tests
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Test
run: go test -v ./...
package notification
import (
notification "github.com/go-atomci/atomci/internal/core/notification/impl"
messages "github.com/go-atomci/atomci/internal/core/notification/types"
"testing"
)
func TestNotifyEmail(t *testing.T) {
notification.EmailHandler().Send(messages.StepCallbackResult{
StageName: "",
PublishName: "",
StepName: "",
Status: 1,
})
}
func TestNotifyDingRobot(t *testing.T) {
notification.DingRobotHandler().Send(messages.StepCallbackResult{
StageName: "aa",
PublishName: "bb",
StepName: "cc",
Status: 0,
})
}
/*
Copyright 2021 The AtomCI Group Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package pipelinemgr
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetStatus(t *testing.T) {
t.Run("jenkins", func(t *testing.T) {
assert.Nil(t, nil)
})
}
......@@ -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)
}
package utils
import (
"github.com/stretchr/testify/assert"
"testing"
)
func Test_NEWUUID_SHOULD_NOT_EMPTY(t *testing.T) {
uuid := NewUUID()
assert.NotEmpty(t, uuid)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册