Skip to content

Commit 5d4a6ef

Browse files
authored
Use staging Devfile registry for PR tests (#7129)
* Revert using a DEVFILE_PROXY env var There is no proxy deployed in the internal test cluster. As such, this env var no longer makes sense. * To help troubleshoot, display the resolved Devfile registry URL * Make interactive tests more resilient with stack versions They are now able to determine if the "Select version" prompt should be asked by "odo init" or not: * Make sure doc automation tests do not rely on hard-coded namespaces * Allow to run doc automation tests with more parallel Ginkgo nodes This is possible now that those tests no longer depend on a single hard-coded namespace. * Remove occurrences of the DEVFILE_REGISTRY env var in IBM Pipelines scripts * Reuse logic for determining the Devfile Registry URL in "odo registry" tests * Clarify what openshiftci-config.sh is used for
1 parent d77ca3e commit 5d4a6ef

23 files changed

+178
-145
lines changed

.ibm/pipelines/kubernetes-tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ cleanup_namespaces
1515
export SKIP_USER_LOGIN_TESTS=true
1616
(
1717
set -e
18-
export DEVFILE_PROXY="$(kubectl get svc -n devfile-proxy nginx -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' || true)"
19-
echo Using Devfile proxy: ${DEVFILE_PROXY}
2018
make install
2119
make test-integration-cluster
2220
) |& tee "/tmp/${LOGFILE}"

.ibm/pipelines/nocluster-tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ibmcloud target -r "${IBM_REGION}"
1313
(
1414
set -e
1515
make install
16-
echo Using Devfile Registry ${DEVFILE_REGISTRY}
1716
make test-integration-no-cluster
1817
) |& tee "/tmp/${LOGFILE}"
1918

.ibm/pipelines/openshift-tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ cleanup_namespaces
1616

1717
(
1818
set -e
19-
export DEVFILE_PROXY="$(kubectl get svc -n devfile-proxy nginx -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' || true)"
20-
echo Using Devfile proxy: ${DEVFILE_PROXY}
2119
make install
2220
make test-integration-cluster
2321
make test-e2e

.ibm/pipelines/windows-test-script.ps1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function Run-Test {
6060
[Environment]::SetEnvironmentVariable("SKIP_SERVICE_BINDING_TESTS","$SKIP_SERVICE_BINDING_TESTS" )
6161
# Integration tests detecting key press when running DevSession are not working on Windows
6262
[Environment]::SetEnvironmentVariable("SKIP_KEY_PRESS","true")
63-
[Environment]::SetEnvironmentVariable("DEVFILE_REGISTRY", "$DEVFILE_REGISTRY")
6463

6564
Shout "Login IBMcloud"
6665
ibmcloud login --apikey ${API_KEY}
@@ -71,14 +70,6 @@ function Run-Test {
7170
oc login -u apikey -p ${API_KEY} ${IBM_OPENSHIFT_ENDPOINT}
7271
Check-ExitCode $LASTEXITCODE
7372

74-
Shout "Getting Devfile proxy address"
75-
$DEVFILE_PROXY=$(oc get svc -n devfile-proxy nginx -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
76-
if ( $LASTEXITCODE -eq 0 )
77-
{
78-
Shout "Using Devfile proxy: $DEVFILE_PROXY"
79-
[Environment]::SetEnvironmentVariable("DEVFILE_PROXY", "$DEVFILE_PROXY")
80-
}
81-
8273
Shout "Create Binary"
8374
make install
8475
Shout "Running test"
@@ -109,8 +100,7 @@ $LOGFILE=$args[4]
109100
$REPO=$args[5]
110101
$CLUSTER_ID=$args[6]
111102
$TEST_EXEC_NODES=$args[7]
112-
$DEVFILE_REGISTRY=$args[8]
113-
$SKIP_SERVICE_BINDING_TESTS=$args[9]
103+
$SKIP_SERVICE_BINDING_TESTS=$args[8]
114104
Shout "Args Recived"
115105

116106

.ibm/pipelines/windows-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/wi
1818

1919
#execute test from the test script
2020
export TEST_EXEC_NODES=${TEST_EXEC_NODES:-"16"}
21-
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}" "${SKIP_SERVICE_BINDING_TESTS}"
21+
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}" "${SKIP_SERVICE_BINDING_TESTS}"
2222
RESULT=$?
2323
echo "RESULT: $RESULT"
2424

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ test-e2e:
238238

239239
.PHONY: test-doc-automation
240240
test-doc-automation:
241-
$(RUN_GINKGO) $(GINKGO_FLAGS_ONE) --junit-report="test-doc-automation.xml" tests/documentation/...
241+
$(RUN_GINKGO) $(GINKGO_FLAGS) --junit-report="test-doc-automation.xml" tests/documentation/...
242242

243243

244244
# Generate OpenAPISpec library based on ododevapispec.yaml inside pkg/apiserver-gen; this will only generate interfaces

docs/website/docs/command-reference/docs-mdx/init/interactive_mode_empty_directory_output.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Interactive mode enabled, please answer the following questions:
1515
? Select architectures to filter by: amd64
1616
? Select language: Java
1717
? Select project type: Maven Java
18-
✓ Downloading devfile "java-maven" from registry "DefaultDevfileRegistry" [4s]
18+
? Select version: 1.2.0
19+
✓ Downloading devfile "java-maven:1.2.0" from registry "DefaultDevfileRegistry" [4s]
1920

2021
↪ Container Configuration "tools":
2122
OPEN PORTS:
@@ -30,7 +31,7 @@ Interactive mode enabled, please answer the following questions:
3031
✓ Downloading starter project "springbootproject" [1s]
3132

3233
You can automate this command by executing:
33-
odo init --name my-java-maven-app --devfile java-maven --devfile-registry DefaultDevfileRegistry --starter springbootproject
34+
odo init --name my-java-maven-app --devfile java-maven --devfile-registry DefaultDevfileRegistry --devfile-version 1.2.0 --starter springbootproject
3435

3536
Your new component 'my-java-maven-app' is ready in the current directory.
3637
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.

docs/website/docs/overview/configure.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ Options here are mostly used for debugging and testing `odo` behavior.
189189
| `ODO_DISABLE_TELEMETRY` | Useful for disabling [telemetry collection](https://github.com/redhat-developer/odo/blob/main/USAGE_DATA.md). **Deprecated in v3.2.0**. Use `ODO_TRACKING_CONSENT` instead. | v2.1.0 | `true` |
190190
| `GLOBALODOCONFIG` | Useful for setting a different location of global preference file `preference.yaml`. | v0.0.19 | `~/.config/odo/preference.yaml` |
191191
| `ODO_DEBUG_TELEMETRY_FILE` | Useful for debugging [telemetry](https://github.com/redhat-developer/odo/blob/main/USAGE_DATA.md). When set it will save telemetry data to a file instead of sending it to the server. | v3.0.0-alpha1 | `/tmp/telemetry_data.json` |
192-
| `DEVFILE_PROXY` | Integration tests will use this address as Devfile registry instead of `registry.stage.devfile.io` | v3.0.0-beta3 | `my-registry.example.com` |
193192
| `TELEMETRY_CALLER` | Caller identifier passed to [telemetry](https://github.com/redhat-developer/odo/blob/main/USAGE_DATA.md). Case-insensitive. Acceptable values: `vscode`, `intellij`, `jboss`. | v3.1.0 | `intellij` |
194193
| `ODO_TRACKING_CONSENT` | Useful for controlling [telemetry](https://github.com/redhat-developer/odo/blob/main/USAGE_DATA.md). Acceptable values: `yes` ([enables telemetry](https://github.com/redhat-developer/odo/blob/main/USAGE_DATA.md) and skips consent prompt), `no` (disables telemetry and consent prompt). Takes precedence over the [`ConsentTelemetry`](#preference-key-table) preference. | v3.2.0 | `yes` |
195194
| `ODO_PUSH_IMAGES` | Whether to push the images once built; this is used only when applying Devfile image components as part of a Dev Session running on Podman; this is useful for integration tests running on Podman. `true` by default | v3.7.0 | `false` |

docs/website/docs/user-guides/quickstart/docs-mdx/dotnet/dotnet_odo_init_output.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Based on the files in the current directory odo detected
1212
Supported architectures: all
1313
Language: .NET
1414
Project type: dotnet
15-
The devfile "dotnet50:1.0.3" from the registry "DefaultDevfileRegistry" will be downloaded.
15+
The devfile "dotnet60:1.0.2" from the registry "DefaultDevfileRegistry" will be downloaded.
1616
? Is this correct? No
1717
? Select architectures to filter by: [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
1818
> [x] amd64

docs/website/docs/user-guides/quickstart/docs-mdx/java/java_odo_init_output.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Based on the files in the current directory odo detected
1212
Supported architectures: all
1313
Language: Java
1414
Project type: springboot
15-
The devfile "java-springboot:1.2.0" from the registry "DefaultDevfileRegistry" will be downloaded.
15+
The devfile "java-springboot:1.3.0" from the registry "DefaultDevfileRegistry" will be downloaded.
1616
? Is this correct? Yes
17-
✓ Downloading devfile "java-springboot:1.2.0" from registry "DefaultDevfileRegistry" [3s]
17+
✓ Downloading devfile "java-springboot:1.3.0" from registry "DefaultDevfileRegistry" [3s]
1818

1919
↪ Container Configuration "tools":
2020
OPEN PORTS:
@@ -27,7 +27,7 @@ The devfile "java-springboot:1.2.0" from the registry "DefaultDevfileRegistry" w
2727
? Enter component name: my-java-app
2828

2929
You can automate this command by executing:
30-
odo init --name my-java-app --devfile java-springboot --devfile-registry DefaultDevfileRegistry --devfile-version 1.2.0
30+
odo init --name my-java-app --devfile java-springboot --devfile-registry DefaultDevfileRegistry --devfile-version 1.3.0
3131

3232
Your new component 'my-java-app' is ready in the current directory.
3333
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.

pkg/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
)
99

1010
type Configuration struct {
11-
DevfileProxy *string `env:"DEVFILE_PROXY,noinit"`
1211
DockerCmd string `env:"DOCKER_CMD,default=docker"`
1312
Globalodoconfig *string `env:"GLOBALODOCONFIG,noinit"`
1413
OdoDebugTelemetryFile *string `env:"ODO_DEBUG_TELEMETRY_FILE,noinit"`

pkg/config/config_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func TestDefaultValues(t *testing.T) {
1818
checkDefaultBoolValue(t, "OdoExperimentalMode", cfg.OdoExperimentalMode, false)
1919

2020
// Use noinit to set non initialized value as nil instead of zero-value
21-
checkNilString(t, "DevfileProxy", cfg.DevfileProxy)
2221
checkNilString(t, "Globalodoconfig", cfg.Globalodoconfig)
2322
checkNilString(t, "Globalodoconfig", cfg.Globalodoconfig)
2423
checkNilString(t, "OdoDebugTelemetryFile", cfg.OdoDebugTelemetryFile)

scripts/openshiftci-config.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# This is used in openshiftci-presubmit-all-tests.sh, used by Interop tests.
2+
# Since these interop tests are managed by a different team, we intentionally want to use a stable Devfile registry.
3+
# But our own internal tests make use of the staging Devfile registry.
14
export DEVFILE_REGISTRY=https://devfile-registry-ci-devfile-registry.odo-test-kubernete-449701-49529fc6e6a4a9fe7ebba9a3db5b55c4-0000.eu-de.containers.appdomain.cloud/

tests/documentation/command-reference/doc_command_reference_createnamespace_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ import (
88
"github.com/google/go-cmp/cmp"
99
. "github.com/onsi/ginkgo/v2"
1010
. "github.com/onsi/gomega"
11+
1112
"github.com/redhat-developer/odo/tests/helper"
1213
)
1314

1415
var _ = Describe("doc command reference odo create namespace", func() {
1516
var commonVar helper.CommonVar
1617
var commonPath = filepath.Join("command-reference", "docs-mdx", "create-namespace")
1718
var outputStringFormat = "```console\n$ odo %s\n%s```\n"
19+
var ns string
1820

1921
BeforeEach(func() {
2022
commonVar = helper.CommonBeforeEach()
2123
helper.Chdir(commonVar.Context)
22-
Expect(helper.VerifyFileExists(".odo/env/env.yaml")).To(BeFalse())
24+
ns = helper.GenerateProjectName()
2325
})
2426

2527
AfterEach(func() {
@@ -29,23 +31,27 @@ var _ = Describe("doc command reference odo create namespace", func() {
2931
Context("To create a namespace resource", func() {
3032

3133
AfterEach(func() {
32-
commonVar.CliRunner.DeleteNamespaceProject("odo-dev", true)
34+
if commonVar.CliRunner.HasNamespaceProject(ns) {
35+
commonVar.CliRunner.DeleteNamespaceProject(ns, false)
36+
}
3337
})
3438

3539
It("Creates a namespace resource for a kubernetes cluster", func() {
36-
args := []string{"create", "namespace", "odo-dev"}
40+
args := []string{"create", "namespace", ns}
3741
out := helper.Cmd("odo", args...).ShouldPass().Out()
3842
got := fmt.Sprintf(outputStringFormat, strings.Join(args, " "), helper.StripSpinner(out))
43+
got = strings.ReplaceAll(got, ns, "odo-dev")
3944
file := "create_namespace.mdx"
4045
want := helper.GetMDXContent(filepath.Join(commonPath, file))
4146
diff := cmp.Diff(want, got)
4247
Expect(diff).To(BeEmpty(), file)
4348
})
4449

4550
It("Creates a project resource for a kubernetes cluster", func() {
46-
args := []string{"create", "project", "odo-dev"}
51+
args := []string{"create", "project", ns}
4752
out := helper.Cmd("odo", args...).ShouldPass().Out()
4853
got := fmt.Sprintf(outputStringFormat, strings.Join(args, " "), helper.StripSpinner(out))
54+
got = strings.ReplaceAll(got, ns, "odo-dev")
4955
file := "create_project.mdx"
5056
want := helper.GetMDXContent(filepath.Join(commonPath, file))
5157
diff := cmp.Diff(want, got)

tests/documentation/command-reference/doc_command_reference_deletenamespace_test.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package docautomation
33
import (
44
"fmt"
55
"path/filepath"
6+
"strings"
67

78
"github.com/google/go-cmp/cmp"
89
. "github.com/onsi/ginkgo/v2"
@@ -15,11 +16,12 @@ var _ = Describe("doc command reference odo delete namespace", func() {
1516
var commonVar helper.CommonVar
1617
var commonPath = filepath.Join("command-reference", "docs-mdx", "delete-namespace")
1718
var outputStringFormat = "```console\n$ odo %s\n%s```\n"
19+
var ns string
1820

1921
BeforeEach(func() {
2022
commonVar = helper.CommonBeforeEach()
2123
helper.Chdir(commonVar.Context)
22-
Expect(helper.VerifyFileExists(".odo/env/env.yaml")).To(BeFalse())
24+
ns = helper.GenerateProjectName()
2325
})
2426

2527
AfterEach(func() {
@@ -29,42 +31,45 @@ var _ = Describe("doc command reference odo delete namespace", func() {
2931
Context("To delete a namespace resource", func() {
3032

3133
BeforeEach(func() {
32-
helper.Cmd("odo", "create", "namespace", "odo-dev").ShouldPass()
33-
34+
helper.Cmd("odo", "create", "namespace", ns).ShouldPass()
3435
})
3536

3637
AfterEach(func() {
37-
commonVar.CliRunner.DeleteNamespaceProject("odo-dev", true)
38+
if commonVar.CliRunner.HasNamespaceProject(ns) {
39+
commonVar.CliRunner.DeleteNamespaceProject(ns, false)
40+
}
3841
})
3942

4043
It("Deletes a namespace resource for a kubernetes cluster", func() {
41-
args := []string{"odo", "delete", "namespace", "odo-dev"}
44+
args := []string{"odo", "delete", "namespace", ns}
4245
out, err := helper.RunInteractive(args, []string{"ODO_LOG_LEVEL=0"}, func(ctx helper.InteractiveContext) {
43-
helper.ExpectString(ctx, "? Are you sure you want to delete namespace \"odo-dev\"?")
46+
helper.ExpectString(ctx, fmt.Sprintf("? Are you sure you want to delete namespace %q?", ns))
4447
helper.SendLine(ctx, "Yes")
4548

4649
})
4750
Expect(err).To(BeNil())
4851
got := helper.StripAnsi(out)
4952
got = helper.StripInteractiveQuestion(got)
5053
got = fmt.Sprintf(outputStringFormat, args[1], helper.StripSpinner(got))
54+
got = strings.ReplaceAll(got, ns, "odo-dev")
5155
file := "delete_namespace.mdx"
5256
want := helper.GetMDXContent(filepath.Join(commonPath, file))
5357
diff := cmp.Diff(want, got)
5458
Expect(diff).To(BeEmpty(), file)
5559
})
5660

5761
It("Deletes a project resource for a openshift cluster", func() {
58-
args := []string{"odo", "delete", "project", "odo-dev"}
62+
args := []string{"odo", "delete", "project", ns}
5963
out, err := helper.RunInteractive(args, []string{"ODO_LOG_LEVEL=0"}, func(ctx helper.InteractiveContext) {
60-
helper.ExpectString(ctx, "? Are you sure you want to delete project \"odo-dev\"?")
64+
helper.ExpectString(ctx, fmt.Sprintf("? Are you sure you want to delete project %q?", ns))
6165
helper.SendLine(ctx, "Yes")
6266

6367
})
6468
Expect(err).To(BeNil())
6569
got := helper.StripAnsi(out)
6670
got = helper.StripInteractiveQuestion(got)
6771
got = fmt.Sprintf(outputStringFormat, args[1], helper.StripSpinner(got))
72+
got = strings.ReplaceAll(got, ns, "odo-dev")
6873
file := "delete_project.mdx"
6974
want := helper.GetMDXContent(filepath.Join(commonPath, file))
7075
diff := cmp.Diff(want, got)

tests/documentation/command-reference/doc_command_reference_init_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ var _ = Describe("doc command reference odo init", Label(helper.LabelNoCluster),
4141
helper.ExpectString(ctx, "Select project type")
4242
helper.SendLine(ctx, "")
4343

44+
if helper.HasAtLeastTwoVersions("", "java-maven") {
45+
helper.ExpectString(ctx, "Select version")
46+
helper.SendLine(ctx, "")
47+
}
48+
4449
helper.ExpectString(ctx, "Select container for which you want to change configuration?")
4550
helper.SendLine(ctx, "")
4651

0 commit comments

Comments
 (0)