Skip to content

Conversation

@skyero-aws
Copy link
Contributor

Issue #, if available:

Description of changes:
Added more robust checks for kcl functionality.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines +31 to +38
elif [[ "$RUNNER_OS" == "Linux" ]]; then
cd samples/basic_sample/consumer
KCL_COMMAND="../../../bin/kcl-bootstrap -e -p ./sample.properties"
timeout 300 $KCL_COMMAND 2>&1 | tee kcl_output.log || [ $? -eq 124 ]
elif [[ "$RUNNER_OS" == "Windows" ]]; then
cd samples/basic_sample/consumer
KCL_COMMAND="../../../bin/kcl-bootstrap -e -p ./sample.properties"
timeout 300 $KCL_COMMAND 2>&1 | tee kcl_output.log || [ $? -eq 124 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

These look to be the same commands, can we put an or in the if statement instead to reduce copy paste?

Comment on lines +6 to +23
if [[ "$RUNNER_OS" == "macOS" ]]; then
sed -i "" "s/streamName = .*/streamName = $STREAM_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "" "s/applicationName = .*/applicationName = $APP_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "" "s/#*idleTimeBetweenReadsInMillis.*/idleTimeBetweenReadsInMillis = 250/" samples/basic_sample/consumer/sample.properties
sed -i "" "s/stream : 'kclnodejssample'/stream : '$STREAM_NAME'/" samples/basic_sample/producer/config.js
sed -i "" "s/shards : 2/shards : 1/" samples/basic_sample/producer/config.js
elif [[ "$RUNNER_OS" == "Linux" ]]; then
sed -i "s/streamName = .*/streamName = $STREAM_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "s/applicationName = .*/applicationName = $APP_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "s/#*idleTimeBetweenReadsInMillis.*/idleTimeBetweenReadsInMillis = 250/" samples/basic_sample/consumer/sample.properties
sed -i "s/stream : 'kclnodejssample'/stream : '$STREAM_NAME'/" samples/basic_sample/producer/config.js
sed -i "s/shards : 2/shards : 1/" samples/basic_sample/producer/config.js
elif [[ "$RUNNER_OS" == "Windows" ]]; then
sed -i "s/streamName = .*/streamName = $STREAM_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "s/applicationName = .*/applicationName = $APP_NAME/" samples/basic_sample/consumer/sample.properties
sed -i "s/#*idleTimeBetweenReadsInMillis.*/idleTimeBetweenReadsInMillis = 250/" samples/basic_sample/consumer/sample.properties
sed -i "s/stream : 'kclnodejssample'/stream : '$STREAM_NAME'/" samples/basic_sample/producer/config.js
sed -i "s/shards : 2/shards : 1/" samples/basic_sample/producer/config.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these all the same commands? Can we merge them all under one if statement so we don't repeat code?

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