Skip to content
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: 'weizhoublue'

**1 Code requirement**

necessary comment for your addtional code , and comment for goDoc
necessary comment for your additional code , and comment for goDoc

function and variable name must not be at will

Expand Down
2 changes: 1 addition & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
description: This issue request already exists
color: 0fd3d7
- name: issue/ignore
description: This issue or pull request will ingore
description: This issue or pull request will ignore
color: 15d3d7
- name: issue/stale
description: This issue is inactive
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# it is trigger by tag event:
# 1 build the release image, push images to ghcr.io, and buid image like: ghcr.io/weizhoublue/github-action-test/controllerimage:v1.0.0
# 1 build the release image, push images to ghcr.io, and build image like: ghcr.io/weizhoublue/github-action-test/controllerimage:v1.0.0
# 2 package the chart package, update index.yaml and commit to '/charts' of branch 'github_pages' ( PR with label pr/release/robot_update_githubpage )
# 3 create changelog file, commit to '/changelogs' of branch 'github_pages' for githubPage ( PR with label pr/release/robot_update_githubpage )
# 4 commit '/docs' to '/docs' of branch 'github_pages'
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
echo ::set-output name=changelog_path::${changelog_path}
cp ./changelog-result/${changelog_file} ./changelog-result/changelog.md

# create a github relase
# create a github release
# https://github.com/ncipollo/release-action
- name: Create Release
id: create_release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-image-beta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build the Beta image with customized tag ,under an clean env , from specified Branch
# buid image like: ghcr.io/weizhoublue/github-action-test/controllerimage-{beta}:{yourTag}
# build image like: ghcr.io/weizhoublue/github-action-test/controllerimage-{beta}:{yourTag}
name: Build Image Beta

on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-image-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# build the ci image with cache , which can improve workflow execution time
# it is trigger by pr and cache-cleaner workflow
# buid image like: ghcr.io/weizhoublue/github-action-test/controllerimage-ci:{commitId}
# build image like: ghcr.io/weizhoublue/github-action-test/controllerimage-ci:{commitId}
name: Auto Build Image CI

env:
Expand All @@ -22,7 +22,7 @@ on:
branches:
- main
- release-*
# auto triggerd by another workflow
# auto triggered by another workflow
workflow_run:
workflows:
- "Auto Clean CI Cache"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-image-release.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build the Beta image with customized tag ,under an clean env , from specified Branch
# buid image like: ghcr.io/weizhoublue/github-action-test/controllerimage:{yourTag}
# build image like: ghcr.io/weizhoublue/github-action-test/controllerimage:{yourTag}
name: Build Image Release

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-lint-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo "trigger by pull_request"
echo ::set-output name=ref::${{ github.sha }}
else
echo "error, trigger by unknow event ${{ github.event_name }}"
echo "error, trigger by unknown event ${{ github.event_name }}"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-release-image.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build the release image under an clean env , and it is trigger by tag event
# buid image like: ghcr.io/weizhoublue/github-action-test/controllerimage:v1.0.0
# build image like: ghcr.io/weizhoublue/github-action-test/controllerimage:v1.0.0

# Reusable workflows can't call other reusable workflows.
# Any environment variables set in an env context defined at the workflow level in the caller workflow are not propagated to the called workflow.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/debug-context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
# weizhoublue/github_action_test
echo "github.repository = ${{ github.repository }}"
# =============== pull_request or pull_request_target
# base_ref: avaliable for pull_request or pull_request_target event , The base_ref or target branch of the pull request
# base_ref: available for pull_request or pull_request_target event , The base_ref or target branch of the pull request
echo "github.base_ref = ${{ github.base_ref }}"
# head_ref: avaliable for pull_request or pull_request_target event, The head_ref or source branch of the pull request
# head_ref: available for pull_request or pull_request_target event, The head_ref or source branch of the pull request
echo "github.head_ref = ${{ github.head_ref }}"
# ================= for all
# The commit SHA that triggered the workflow run.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
# rules: examples/rules/custom.js
# ignore_files: 'vendor/'

