- 
                Notifications
    You must be signed in to change notification settings 
- Fork 203
More robust sample testing nodejs #427
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
base: master
Are you sure you want to change the base?
Conversation
| 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 ] | 
There was a problem hiding this comment.
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?
| 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 | 
There was a problem hiding this comment.
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?
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.