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

go test -cpu #69

Closed
jerome-laforge opened this issue May 13, 2023 · 3 comments
Closed

go test -cpu #69

jerome-laforge opened this issue May 13, 2023 · 3 comments

Comments

@jerome-laforge
Copy link

I want define number of cpu for go test via -cpu.
Is it possible to expose this library directly also as tool (with main package) that shows CPU quota in order to use it for testing?

For example, I want to do something like that:

- go install go.uber.org/automaxprocs@latest
- automaxprocs > GOMAXPROCS.txt
- go test -cpu $(cat GOMAXPROCS.txt) ./...
@sywhang
Copy link
Contributor

sywhang commented Jun 7, 2023

You should be able to write that type of tool yourself fairly easily using this library. Use automaxprocs/maxprocs package to retrieve the cgroup limit and just print that to the console.

@jerome-laforge
Copy link
Author

Thank for your response.

You should be able to write that type of tool yourself fairly easily using this library

I know but I hoped that just do go install without specific code in order to simplify the generalization of that. But anyway, if it isn't acceptable for you. I will manage by mysef.
I can close this issue, if you want.

Thank again.

jerome-laforge added a commit to jerome-laforge/automaxprocscli that referenced this issue Jun 7, 2023
jerome-laforge added a commit to jerome-laforge/automaxprocscli that referenced this issue Jun 7, 2023
@jerome-laforge
Copy link
Author

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

No branches or pull requests

2 participants