Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests for devfile storage and exec #2838

Merged
merged 5 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

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: /