Skip to content

Commit

Permalink
Add integration tests for devfile storage and exec (#2838)
Browse files Browse the repository at this point in the history
* Add integration tests for devfile storage and exec

Signed-off-by: Maysun J Faisal <maysun.j.faisal@ibm.com>

* Update devfile integration tests for port

Signed-off-by: Maysun J Faisal <maysun.j.faisal@ibm.com>

* Devfile integration tests, clone project

Signed-off-by: Maysun J Faisal <maysun.j.faisal@ibm.com>

* Update devfile integration tests to have springboot

Signed-off-by: Maysun J Faisal <maysun.j.faisal@ibm.com>

* update devfile delete integration test

Signed-off-by: Maysun J Faisal <maysun.j.faisal@ibm.com>
  • Loading branch information
maysunfaisal committed Apr 15, 2020
1 parent 77681be commit 0da6ff4
Show file tree
Hide file tree
Showing 17 changed files with 468 additions and 274 deletions.

This file was deleted.

28 changes: 0 additions & 28 deletions tests/examples/source/devfiles/nodejs-multicontainer/devfile.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions tests/examples/source/devfiles/nodejs-multicontainer/package.json

This file was deleted.

35 changes: 0 additions & 35 deletions tests/examples/source/devfiles/nodejs-multicontainer/server.js

This file was deleted.

2 changes: 0 additions & 2 deletions tests/examples/source/devfiles/nodejs/.gitignore

This file was deleted.

25 changes: 14 additions & 11 deletions tests/examples/source/devfiles/nodejs/devfile-no-endpoints.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
apiVersion: 1.0.0
metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- type: dockerimage
image: node:stretch
command: ["tail", "-f", "/dev/null"]
image: quay.io/eclipse/che-nodejs10-ubi:nightly
alias: runtime
memoryLimit: 1024Mi
mountSources: true
commands:
-
name: build
- name: devbuild
actions:
-
type: exec
- type: exec
component: runtime
command: "npm install"
-
name: devrun
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
- name: devrun
actions:
-
type: exec
- type: exec
component: runtime
command: "node run"
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
47 changes: 47 additions & 0 deletions tests/examples/source/devfiles/nodejs/devfile-with-volumes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: 1.0.0
metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- type: dockerimage
image: quay.io/eclipse/che-nodejs10-ubi:nightly
endpoints:
- name: "3000/tcp"
port: 3000
alias: runtime
env:
- name: FOO
value: "bar"
memoryLimit: 1024Mi
mountSources: true
volumes:
- name: myvol
containerPath: /data
- type: dockerimage
image: quay.io/eclipse/che-nodejs10-ubi:nightly
alias: runtime2
memoryLimit: 1024Mi
mountSources: false
volumes:
- name: myvol
containerPath: /data
- name: myvol2
containerPath: /data2
commands:
- name: devbuild
actions:
- type: exec
component: runtime
command: "echo hello >> myfile.log"
workdir: /data
- name: devrun
actions:
- type: exec
component: runtime2
command: "cat myfile.log"
workdir: /data
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: 1.0.0
metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- type: dockerimage
image: quay.io/eclipse/che-nodejs10-ubi:nightly
endpoints:
- name: "3000/tcp"
port: 3000
alias: runtime
env:
- name: FOO
value: "bar"
memoryLimit: 1024Mi
mountSources: true
commands:
- name: devrun
actions:
- type: exec
component: runtime
command: "npm install && nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
26 changes: 23 additions & 3 deletions tests/examples/source/devfiles/nodejs/devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
apiVersion: 1.0.0
metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- type: dockerimage
image: quay.io/eclipse/che-nodejs10-ubi:nightly
endpoints:
- name: "9090/tcp"
port: 9090
- name: "3000/tcp"
port: 3000
alias: runtime
env:
- name: FOO
Expand All @@ -19,8 +25,22 @@ commands:
- type: exec
component: runtime
command: "npm install"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
- name: devbuild
actions:
- type: exec
component: runtime
command: "npm install"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
- name: run
actions:
- type: exec
component: runtime
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
- name: devrun
actions:
- type: exec
component: runtime
command: "node run"
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
30 changes: 0 additions & 30 deletions tests/examples/source/devfiles/nodejs/package.json

This file was deleted.

35 changes: 0 additions & 35 deletions tests/examples/source/devfiles/nodejs/server.js

This file was deleted.

55 changes: 55 additions & 0 deletions tests/examples/source/devfiles/springboot/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
apiVersion: 1.0.0
metadata:
generateName: java-spring-boot
projects:
-
name: springbootproject
source:
type: git
location: "https://github.com/maysunfaisal/springboot.git"
components:
-
type: chePlugin
id: redhat/java/latest
memoryLimit: 1512Mi
-
type: dockerimage
image: maysunfaisal/springbootbuild
alias: tools
memoryLimit: 768Mi
command: ['tail']
args: [ '-f', '/dev/null']
mountSources: true
volumes:
- name: springbootpvc
containerPath: /data
-
type: dockerimage
image: maysunfaisal/springbootruntime
alias: runtime
memoryLimit: 768Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: false
volumes:
- name: springbootpvc
containerPath: /data
commands:
-
name: devBuild
actions:
-
type: exec
component: tools
command: "/artifacts/bin/build-container-full.sh"
workdir: /projects/springbootproject
-
name: devRun
actions:
-
type: exec
component: runtime
command: "/artifacts/bin/start-server.sh"
workdir: /

0 comments on commit 0da6ff4

Please sign in to comment.