Skip to content
Merged
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
4 changes: 4 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ TC_PATHS="tests/kafkatest/tests/client/pluggable_test.py::PluggableConsumerTest"
```
TC_PATHS="tests/kafkatest/tests/client/pluggable_test.py::PluggableConsumerTest.test_start_stop" bash tests/docker/run_tests.sh
```
* Run a specific test method with specific parameters
```
TC_PATHS="tests/kafkatest/tests/streams/streams_upgrade_test.py::StreamsUpgradeTest.test_metadata_upgrade" _DUCKTAPE_OPTIONS='--parameters '\''{"from_version":"0.10.1.1","to_version":"2.6.0-SNAPSHOT"}'\' bash tests/docker/run_tests.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great example. Wondering if it is correct?

--parameters '\''

Should this be

--parameters '\'

because that the end there is '\'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha, having just spent several hours settling on this exact sequence of characters, I can certify that it's correct ;)

Actually, I would like to get at least one other person to try it out. Do you mind?

To answer your question, here's how it works:
first string (wrapped in single quotes for consistency with the second string): --parameters
first escaped single quote: \'
second string (wrapped in single quotes to avoid evaluating the special characters): {"from_version":"0.10.1.1","to_version":"2.6.0-SNAPSHOT"}
second escaped single quote: \'

Following Bash rules, a sequence of strings and characters just get concatenated, so all of the above gets smashed together to form the desired final string:
--parameters '{"from_version":"0.10.1.1","to_version":"2.6.0-SNAPSHOT"}'

which will then be evaluated again by Bash inside the docker container, so that the final argument to ducktape is the desired argument list: --parameters, followed by {"from_version":"0.10.1.1","to_version":"2.6.0-SNAPSHOT"}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried it out on Friday but left it running and forgot to report back. It passed for me 👍

```
* Run tests with a different JVM
```
bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
Expand Down