-
Notifications
You must be signed in to change notification settings - Fork 48
BATS tests #462
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
BATS tests #462
Conversation
4d3870f to
753b810
Compare
171dd3b to
ee9d9f1
Compare
ofedoren
left a comment
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.
Thanks, @adamruzicka, I guess we can squash it now.
Some really minor nits, but otherwise LGTM.
| RemoteExecutorExample.run_server | ||
| when 'client' | ||
| RemoteExecutorExample.run_client | ||
| RemoteExecutorExample.run_client(ARGV[1]&.to_i) |
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.
nil.to_i is 0, which makes the condition above 0.times instead of probably desired 1000.times.
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.
nil.to_i is indeed 0, but nil&.to_i should still be nil, right?
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.
I am a dumbass, nevermind 🤦
test/bats/helpers/common.bash
Outdated
| } | ||
|
|
||
| # Print section header for debugging | ||
| print_header() { |
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.
This is not being used anywhere, do we still want that?
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.
Dropped
| exec_redis() { | ||
| local cmd="$@" | ||
| podman exec "${REDIS_CONTAINER_NAME}" redis-cli ${cmd} | ||
| } |
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.
shellcheck is not much happy about this:
SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
SC2086 (info): Double quote to prevent globbing and word splitting.
Not that it's important, I'v just noticed you have a commit to make it happy.
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.
There was no need for a local variable anyway
| setup() { | ||
| # Setup environment variables | ||
| setup_test_env | ||
|
|
||
| # Ensure containers are running | ||
| is_postgres_running && stop_postgres | ||
| start_postgres | ||
| is_redis_running && stop_redis | ||
| start_redis | ||
| } |
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.
Again, not important, but inconsistent spacing: 2 spaces, whilst below it's probably a tab.
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.
Fixed
|
and squashed |
ofedoren
left a comment
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.
Thanks, @adamruzicka, let's get this in.
squash before merge please