You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PokIsemaine (via GitHub)" <gi...@apache.org> on 2024/04/12 14:00:05 UTC
[I] Enable x.py to support executing specified unit tests via command line arguments [kvrocks]
PokIsemaine opened a new issue, #2243:
URL: https://github.com/apache/kvrocks/issues/2243
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
### Motivation
When modifying kvrocks, I wish to add and execute specified test methods, but the current `x.py` generated command executes all tests, which usually takes several minutes to complete.
I need to temporarily modify `x.py` or the command it generates to execute the specified method.
```
def test_go(dir: str, cli_path: str, rest: List[str]) -> None:
go = find_command('go', msg='go is required for testing')
find_command(cli_path, msg='redis-cli is required for testing')
binpath = Path(dir).absolute() / 'kvrocks'
basedir = Path(__file__).parent.absolute() / 'tests' / 'gocase'
workspace = basedir / 'workspace'
args = [
'test', '-run=TestZSetSort','-timeout=1800s', '-bench=.', './...',
# 'test','-timeout=1800s', '-bench=.', './...',
f'-binPath={binpath}',
f'-cliPath={cli_path}',
f'-workspace={workspace}',
*rest
]
run(go, *args, cwd=str(basedir), verbose=True)
```
### Solution
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Enable x.py to support executing specified unit tests via command line arguments [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #2243:
URL: https://github.com/apache/kvrocks/issues/2243#issuecomment-2051842381
Actually you don't need to modify the source code.
You can refer to the CONTRIBUTING document here:
https://kvrocks.apache.org/community/contributing#tests
> You can use ./x.py test go <BUILD_DIR> -run <PATTERN> to run Golang test cases whose name match the pattern. Technically, all arguments after <BUILD_DIR> will be appended to the go test command. Refer to the [testflag](https://pkg.go.dev/cmd/go/internal/test) page for all possible flags.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Enable x.py to support executing specified unit tests via command line arguments [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #2243:
URL: https://github.com/apache/kvrocks/issues/2243#issuecomment-2051844677
Closed. Please feel free to reopen if I missed anything.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Enable x.py to support executing specified unit tests via command line arguments [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice closed issue #2243: Enable x.py to support executing specified unit tests via command line arguments
URL: https://github.com/apache/kvrocks/issues/2243
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org