Added s390x arch in Makefiles to build multi arch images and skipped some tests on s390x because of image unavailability#2130
Conversation
hash-d
left a comment
There was a problem hiding this comment.
For the tests that cannot be run on Z because of missing images, the cluster's architecture should be checked, instead of the local test machine.
If you're running from an x86 VM pointing to a Z cluster, for example, those tests would not be skipped and the test would fail.
| ) | ||
|
|
||
| func TestBookinfo(t *testing.T) { | ||
| if runtime.GOARCH == "s390x" { |
There was a problem hiding this comment.
Checking runtime.GOARCH is ok for testLocalGatewayService, because that's a local test. For TestBookInfo, however, you should be inspecting the cluster's architecture, not the local machine.
Check how that's done for ARM, you can adapt that for Z.
aaec1ba to
b71e806
Compare
|
@hash-d made the changes as requested by you |
hash-d
left a comment
There was a problem hiding this comment.
Please make the check pass, and we should be good to merge.
| //Skipping test on s390x architecture as images unavailable for s390x | ||
| cluster := base.GetClusterContext() | ||
| if err := arch.SkipOnlyS390x(t, cluster); err != nil { | ||
| t.Fatal(err) |
There was a problem hiding this comment.
The check failed because of incorrect Go formatting. This is one such case (missing indent). Please fix these so the check passes.
| } | ||
|
|
||
| // CheckOnlyS390x skips ONLY if the architecture is s390x | ||
| func CheckOnlyS390x(clusters ...*base.ClusterContext) (err error, skip bool) { |
There was a problem hiding this comment.
It would have been best to generalize Check(), as listed on its TODO, but this works fine
c6c8fbd to
5717795
Compare
|
@rajnish-jauhari, while I'm good with the PR, you'll need to address the build failures. Here's what I found with help from @fgiorgetti:
Our guess is that, while the Docker orb is tied to version 2.6.0, the So, check [1] https://circleci.com/developer/orbs/orb/circleci/docker#commands-install_docker |
|
@rajnish-jauhari, it seems the Docker issue is now bypassed, but there are still some code issues. Please review the test failure logs and fix them. |
|
@hash-d , after making necessary changes, all the checks are now passing, please provide a review regarding the same |
hash-d
left a comment
There was a problem hiding this comment.
I think it is ok that formatting changes are introduced on files that are changing for the purposes of the PR, even if they pollute the diff (for the PR review and for future git log analysis).
However, the removals of comments and changes in message strings adds burden to the review and do not really add to the final product.
In fact, some of those changes may be detrimental to the tests. Some comments are there to explain the reason a piece of the code is as it is; logs may have been added to help debug recurring problems.
In specific, for example on test/integration/examples/mongodb/mongo.go, I can't see any changes that relate to the PR. Perhaps they are buried behind the other changes?
The changes on test/integration/examples/bookinfo_test.go are not only unnecessary, they actually change the way the test behaves for other architectures. Are those changes positive? I honestly do not know, but I don't think we want to introduce changes to v1 this late in the game.
Please remove the extraneous changes and submit again.
|
|
||
| // Make sure you have a minimum of three members on the replicaset | ||
| // https://www.mongodb.com/docs/manual/tutorial/deploy-replica-set/ | ||
| // https://www.mongodb.com/docs/manual/core/replica-set-architecture-three-members/ |
There was a problem hiding this comment.
Why did you remove these comments?
|
|
||
| // Let's wait until the election is settled, for a maximum of 5 min | ||
| log.Print("Waiting for the Mongo replicaset primary member election to be settled") | ||
| log.Print("Waiting for Mongo replicaset primary election") |
There was a problem hiding this comment.
Here, too, why make these changes? What's the relation of them with the PR?
| job, err := k8s.WaitForJob(pubCluster1.Namespace, pubCluster1.VanClient.KubeClient, jobName, constants.ImagePullingAndResourceCreationTimeout) | ||
| jobLogs, _ := k8s.GetJobsLogs(pubCluster1.Namespace, pubCluster1.VanClient.KubeClient, jobName, true) | ||
| t.Logf("%s logs:", jobName) | ||
| t.Logf("%s", jobLogs) |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
|
|
There was a problem hiding this comment.
The changes above are completely changing how the test behaves, why are you doing that? A shared ClusterTestRunnerBase already exists and is created on test/integration/examples/main_test.go, and was used by this test, why create a new ClusterNeeds?
You probably want to just add arch.SkipOnlyS390x() to Setup() on test/integration/examples/bookinfo/bookinfo.go, instead.
| needs := base.ClusterNeeds{ | ||
| NamespaceId: "perf-archcheck", | ||
| PublicClusters: 1, | ||
| PrivateClusters: 0, |
There was a problem hiding this comment.
Same thing as for Mongo test, here: why a new ClusterNeeds?
| } | ||
|
|
||
| // Cleanup the temporary namespace used for arch detection | ||
| defer base.RemoveNamespacesForContexts(r, []int{1}, []int{}) |
There was a problem hiding this comment.
Why a temporary namespace for arch detection? The creation and removal of namespaces add time to the test execution; use the actual namespaces, instead.
There was a problem hiding this comment.
Also, probably not the case here as the focus is on v2, but if new namespaces are introduced in the test by future changes, the temporary ones may be left behind, unaltered. It's better to test the actual namespaces, in the place where they are created or accessed by the test, to ensure future changes take the verification you're introducing in mind.
| // use build flags or some other technique. | ||
| // | ||
| // Usage: check first skip; only check err if skip is false. If skip is true, error | ||
| // will be non-nil, with information on why skipping |
There was a problem hiding this comment.
Why removing the Usage documentation?
| // will be non-nil, with information on why skipping | ||
| // | ||
| // TODO: make it more granular, allow for hibrid clusters? | ||
| // TODO: allow for list of accepted archs? |
There was a problem hiding this comment.
These TODOs have not been implemented; why removing them?
…some tests on s390x because of image unavailability
|
@hash-d all the requested changes have been made, please review it |
Added s390x arch in Makefiles to build multi arch images and
Skipping below tests on s390x because of image unavailability :
cc: @hash-d