- uses: bahmutov/npm-install@v1
- name: Lint Markdown Spell
run: |
apt-get install npm
npm install markdown-spellcheck -g
make lint-markdown-spell
2 changes: 1 addition & 1 deletion .github/workflows/pr-label-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# make sure the pr is labled as wanted, case: we could generate changelog by the pr label
# make sure the pr is labeled as wanted, case: we could generate changelog by the pr label
name: PR Label Check

# Trigger the workflow on pull requests only
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ generate-k8s-api: ## Generate Cilium k8s API client, deepcopy and deepequal Go s


.PHONY: precheck
precheck: ## Peform build precheck for the source code.
precheck: ## Perform build precheck for the source code.
ifeq ($(SKIP_K8S_CODE_GEN_CHECK),"false")
@$(ECHO_CHECK) tools/k8s-code-gen/verify-codegen.sh
$(QUIET) tools/k8s-code-gen/verify-codegen.sh
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# github test


## github workflow badge

[![Auto Release Version](https://github.com/weizhoublue/github-action-test/actions/workflows/auto-release.yaml/badge.svg)](https://github.com/weizhoublue/github-action-test/actions/workflows/auto-release.yaml)
Expand All @@ -25,13 +24,10 @@ this is from <https://sonarcloud.io>

## test coverage report

this is from <https://coveralls.io>
this is from <https://coveralls.io>

[![Coverage Status](https://coveralls.io/repos/github/weizhoublue/github-action-test/badge.svg?branch=main)](https://coveralls.io/github/weizhoublue/github-action-test?branch=main)

this is from <https://about.codecov.io>

[![codecov](https://codecov.io/gh/weizhoublue/github-action-test/branch/main/graph/badge.svg?token=Y50HD9H1EA)](https://codecov.io/gh/weizhoublue/github-action-test)



2 changes: 1 addition & 1 deletion charts/spiderpool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ spiderpoolController:
pprofEnabled: false

gc:
# gloabl enable
# global enable
enabled: true
# if enabled=false, ignore this
gcTerminatingPodIpEnabled: true
Expand Down
13 changes: 9 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Your documentation's first page , The path is relative to the "root" option
# Your documentation's first page , The path is relative to the "root" option

readme: ./README.md
# Your documentation's table of content , The path is relative to the "root" option
# If you don't specify a summary, and GitBook does not find a SUMMARY.md file at the root of your docs, GitBook will infer the table of contents from the folder structure and the Markdown files below.
# summary format: https://docs.gitbook.com/integrations/git-sync/content-configuration#summary

## Your documentation's table of content , The path is relative to the "root" option

## If you don't specify a summary, and GitBook does not find a SUMMARY.md file at the root of your docs, GitBook will infer the table of contents from the folder structure and the Markdown files below

## summary format: <https://docs.gitbook.com/integrations/git-sync/content-configuration#summary>

summary: ./SUMMARY.md
2 changes: 1 addition & 1 deletion docs/configuration/env.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# enviroment of spiderpool controller and spiderpool agent
# environment of spiderpool controller and spiderpool agent
8 changes: 4 additions & 4 deletions docs/contributing/development/changelog.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# changelog

## how automatically generate the verison changelog
## how automatically generate the version changelog

### 1 all PR should be labeled with "pr/release/***" and could be merged

### 2 when push a tag, automatically create the changelog

the changelog content include:

(1) New Features: it include all PR labeld with "pr/release/feature-new"
(1) New Features: it include all PR labelled with "pr/release/feature-new"

(2) Changed Features: it include all PR labeld with "pr/release/feature-changed"
(2) Changed Features: it include all PR labelled with "pr/release/feature-changed"

(3) Fixes: it include all PR labeld with "pr/release/bug"
(3) Fixes: it include all PR labelled with "pr/release/bug"

(4) all historical commit within this version

Expand Down
1 change: 0 additions & 1 deletion docs/contributing/development/daily_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ With cache acceleration, build two ci image and push to ghcr
(2) ****-ci:${ref}-rate : image who turns on 'go race' and 'deadlock detect'

the CI will clean ci images at interval

2 changes: 2 additions & 0 deletions docs/contributing/development/pullrequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ check from <https://www.codefactor.io>
## action: check code spell error

check on local machine

```
make lint-code-spell
```

fix on local machine

```
make fix-code-spell
```
Expand Down
2 changes: 1 addition & 1 deletion images/controllerimage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARG NOOPT
ARG QUIET_MAKE

COPY . /src
#go to the controler directory and make
#go to the controller directory and make
WORKDIR /src/cmd/controller
RUN make GOARCH=${TARGETARCH} \
RACE=${RACE} NOSTRIP=${NOSTRIP} NOOPT=${NOOPT} QUIET_MAKE=${QUIET_MAKE} \
Expand Down
24 changes: 12 additions & 12 deletions pkg/lock/lock_fast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ var _ = Describe("repeated call func for performance test", func() {
// we create a new experiment
// Experiments are thread-safe
// https://pkg.go.dev/github.com/onsi/gomega@v1.18.1/gmeasure#NewExperiment
experiment := gmeasure.NewExperiment("perfomance test sample")
experiment := gmeasure.NewExperiment("performance test sample")
// 把性能数据 追加到 测试报告中
AddReportEntry(experiment.Name, experiment)

Expand All @@ -257,7 +257,7 @@ var _ = Describe("repeated call func for performance test", func() {
// 传入回调格式: func()
experiment.MeasureDuration("time-test1", func() {
// 在此 书写 被性能测试的代码
fmt.Printf("perfomance test1 code here\n")
fmt.Printf("performance test1 code here\n")
for i := 0; i <= 1; i++ {
t := i * i
if t < 0 {
Expand All @@ -271,10 +271,10 @@ var _ = Describe("repeated call func for performance test", func() {
// 可以追加一些 修饰符
experiment.MeasureDuration("time-test2", func() {
// 在此 书写 被性能测试的代码
fmt.Printf("perfomance test2 code here\n")
fmt.Printf("performance test2 code here\n")
// idx 是 第几次运行,其序号从 0 开始
time.Sleep(time.Duration((idx+1)*30) * time.Millisecond)
}, gmeasure.Annotation("this is annotaion for time test2"))
}, gmeasure.Annotation("this is annotation for time test2"))

// MeasureValue 测试 返回值
// https://pkg.go.dev/github.com/onsi/gomega@v1.18.1/gmeasure#Experiment.MeasureValue
Expand Down Expand Up @@ -319,7 +319,7 @@ var _ = Describe("repeated call func for performance test", func() {

// 方式2:使用 Stopwatch 测量 时间, 书写 方便 , 还能 暂停计时 , 推荐
It("method by Stopwatch ", Serial, Label("measurement"), func() {
experiment := gmeasure.NewExperiment("perfomance test sample")
experiment := gmeasure.NewExperiment("performance test sample")
AddReportEntry(experiment.Name, experiment)

// https://pkg.go.dev/github.com/onsi/gomega@v1.18.1/gmeasure#SamplingConfig
Expand All @@ -332,26 +332,26 @@ var _ = Describe("repeated call func for performance test", func() {
// 开始启动一个后端协程 计时
stopwatch := experiment.NewStopwatch() // we make a new stopwatch for each sample. Experiments are threadsafe, but Stopwatches are not.

fmt.Printf("do round %v : bussiness 1: step1 here\n", idx)
fmt.Printf("do round %v : business 1: step1 here\n", idx)
time.Sleep(100 * time.Millisecond)
// 对已经消耗的时间 生成一个记录
stopwatch.Record("bussiness1").Reset()

fmt.Printf("do round %v : bussiness 2 we not care\n", idx)
fmt.Printf("do round %v : business 2 we not care\n", idx)
time.Sleep(200 * time.Millisecond)

// reset to record new one
stopwatch.Reset() // Subsequent recorded durations will measure the time elapsed from the moment Reset was called
fmt.Printf("do round %v : bussiness 3: step1 here\n", idx)
fmt.Printf("do round %v : business 3: step1 here\n", idx)
time.Sleep(200 * time.Millisecond)

// 暂停一些 我们不在乎的步骤
stopwatch.Pause()
fmt.Printf("do round %v : bussiness 3: step2 we not care\n", idx)
fmt.Printf("do round %v : business 3: step2 we not care\n", idx)
time.Sleep(50 * time.Millisecond)
stopwatch.Resume()

fmt.Printf("do round %v : bussiness 3: step3 here\n", idx)
fmt.Printf("do round %v : business 3: step3 here\n", idx)
time.Sleep(100 * time.Millisecond)
// 可以追加若干 修饰符
stopwatch.Record("bussiness2", gmeasure.Annotation("this is b2 annotation")).Reset()
Expand All @@ -372,7 +372,7 @@ var _ = Describe("repeated call func for performance test", func() {
It("test other", Serial, Label("measurement"), func() {
// we create a new experiment
// https://pkg.go.dev/github.com/onsi/gomega@v1.18.1/gmeasure#NewExperiment
experiment := gmeasure.NewExperiment("perfomance test other")
experiment := gmeasure.NewExperiment("performance test other")
// 把性能数据 追加到 测试报告中
AddReportEntry(experiment.Name, experiment)

Expand All @@ -381,7 +381,7 @@ var _ = Describe("repeated call func for performance test", func() {
// 我们可以使用其它手段,进行进行测试,然后把 时间测试结果 创建到 experiment 中
experiment.RecordDuration("my other performance test1", 3*time.Second)
// 可追加修饰符
experiment.RecordDuration("my other performance test1", 5*time.Second, gmeasure.Annotation("sample 2rd"))
experiment.RecordDuration("my other performance test1", 5*time.Second, gmeasure.Annotation("sample 2nd"))

// 创建自定义的数值 Sample
// 我们可以使用其它手段,进行进行测试,然后把 数值测试结果的样本 创建到 experiment 中
Expand Down
6 changes: 3 additions & 3 deletions pkg/lock/lock_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
// 在 ginkgo -p 并发运行 测试时,每个ginkgo并发的每一个进程 都会 运行 ,

var _ = BeforeSuite(func() {
fmt.Println("BeforeSuite:we can initial enviroment, for all test before hand here")
fmt.Println("BeforeSuite:we can initial environment, for all test before hand here")

// 当在BeforeSuite 中 setup 依赖服务时,每个并发进程都运行 一份服务,
// 优点是能规避 ginkgo 并发测试 时 的 测试用例之间 数据竞争问题 ,避免相互失败
Expand All @@ -45,7 +45,7 @@ var _ = BeforeSuite(func() {
})

var _ = AfterSuite(func() {
fmt.Println("AfterSuite:we can close enviroment, for all test after hand here")
fmt.Println("AfterSuite:we can close environment, for all test after hand here")
})

// -------------------SynchronizedBeforeSuite 适合用于setup 某个服务 , 使用一个 独立进程来 运行
Expand Down Expand Up @@ -77,7 +77,7 @@ var _ = AfterSuite(func() {
// //allProcessBody , 接收服务的一些信息
// func(address []byte) {
// // 所有集成中,可以创建一个client 接入server
// fmt.Printf(" ceate a client connected to %v , the client can be used by all test case", string(address))
// fmt.Printf(" create a client connected to %v , the client can be used by all test case", string(address))
// DeferCleanup(func() {
// fmt.Printf(" close the client ")
// })
Expand Down
6 changes: 3 additions & 3 deletions pkg/lock/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@
"FileName": "/Users/weizhoulan/Documents/git/github-action-test/pkg/lock/lock_fast_test.go",
"LineNumber": 216
},
"Name": "perfomance test for welan",
"Name": "performance test for welan",
"Value": {
"AsJSON": "{\"Measurements\":[{\"Annotations\":[\"\",\"\",\"\",\"\"],\"Durations\":[1001058667,1001096208,1001114541,1001105125],\"ExperimentName\":\"perfomance test for welan\",\"Name\":\"performance-test1\",\"Note\":\"\",\"PrecisionBundle\":{\"Duration\":100000,\"ValueFormat\":\"%.3f\"},\"Style\":\"\",\"Type\":\"Duration\",\"Units\":\"duration\",\"Values\":null},{\"Annotations\":[\"\",\"\",\"\",\"\"],\"Durations\":[1000112625,1001202708,1001160333,1001166166],\"ExperimentName\":\"perfomance test for welan\",\"Name\":\"performance-test2\",\"Note\":\"\",\"PrecisionBundle\":{\"Duration\":100000,\"ValueFormat\":\"%.3f\"},\"Style\":\"\",\"Type\":\"Duration\",\"Units\":\"duration\",\"Values\":null}],\"Name\":\"perfomance test for welan\"}",
"Representation": "{{bold}}perfomance test for welan\n{{/}}{{bold}}Name {{/}} | {{bold}}N{{/}} | {{bold}}Min {{/}} | {{bold}}Median {{/}} | {{bold}}Mean {{/}} | {{bold}}StdDev{{/}} | {{bold}}Max {{/}}\n=================================================================================\nperformance-test1 [duration] | 4 | 1.0011s | 1.0011s | 1.0011s | 0s | 1.0011s\n---------------------------------------------------------------------------------\nperformance-test2 [duration] | 4 | 1.0001s | 1.0012s | 1.0009s | 500µs | 1.0012s\n"
"AsJSON": "{\"Measurements\":[{\"Annotations\":[\"\",\"\",\"\",\"\"],\"Durations\":[1001058667,1001096208,1001114541,1001105125],\"ExperimentName\":\"performance test for welan\",\"Name\":\"performance-test1\",\"Note\":\"\",\"PrecisionBundle\":{\"Duration\":100000,\"ValueFormat\":\"%.3f\"},\"Style\":\"\",\"Type\":\"Duration\",\"Units\":\"duration\",\"Values\":null},{\"Annotations\":[\"\",\"\",\"\",\"\"],\"Durations\":[1000112625,1001202708,1001160333,1001166166],\"ExperimentName\":\"performance test for welan\",\"Name\":\"performance-test2\",\"Note\":\"\",\"PrecisionBundle\":{\"Duration\":100000,\"ValueFormat\":\"%.3f\"},\"Style\":\"\",\"Type\":\"Duration\",\"Units\":\"duration\",\"Values\":null}],\"Name\":\"performance test for welan\"}",
"Representation": "{{bold}}performance test for welan\n{{/}}{{bold}}Name {{/}} | {{bold}}N{{/}} | {{bold}}Min {{/}} | {{bold}}Median {{/}} | {{bold}}Mean {{/}} | {{bold}}StdDev{{/}} | {{bold}}Max {{/}}\n=================================================================================\nperformance-test1 [duration] | 4 | 1.0011s | 1.0011s | 1.0011s | 0s | 1.0011s\n---------------------------------------------------------------------------------\nperformance-test2 [duration] | 4 | 1.0001s | 1.0012s | 1.0009s | 500µs | 1.0012s\n"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/testdoc/testdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//go:build go1.7
// +build go1.7

// testdoc implements somthing, this line1 will show up
// testdoc implements something, this line1 will show up
// this will not be a new line
//
// this line will show up, and will be a new line
Expand Down