mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
Make pkg code change trigger ci workflow (#23312)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
03a4f60b6e
commit
5276529524
1
.github/workflows/code-checker.yaml
vendored
1
.github/workflows/code-checker.yaml
vendored
@ -11,6 +11,7 @@ on:
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
- 'internal/**'
|
||||
- 'pkg/**'
|
||||
- 'cmd/**'
|
||||
- 'build/**'
|
||||
- '.github/workflows/code-checker.yaml'
|
||||
|
||||
1
.github/workflows/mac.yaml
vendored
1
.github/workflows/mac.yaml
vendored
@ -10,6 +10,7 @@ on:
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
- 'internal/**'
|
||||
- 'pkg/**'
|
||||
- 'cmd/**'
|
||||
- 'build/**'
|
||||
- '.github/workflows/mac.yaml'
|
||||
|
||||
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
@ -7,6 +7,7 @@ on:
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
- 'internal/**'
|
||||
- 'pkg/**'
|
||||
- 'cmd/**'
|
||||
- 'build/**'
|
||||
- '.github/workflows/main.yaml'
|
||||
@ -21,6 +22,7 @@ on:
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
- 'internal/**'
|
||||
- 'pkg/**'
|
||||
- 'cmd/**'
|
||||
- 'build/**'
|
||||
- '.github/workflows/main.yaml'
|
||||
|
||||
1
Makefile
1
Makefile
@ -95,6 +95,7 @@ static-check: getdeps
|
||||
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./internal/...
|
||||
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./cmd/...
|
||||
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./tests/integration/...
|
||||
@source $(PWD)/scripts/setenv.sh && cd pkg && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ../.golangci.yml ./...
|
||||
|
||||
verifiers: build-cpp getdeps cppcheck fmt static-check
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
package metrics
|
||||
|
||||
import (
|
||||
// #nosec
|
||||
_ "net/http/pprof"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
@ -19,8 +19,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"github.com/samber/lo"
|
||||
"go.uber.org/zap"
|
||||
|
||||
config "github.com/milvus-io/milvus/pkg/config"
|
||||
"github.com/milvus-io/milvus/pkg/log"
|
||||
|
||||
@ -26,7 +26,7 @@ BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/setenv.sh
|
||||
|
||||
# run unittest
|
||||
echo "Running unittest under ./internal"
|
||||
echo "Running unittest under ./internal & ./pkg"
|
||||
|
||||
# starting the timer
|
||||
beginTime=`date +%s`
|
||||
@ -40,6 +40,15 @@ for d in $(go list ./internal/... | grep -v -e vendor -e kafka -e planparserv2/g
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
pushd pkg
|
||||
for d in $(go list ./... | grep -v -e vendor -e kafka -e planparserv2/generated -e mocks); do
|
||||
go test -race ${APPLE_SILICON_FLAG} -v -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
|
||||
if [ -f profile.out ]; then
|
||||
grep -v kafka profile.out | grep -v planparserv2/generated | grep -v mocks | sed '1d' >> ${FILE_COVERAGE_INFO}
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
popd
|
||||
endTime=`date +%s`
|
||||
|
||||
echo "Total time for go unittest:" $(($endTime-$beginTime)) "s"
|
||||
|
||||
@ -30,9 +30,10 @@ if [[ "$(uname -m)" == "arm64" ]]; then
|
||||
APPLE_SILICON_FLAG="-tags dynamic"
|
||||
fi
|
||||
|
||||
# ignore MinIO,S3 unittes
|
||||
# ignore MinIO,S3 unittests
|
||||
MILVUS_DIR="${ROOT_DIR}/internal/"
|
||||
echo "Running go unittest under $MILVUS_DIR"
|
||||
PKG_DIR="${ROOT_DIR}/pkg/"
|
||||
echo "Running go unittest under $MILVUS_DIR & $PKG_DIR"
|
||||
|
||||
TEST_ALL=1
|
||||
TEST_TAG="ALL"
|
||||
@ -70,7 +71,7 @@ go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/proxy/..."
|
||||
function test_querynode()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/querynode/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynode/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynodev2/..." -failfast -count=1
|
||||
}
|
||||
|
||||
|
||||
@ -114,6 +115,16 @@ go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/typeutil/..." -fa
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/importutil/..." -failfast -count=1
|
||||
}
|
||||
|
||||
function test_pkg()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/common/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/config/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/log/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/mq/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/tracer/..." -failfast -count=1
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${PKG_DIR}/util/..." -failfast -count=1
|
||||
}
|
||||
|
||||
function test_datanode
|
||||
{
|
||||
|
||||
@ -172,6 +183,7 @@ test_allocator
|
||||
test_tso
|
||||
test_config
|
||||
test_util
|
||||
test_pkg
|
||||
test_metastore
|
||||
}
|
||||
|
||||
@ -223,6 +235,9 @@ case "${TEST_TAG}" in
|
||||
util)
|
||||
test_util
|
||||
;;
|
||||
pkg)
|
||||
test_pkg
|
||||
;;
|
||||
metastore)
|
||||
test_metastore
|
||||
;;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user