-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add test for the architecture of the image which was built #885
Add test for the architecture of the image which was built #885
Conversation
Hi @Serializator. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Makefile
Outdated
@@ -130,7 +130,7 @@ endif | |||
|
|||
.PHONY: test-cli | |||
test-cli: container |
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.
Can you rename target to test-image? Update also target test-version on line 288
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.
Do you mean rename or duplicate such that there is a test-cli
and test-image
?
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.
here we should be ok with rename.
Makefile
Outdated
@@ -130,7 +130,7 @@ endif | |||
|
|||
.PHONY: test-cli | |||
test-cli: container | |||
IMAGE=$(REGISTRY)/metrics-server-$(ARCH):$(CHECKSUM) EXPECTED_VERSION=$(GIT_TAG) ./test/test-cli.sh | |||
IMAGE=$(REGISTRY)/metrics-server-$(ARCH):$(CHECKSUM) EXPECTED_ARCH=$(ARCH) EXPECTED_VERSION=$(GIT_TAG) ./test/test-cli.sh |
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.
Can you rename script to ./test/test-image.sh ?
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 code will be run once and test only default arch. Maybe we could add a target test-cli-all that builds all architecures and tests them.
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.
What would you say of something like this?
.PHONY: test-image-all
test-image-all:
@for arch in $(ALL_ARCHITECTURES); do ARCH=$${arch} $(MAKE) test-image; done
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.
lg
: ${EXPECTED_VERSION:?Need to provide environment variable EXPECTED_VERSION} | ||
|
||
IMAGE_ARCH=$(docker inspect ${IMAGE} | jq -r ".[].Architecture") |
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.
Hmm, are we using jq anywhere else or we need to install it and update developer docs?
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 was readily available within the image the test was ran in when I tested it locally.
Where are these tests run? I tested it locally using make test-cli
directly but that might not be exactly the same as where these tests actually run. I couldn't find it anywhere within the GitHub Actions.
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.
Yea, we are using Kubernetes own CI called Prow.
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.
/ok-to-test |
20cbd76
to
6a12cd9
Compare
/lgtm Noticed log line in logs https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_metrics-server/885/pull-metrics-server-test-version/1458364309544374272
@Serializator Maybe we could add --platform flag in build to avoid the warning? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: serathius, Serializator The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Tests the architecture of the image that was built (#882).