Disable service binding related integration tests (#6920)

* check SKIP_SERVICE_BINDING_TESTS to skip service binding tests

* Pass SKIP_SERVICE_BINDING_TESTS to Windows for Windows tests

* Use fsGroup on Kubernetes

* add instructions to install devfile registry in cluster
This commit is contained in:
Philippe Martin
2023-06-23 18:20:46 +02:00
committed by GitHub
parent d9d868fd6b
commit ae28de1012
12 changed files with 108 additions and 3 deletions

View File

@@ -0,0 +1,55 @@
schemaVersion: 2.0.0
metadata:
name: nodejs
projectType: nodejs
language: nodejs
starterProjects:
- name: nodejs-starter
git:
remotes:
origin: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- name: runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
endpoints:
- name: "3000-tcp"
targetPort: 3000
mountSources: true
attributes:
pod-overrides:
spec:
securityContext:
fsGroup: 2000
commands:
- id: devbuild
exec:
component: runtime
commandLine: npm install
workingDir: ${PROJECTS_ROOT}
group:
kind: build
isDefault: true
- id: build
exec:
component: runtime
commandLine: npm install
workingDir: ${PROJECTS_ROOT}
group:
kind: build
- id: devrun
exec:
component: runtime
commandLine: npm start
workingDir: ${PROJECTS_ROOT}
group:
kind: run
isDefault: true
- id: run
exec:
component: runtime
commandLine: npm start
workingDir: ${PROJECTS_ROOT}
group:
kind: run

View File

@@ -2,6 +2,7 @@ package integration
import (
"fmt"
"os"
"path/filepath"
. "github.com/onsi/ginkgo/v2"
@@ -20,6 +21,11 @@ var _ = Describe("odo add binding command tests", func() {
var err error
var _ = BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)
// Ensure that the operators are installed

View File

@@ -17,6 +17,11 @@ var _ = Describe("odo describe/list binding command tests", func() {
// This is run before every Spec (It)
var _ = BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)
})

View File

@@ -71,7 +71,11 @@ var _ = Describe("odo dev command tests", func() {
When("a component is bootstrapped", func() {
BeforeEach(func() {
helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), commonVar.Context)
helper.Cmd("odo", "init", "--name", cmpName, "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", "devfile.yaml")).ShouldPass()
devfile := "devfile.yaml"
if os.Getenv("KUBERNETES") == "true" {
devfile = "devfile-fsgroup.yaml"
}
helper.Cmd("odo", "init", "--name", cmpName, "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", devfile)).ShouldPass()
Expect(helper.VerifyFileExists(".odo/env/env.yaml")).To(BeFalse())
})
@@ -1786,6 +1790,11 @@ ComponentSettings:
When("Starting a PostgreSQL service", func() {
BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
// Ensure that the operators are installed
commonVar.CliRunner.EnsureOperatorIsInstalled("service-binding-operator")
commonVar.CliRunner.EnsureOperatorIsInstalled("cloud-native-postgresql")

View File

@@ -385,6 +385,11 @@ ComponentSettings:
When("deploying a ServiceBinding k8s resource", func() {
const serviceBindingName = "my-nodejs-app-cluster-sample" // hard-coded from devfile-deploy-with-SB.yaml
BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar.CliRunner.EnsureOperatorIsInstalled("service-binding-operator")
commonVar.CliRunner.EnsureOperatorIsInstalled("cloud-native-postgresql")
Eventually(func() string {

View File

@@ -1,6 +1,8 @@
package integration
import (
"os"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/redhat-developer/odo/tests/helper"
@@ -12,6 +14,11 @@ var _ = Describe("odo list services tests", func() {
var randomProject string
BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar = helper.CommonBeforeEach()
// Ensure that the operators are installed

View File

@@ -2,6 +2,7 @@ package integration
import (
"fmt"
"os"
"path/filepath"
. "github.com/onsi/ginkgo/v2"
@@ -14,6 +15,11 @@ var _ = Describe("odo remove binding command tests", func() {
var commonVar helper.CommonVar
var _ = BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)
// Note: We do not add any operators here because `odo remove binding` is simply about removing the ServiceBinding from devfile.

View File

@@ -20,6 +20,11 @@ var _ = Describe("odo add binding interactive command tests", func() {
// This is run before every Spec (It)
var _ = BeforeEach(func() {
skipLogin := os.Getenv("SKIP_SERVICE_BINDING_TESTS")
if skipLogin == "true" {
Skip("Skipping service binding tests as SKIP_SERVICE_BINDING_TESTS is true")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)