-
-
Notifications
You must be signed in to change notification settings - Fork 170
Fix build #36
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
Fix build #36
Conversation
RUN git clone https://github.com/bats-core/bats-core.git /tmp/bats-core && \ | ||
/tmp/bats-core/install.sh /usr/local && \ | ||
rm -r /tmp/bats-core |
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 couldn't find good documentation on the duggan/bats
PPA, and it turns out that isn't supported on Ubuntu 20.04, so I switched to the officially recommended way to install bats.
@@ -121,5 +121,5 @@ function os_change_dir_owner { | |||
fi | |||
|
|||
log_info "Changing ownership of $dir to $username" | |||
"$exchown" -R "$username:$username" "$dir" | |||
$exchown -R "$username:$username" "$dir" | |||
} |
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.
Needed to remove ""
here to ensure sudo BLAH
was recognized as two command args and not one.
@test "aws_wrapper_wait_for_instance_tags no tags" { | ||
local reaodnly max_retries=1 | ||
local readonly sleep_between_retries=0 | ||
local readonly tags=$(cat <<END_HEREDOC | ||
{ | ||
"Tags": [] | ||
} | ||
END_HEREDOC | ||
) | ||
|
||
load_aws_mock "$tags" "" "" | ||
|
||
run naws_wrapper_wait_for_instance_tags "i-1234567890abcdef0" "us-east-1" "$max_retries" "$sleep_between_retries" | ||
|
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 function was repeated for some reason.
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.
Overall, LGTM, but had a couple questions to help my understanding.
@@ -4,7 +4,7 @@ jobs: | |||
machine: true | |||
steps: | |||
- checkout | |||
- run: docker-compose up shellcheck | |||
- run: docker-compose up --exit-code-from shellcheck shellcheck |
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.
Huh... What is the default exit code if you don't specify this?
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.
It's non-zero only if docker-compose
has an error internally. Otherwise, it returns 0
regardless of the containers.
working_dir: /usr/local/src/bash-commons | ||
command: bats test | ||
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP | ||
privileged: true |
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.
Why is this only necessary for Ubuntu 20.04 and not any of the others?
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.
Oh you might have missed it because it's not in the change set, but the others have it too. I just copy pasted the whole routine from ubuntu18.
Thanks for review! I addressed the comments, and since they don't need code changes, I'll go ahead and merge this in! |
This PR includes several fixes:
s/local readonly/local -r/g
I know this is a lot, so if necessary, I can break up the PR to separate out the fixes.