Skip to content
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

Improved guestbook.sh test to become actual test #5294

Merged
merged 1 commit into from
Mar 12, 2015

Conversation

piosz
Copy link
Member

@piosz piosz commented Mar 11, 2015

After change the test waits until pods come up and frontend starts serving content,
then adds entry to guestbook and verify if operation succeed

This fixes #3693

@piosz
Copy link
Member Author

piosz commented Mar 11, 2015

Satnam, could you please take a look?

Should be merged after #5284

@satnam6502
Copy link
Contributor

Happy to review although I always value @filbranden 's words of wisdom about bash. I will try to get to this after the Fixit today -- which might mean no action until tomorrow. Are you in a hurry? Perhaps not if you are blocked on #5248

fi
}

function wait_for_running() {
echo "Waiting for pods to come up."
frontends=$(${KUBECTL} get pods -l name=frontend -o template '--template={{range.items}}{{.id}} {{end}}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Declare these variables as local and do it in its own line (no assignment to $(...) on the same line as local as that hides the error exit of the command.)

  local frontends master slaves pods all_running status i pod
  frontends=$(...)
  ...

@satnam6502 satnam6502 assigned filbranden and unassigned satnam6502 Mar 11, 2015
@satnam6502
Copy link
Contributor

Handing over to @filbranden who is clearly in charge here.

pods=$(echo $frontends $master $slaves)

all_running=0
for i in $(seq 1 30); do
Copy link
Contributor

Choose a reason for hiding this comment

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

While $(seq ...) is just fine, bash can do it with a built-in for you...

  for i in {1..30}; do

@filbranden
Copy link
Contributor

Looks good overall! Thanks @piosz for tackling this one!

I have a lot of notes (as usual) but in general the code looks good and there's nothing structural, only style and nitpicks. Please let me know when ready to take another look, I'll review it and merge it when it's ready.

Cheers!

After change test waits until pods come up and frotend starts serving content,
then adds entry to guestbook and verify if operation succeed

This fixes kubernetes#3693
@piosz
Copy link
Member Author

piosz commented Mar 12, 2015

Thanks for comments. I resolved them (hopefully all). Sorry for such bad style but it's the first time I'm coding in bash;) PTAL

BTW do you prefer updated version as a new commit or amend to the previous one (which I did this time)?

@filbranden
Copy link
Contributor

Looks great. ammended commit is fine, it's a bit annoying to have to review everything again but in the end it works just fine. (If you do the other way around I'd ask you to squash it before we merge it.) Merging now.

Don't worry, your bash was great... way above average. The problem is the extra nitpicky reviewer ;-)

Cheers!
Filipe

filbranden added a commit that referenced this pull request Mar 12, 2015
Improved guestbook.sh test to become actual test
@filbranden filbranden merged commit a676a28 into kubernetes:master Mar 12, 2015
@piosz
Copy link
Member Author

piosz commented Mar 12, 2015

Thanks!

@satnam6502 satnam6502 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve guestbook.sh end-to-end test to become actual test
4 participants