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

feat: pkg-utils-time #483

Merged
merged 1 commit into from
Aug 23, 2022
Merged

feat: pkg-utils-time #483

merged 1 commit into from
Aug 23, 2022

Conversation

jxs1211
Copy link
Contributor

@jxs1211 jxs1211 commented Aug 17, 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 for pkg

Which issue(s) this PR fixes:

Special notes for your reviewer:

[going@dev utils]$ go test -cover time_test.go time.go
ok      command-line-arguments  0.003s  coverage: 100.0% of statements
[going@dev utils]$ cd ..
[going@dev pkg]$ cd ..
[going@dev crane]$ make lint
[going@dev crane]$ 

@github-actions
Copy link
Contributor

github-actions bot commented Aug 17, 2022

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2022-08-23 10:18
Git Version: 6051133

Docker Registry

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

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

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-483-6051133 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-483-6051133 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-483-6051133 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-483-6051133 crane/crane

Coding Registry

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

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

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-483-6051133 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-483-6051133 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-483-6051133 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-483-6051133 crane/crane

Ghcr Registry

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

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

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-483-6051133 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-483-6051133 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-483-6051133 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-483-6051133 crane/crane

wantErr: false,
},
}
for _, tt := range tests {
Copy link
Member

Choose a reason for hiding this comment

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

Would you please add a sample for a error case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

t.Errorf("ParseTimestamp() error = %v, wantErr %v", err, tt.wantErr)
return
}
if tt.name == "parsed incorrect" {
Copy link
Member

Choose a reason for hiding this comment

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

Please use another way to implement this.

tt.name == "parsed incorrect"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

pkg/utils/time_test.go Outdated Show resolved Hide resolved
Signed-off-by: xian-jie.shen <327411586@qq.com>
@qmhu qmhu merged commit d62dfd3 into gocrane:main Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants