Skip to content

test: Fix guestbook test#13003

Merged
kkourt merged 2 commits intomasterfrom
pr/pchaigno/fix-guestbook-test
Sep 2, 2020
Merged

test: Fix guestbook test#13003
kkourt merged 2 commits intomasterfrom
pr/pchaigno/fix-guestbook-test

Conversation

@pchaigno
Copy link
Copy Markdown
Member

@pchaigno pchaigno commented Aug 28, 2020

#7955 updated the GuestBook images and labels, but failed to make the same label update in the test itself. Thus, since then, we have not been running any connectivity check in the GuestBook test. That went unnoticed because we didn't check that the set of pods returned (from which we run connectivity checks) was not empty.

This commit fixes it by:

  1. Updating the label in the test itself to app=guestbook.
  2. Adding a check that the set of pods selected isn't empty.

However, the nc utility we were using to check connectivity from the frontend pods to the Redis backend isn't available in the new images. Therefore, we also need to:

  1. Use curl instead inside the frontend pods to check that the PHP frontend works as expected and is able to contact the Redis backend.

That's it? No. Turns out some of the pod labels and names are also hardcoded in the Docker images and have been updated (mostly to use more neutral terms).

  1. Update the YAML file to better match [1]. We however can't update the 'redis-master' name because our v6 frontend image has it hardcoded. The v5 frontend image at [1] has 'redis-leader' as the name, but somehow not the v6. We want to use the v6 image because it is a lot smaller (cf. dffb450).
  2. And finally, Bob's our uncle!

1 - https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
Fixes: #12994
Fixes: #7955
/cc @aanm
Signed-off-by: Paul Chaignon paul@cilium.io

@pchaigno pchaigno added area/CI Continuous Integration testing issue or flake needs-backport/1.7 ci/flake This is a known failure that occurs in the tree. Please investigate me! labels Aug 28, 2020
@pchaigno pchaigno requested a review from a team as a code owner August 28, 2020 10:32
@maintainer-s-little-helper maintainer-s-little-helper Bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Aug 28, 2020
@pchaigno pchaigno added the release-note/ci This PR makes changes to the CI. label Aug 28, 2020
@maintainer-s-little-helper maintainer-s-little-helper Bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 28, 2020
@pchaigno pchaigno force-pushed the pr/pchaigno/fix-guestbook-test branch from 65e0333 to cccc80c Compare August 28, 2020 12:00
Comment thread test/k8sT/Policies.go Outdated
Copy link
Copy Markdown
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

Nice find! A few minor changes, and it should be good to go.

Comment thread test/k8sT/Policies.go Outdated
Comment thread test/k8sT/Policies.go Outdated
@pchaigno pchaigno force-pushed the pr/pchaigno/fix-guestbook-test branch from cccc80c to ce73840 Compare August 28, 2020 20:10
@pchaigno pchaigno requested a review from christarazi August 28, 2020 20:11
Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

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

One small nit

- name: redis-master
image: docker.io/library/redis:4.0.11
- name: leader
image: "docker.io/redis:6.0.5"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

docker.io/library/redis

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No preference either way, but trying to understand as Google takes different convention than you: why do you prefer the docker.io/library/xxx form?

@pchaigno pchaigno force-pushed the pr/pchaigno/fix-guestbook-test branch from e7b8243 to 24ce546 Compare September 1, 2020 17:31
ae9e4be updated the GuestBook images and labels, but failed to make the
same label update in the test itself. Thus, since then, we have not been
running any connectivity check in the GuestBook test. That went
unnoticed because we didn't check that the set of pods returned (from
which we run connectivity checks) was not empty.

This commit fixes it by:
1. Updating the label in the test itself to app=guestbook.
2. Adding a check that the set of pods selected isn't empty.

However, the nc utility we were using to check connectivity from the
frontend pods to the Redis backend isn't available in the new images.
Therefore, we also need to:
3. Use curl instead inside the frontend pods to check that the PHP
   frontend works as expected and is able to contact the Redis backend.

That's it? No. Turns out some of the pod labels and names have also been
hardcoded in the Docker images and have been updated (mostly to use more
neutral terms).
4. Update the YAML file to better match [1]. We however can't update the
   'redis-master' name because our v6 frontend image has it hardcoded. The
   v5 frontend image at [1] has 'redis-leader' as the name, but somehow
   not the v6. We want to use the v6 image because it is a lot bigger
   (cf. dffb450).
5. And finally, Bob's our uncle!

1 - https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
Fixes: #12994
Fixes: ae9e4be ("test: replace guestbook test docker image")
Signed-off-by: Paul Chaignon <paul@cilium.io>
This reverts commit c84d0a2.

This test has been fixed by 240d808 ("test: Fix GuestBook test").

Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno force-pushed the pr/pchaigno/fix-guestbook-test branch from 24ce546 to 815cc0f Compare September 1, 2020 17:32
@pchaigno
Copy link
Copy Markdown
Member Author

pchaigno commented Sep 1, 2020

test-me-please

Copy link
Copy Markdown
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

I think it's a great question what we gain from this guestbook test that's not otherwise covered elsewhere in the CI. Maybe just to ensure we have a full-on end-to-end test?

@pchaigno
Copy link
Copy Markdown
Member Author

pchaigno commented Sep 2, 2020

I think it's a great question what we gain from this guestbook test that's not otherwise covered elsewhere in the CI. Maybe just to ensure we have a full-on end-to-end test?

@joestringer Yeah, but I don't think it's our only end-to-end test of that sort (e.g., Star wars demo). I've added a TODO note to double check these to see if there's actually any meaningful difference.

K8s-1.12-Kernel-netnext hit known flake #12511. All other required builds are passing. Marking as ready to merge.

@pchaigno pchaigno added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 2, 2020
@kkourt kkourt merged commit c6fac25 into master Sep 2, 2020
@kkourt kkourt deleted the pr/pchaigno/fix-guestbook-test branch September 2, 2020 06:59
pchaigno added a commit to cilium/packer-ci-build that referenced this pull request Sep 3, 2020
to match cilium/cilium#13003.

Signed-off-by: Paul Chaignon <paul@cilium.io>
nebril pushed a commit to cilium/packer-ci-build that referenced this pull request Sep 9, 2020
to match cilium/cilium#13003.

Signed-off-by: Paul Chaignon <paul@cilium.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/CI Continuous Integration testing issue or flake ci/flake This is a known failure that occurs in the tree. Please investigate me! ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: GuestBook Examples checks policy example: Cannot get web pods

7 participants