Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend catalog test script to run test for different platforms
PLATFORM env variable is introduced. This variable allows to run tests for specific platform (for insance, "linux/s390x" or "linux/ppc64le"). If the environment variable is specified - some tests are updated with different image values/other parameter values, required for specific platform, using yq tool. Custom values should be specified in the script file, separate for each platform. In the current code script file for linux/s390x is proposed. - only tasks, which have mention about corresponding platform support in the annotation, will be tested. If PLATFORM env variale is no specified, the behaviour of test scripts will be similar to the one before the PR. Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
- Loading branch information
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2021 The Tekton Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# s390x specific registry | ||
export REGISTRY_IMAGE=ibmcom/registry:2.6.2.5 | ||
# Maven image to use for s390x maven tasks | ||
export MAVEN_IMAGE=maven:3.6.3-adoptopenjdk-11 | ||
# Architecture to use for golang tasks | ||
export GOARCH=s390x | ||
# Gradle image to use for s390x gradle tasks | ||
export BUILDER_IMAGE=gradle:5.6.2-jdk11 | ||
# Tasks to skip so far for s390x | ||
export TEST_TASKRUN_IGNORES="helm-upgrade-from-repo helm-upgrade-from-source golang-test kaniko" | ||
|
||
echo "Add extra MAVEN_IMAGE parameter" | ||
find task/*maven*/*/tests/run.yaml | xargs -I{} yq eval '(..|select(.kind?=="Pipeline")|select(.metadata.name?=="jib-maven-test-pipeline"|"maven-test-pipeline")|.spec.tasks[1].params) |= . +{"name": "MAVEN_IMAGE","value": env(MAVEN_IMAGE)}' -i {} | ||
|
||
echo "Change registry image value" | ||
find task -name *registry*.yaml | xargs -I{} yq eval '(..|select(.kind?=="Deployment")|select(.metadata.name?=="registry")|.spec.template.spec.containers[0].image)|= env(REGISTRY_IMAGE)' -i {} | ||
|
||
echo "Change GOARCH parameter value" | ||
find task/golang*/*/tests/run.yaml | xargs -I{} yq eval '(..|select(.kind?=="Pipeline")|.spec.tasks[1].params) |= . +{"name": "GOARCH","value": env(GOARCH)}' -i {} | ||
|
||
echo "Add extra BUILDER_IMAGE parameter" | ||
find task/jib-gradle/*/tests/run.yaml | xargs -I{} yq eval '(..|select(.kind?=="Pipeline")|.spec.tasks[1].params) |= . +{"name": "BUILDER_IMAGE","value": env(BUILDER_IMAGE)}' -i {} |