Make sure to use random component names when copying sample Devfiles in integration tests (#6504)

* Make sure to use unique random component names in integration tests

This will help prevent conflicts when isolation is not possible (for example on Podman)

For consistency, next step would be not to use 'odo init --devfile-path', but instead rely on the updated helper.CopyExampleDevfile function everywhere.

* fixup! Make sure to use unique random component names in integration tests

* Eventually check server response in 'should expose all endpoints on localhost regardless of exposure' test
This commit is contained in:
Armel Soro
2023-01-18 18:39:47 +01:00
committed by GitHub
parent 8dbf42e5e1
commit 51ebf26dcb
11 changed files with 346 additions and 217 deletions

View File

@@ -96,11 +96,15 @@ var _ = Describe("odo list with devfile", func() {
When("a component created in 'app' application", func() {
var devSession helper.DevSession
var componentName = "nodejs-prj1-api-abhz" // from devfile-deploy.yaml
var componentName string
BeforeEach(func() {
componentName = helper.RandString(6)
helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context)
helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile-deploy.yaml"), path.Join(commonVar.Context, "devfile.yaml"))
helper.CopyExampleDevFile(
filepath.Join("source", "devfiles", "nodejs", "devfile-deploy.yaml"),
path.Join(commonVar.Context, "devfile.yaml"),
helper.DevfileMetadataNameSetter(componentName))
helper.Chdir(commonVar.Context)
})