Skip to content

Commit

Permalink
Get DEVFILE_REGISTRY value for tests, to use local Registry (#6705)
Browse files Browse the repository at this point in the history
* Get DEVFILE_REGISTRY value for tests

* Pass DEVFILE_REGISTRY to Windows tests

* Add values for devfile registry Helm deployment
  • Loading branch information
feloy authored Mar 31, 2023
1 parent 08c3904 commit 235539d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .ibm/pipelines/windows-test-script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function Run-Test {
[Environment]::SetEnvironmentVariable("SKIP_WELCOMING_MESSAGES","true")
# Integration tests detecting key press when running DevSession are not working on Windows
[Environment]::SetEnvironmentVariable("SKIP_KEY_PRESS","true")
[Environment]::SetEnvironmentVariable("DEVFILE_REGISTRY", "$DEVFILE_REGISTRY")

Shout "Login IBMcloud"
ibmcloud login --apikey ${API_KEY}
Expand Down Expand Up @@ -99,6 +100,7 @@ $LOGFILE=$args[4]
$REPO=$args[5]
$CLUSTER_ID=$args[6]
$TEST_EXEC_NODES=$args[7]
$DEVFILE_REGISTRY=$args[8]
Shout "Args Recived"


Expand Down
2 changes: 1 addition & 1 deletion .ibm/pipelines/windows-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/wi

#execute test from the test script
export TEST_EXEC_NODES=${TEST_EXEC_NODES:-"16"}
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}" "${CLUSTER_ID}" "${TEST_EXEC_NODES}"
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}" "${CLUSTER_ID}" "${TEST_EXEC_NODES}" "${DEVFILE_REGISTRY}"
RESULT=$?
echo "RESULT: $RESULT"

Expand Down
48 changes: 48 additions & 0 deletions scripts/devfile-registry/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright 2021-2022 Red Hat, Inc.
#
# 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.

global:
ingress:
class: 'public-iks-k8s-nginx'
domain: 'odo-test-kubernetes-clust-49529fc6e6a4a9fe7ebba9a3db5b55c4-0000.eu-de.containers.appdomain.cloud'
secretName: ''
isOpenShift: false
tlsEnabled: false
headless: false

devfileIndex:
image: quay.io/pvala18/devfile-index
tag: latest
imagePullPolicy: Always
memoryLimit: 256Mi

registryViewer:
image: quay.io/devfile/registry-viewer
tag: next
imagePullPolicy: Always
memoryLimit: 256Mi

ociRegistry:
image: quay.io/devfile/oci-registry
tag: sha-4bc237b
imagePullPolicy: Always
memoryLimit: 256Mi

persistence:
enabled: false
size: 1Gi

telemetry:
registryName: "devfile-registry"
4 changes: 4 additions & 0 deletions tests/helper/helper_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,5 +378,9 @@ func GetDevfileRegistryURL() string {
if proxy != "" {
registryURL = "http://" + proxy
}
customReg := os.Getenv("DEVFILE_REGISTRY")
if customReg != "" {
registryURL = customReg
}
return registryURL
}
4 changes: 4 additions & 0 deletions tests/integration/cmd_devfile_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ var _ = Describe("odo devfile registry command tests", func() {
if proxy != "" {
addRegistryURL = "http://" + proxy
}
customDevfileRegistry := os.Getenv("DEVFILE_REGISTRY")
if customDevfileRegistry != "" {
addRegistryURL = customDevfileRegistry
}

It("Should list all default registries", func() {
output := helper.Cmd("odo", "preference", "view").ShouldPass().Out()
Expand Down

0 comments on commit 235539d

Please sign in to comment.