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: utils-cgroup #583

Merged
merged 1 commit into from
Nov 8, 2022
Merged

test: utils-cgroup #583

merged 1 commit into from
Nov 8, 2022

Conversation

jxs1211
Copy link
Contributor

@jxs1211 jxs1211 commented Oct 15, 2022

Signed-off-by: xian-jie.shen 327411586@qq.com

What type of PR is this?

ut

What this PR does / why we need it:

ut

Which issue(s) this PR fixes:

N/A

Fixes #
N/A

Special notes for your reviewer:

[going@dev utils]$ go test cgroup_test.go cgroup.go ref.go -v -cover -coverprofile=c.out
=== RUN   TestCgroupName_ToCgroupfs
--- PASS: TestCgroupName_ToCgroupfs (0.00s)
=== RUN   TestGetCgroupPath
=== RUN   TestGetCgroupPath/base
=== RUN   TestGetCgroupPath/cgroupDriver_is_cgroupfs
=== RUN   TestGetCgroupPath/cgroupDriver_is_default
--- PASS: TestGetCgroupPath (0.00s)
    --- PASS: TestGetCgroupPath/base (0.00s)
    --- PASS: TestGetCgroupPath/cgroupDriver_is_cgroupfs (0.00s)
    --- PASS: TestGetCgroupPath/cgroupDriver_is_default (0.00s)
=== RUN   TestGetCgroupName
=== RUN   TestGetCgroupName/base
    cgroup_test.go:100: []
=== RUN   TestGetCgroupName/status_is_equal_to_PodQOSGuaranteed
    cgroup_test.go:100: [kubepods podfake-uid]
=== RUN   TestGetCgroupName/status_is_equal_to_PodQOSBurstable
    cgroup_test.go:100: [kubepods burstable podfake-uid]
=== RUN   TestGetCgroupName/status_is_equal_to_PodQOSBestEffort
    cgroup_test.go:100: [kubepods besteffort podfake-uid]
--- PASS: TestGetCgroupName (0.00s)
    --- PASS: TestGetCgroupName/base (0.00s)
    --- PASS: TestGetCgroupName/status_is_equal_to_PodQOSGuaranteed (0.00s)
    --- PASS: TestGetCgroupName/status_is_equal_to_PodQOSBurstable (0.00s)
    --- PASS: TestGetCgroupName/status_is_equal_to_PodQOSBestEffort (0.00s)
=== RUN   TestGetPodCgroupNameSuffix
--- PASS: TestGetPodCgroupNameSuffix (0.00s)
=== RUN   TestNewCgroupName
--- PASS: TestNewCgroupName (0.00s)
=== RUN   TestCgroupName_ToSystemd
=== RUN   TestCgroupName_ToSystemd/base
=== RUN   TestCgroupName_ToSystemd/len(slice)_<_len(suffix)
--- PASS: TestCgroupName_ToSystemd (0.00s)
    --- PASS: TestCgroupName_ToSystemd/base (0.00s)
    --- PASS: TestCgroupName_ToSystemd/len(slice)_<_len(suffix) (0.00s)
=== RUN   Test_escapeSystemdCgroupName
--- PASS: Test_escapeSystemdCgroupName (0.00s)
=== RUN   TestExpandSlice
=== RUN   TestExpandSlice/base
=== RUN   TestExpandSlice/slice_contains_'/'
=== RUN   TestExpandSlice/slice_contains_'-'
=== RUN   TestExpandSlice/slice_contains_many_'-'
=== RUN   TestExpandSlice/slice_contains_some_contents_and_many_'-'
--- PASS: TestExpandSlice (0.00s)
    --- PASS: TestExpandSlice/base (0.00s)
    --- PASS: TestExpandSlice/slice_contains_'/' (0.00s)
    --- PASS: TestExpandSlice/slice_contains_'-' (0.00s)
    --- PASS: TestExpandSlice/slice_contains_many_'-' (0.00s)
    --- PASS: TestExpandSlice/slice_contains_some_contents_and_many_'-' (0.00s)
PASS
coverage: 82.6% of statements
ok      command-line-arguments  0.025s  coverage: 82.6% of statements
[going@dev utils]$ go tool cover -html=c.out -o coverage.html

Signed-off-by: xian-jie.shen <327411586@qq.com>
@github-actions
Copy link
Contributor

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2022-10-15 19:37
Git Version: d94bf06

Docker Registry

Overview: https://hub.docker.com/u/gocrane

Image Pull Command
crane-agent:pr-583-d94bf06 docker pull gocrane/crane-agent:pr-583-d94bf06
dashboard:pr-583-d94bf06 docker pull gocrane/dashboard:pr-583-d94bf06
metric-adapter:pr-583-d94bf06 docker pull gocrane/metric-adapter:pr-583-d94bf06
craned:pr-583-d94bf06 docker pull gocrane/craned:pr-583-d94bf06

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=gocrane/craned \
                   --set craned.image.tag=pr-583-d94bf06 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-583-d94bf06 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-583-d94bf06 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-583-d94bf06 crane/crane

Coding Registry

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-583-d94bf06 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-583-d94bf06
dashboard:pr-583-d94bf06 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-583-d94bf06
metric-adapter:pr-583-d94bf06 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-583-d94bf06
craned:pr-583-d94bf06 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-583-d94bf06

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
                   --set craned.image.tag=pr-583-d94bf06 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-583-d94bf06 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-583-d94bf06 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-583-d94bf06 crane/crane

Ghcr Registry

Overview: https://github.com/orgs/gocrane/packages?repo_name=crane

Image Pull Command
crane-agent:pr-583-d94bf06 docker pull ghcr.io/gocrane/crane/crane-agent:pr-583-d94bf06
dashboard:pr-583-d94bf06 docker pull ghcr.io/gocrane/crane/dashboard:pr-583-d94bf06
metric-adapter:pr-583-d94bf06 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-583-d94bf06
craned:pr-583-d94bf06 docker pull ghcr.io/gocrane/crane/craned:pr-583-d94bf06

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=ghcr.io/gocrane/crane/craned \
                   --set craned.image.tag=pr-583-d94bf06 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-583-d94bf06 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-583-d94bf06 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-583-d94bf06 crane/crane

@qmhu qmhu requested a review from chenkaiyue October 18, 2022 03:21
@chenkaiyue
Copy link
Contributor

Thx for your contribution! We will review it.

Copy link
Contributor

@chenkaiyue chenkaiyue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@qmhu qmhu merged commit b7fdeea into gocrane:main Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants