Testing CloudFoundry Apps..without CloudFoundry
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/3940304/tglogo.png)
![](https://www.msg.group/images/msg-logo.png)
About me
- Technical Guidance Unit @ msg systems
- organizer and speaker at #itconsapcj, now at it's 7th edition. www.itconferencesap.com
- Interests & Background:
- Cloud-Native dev., CloudFoundry
- DevOps, Continuous Everything
- ABAP, BOPF, S/4HANA
https://people.sap.com/victor.ionescu
@ivictor88 ( <-- look here for slides )
![](http://is4.mzstatic.com/image/thumb/Purple128/v4/a1/84/ab/a184abbc-01ba-1d7a-5542-ef8d4a7457fb/source/1200x630bb.jpg)
![](http://cmapsanalytics.com/images/scn.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4693882/GitHub-Mark-120px-plus.png)
ionescuv.github.io
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/3940304/tglogo.png)
![](https://uploads-ssl.webflow.com/573c23c7f97dd46d4f9c63f0/5b7d1d94ece07f5d9ae005bb_msg_SAP_Conference_2018_1920x768.png)
![](http://is4.mzstatic.com/image/thumb/Purple128/v4/a1/84/ab/a184abbc-01ba-1d7a-5542-ef8d4a7457fb/source/1200x630bb.jpg)
Stay tuned for updates!
www.itconferencesap.com
Motivation
"create Order out of Chaos"
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5911465/before.png)
Sample architecture(XSA) on SAP Cloud Platform, Cloud Foundry
Test this!
Getting things to run
maven/npm
Environment
Security
Database
Downstream dependencies
Application Runtime
App Binaries
Networking
Platform services
There are many ways to get things done
"let's just disable security temporarily"
set JAVA_HOME=/jre1.8.0_121
...
doSomeLogic();
// commented out for testing
// callOtherSystem();
...
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/6018702/pasted-from-clipboard.png)
Snowflakes
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5912030/pasted-from-clipboard.png)
Dev/Prod Parity
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5912024/pasted-from-clipboard.png)
Test environment qualities
"Test-Environment-as-Code"
- consistent
- easy to set up
- centrally managed
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5289518/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5289518/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5289518/pasted-from-clipboard.png)
- The Test Environment is your product
- The development team is your customer
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5289469/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4185556/container.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4185556/container.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4185556/container.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4185556/container.png)
Test-Environment-as-Code
..now back to Cloud Foundry
- open-source PaaS ("Linux of the Cloud")
- handles building, deployment and monitoring of apps (Java, Node.JS and many more)
- provides multiple services for the apps to use
- hides complexities of underlying Infrastructure
![](https://www.cloudfoundry.org/wp-content/uploads/2017/01/CF-logo.png)
Cloud Foundry Under the Hood
- Containerization
- => Buildpacks
- Services
- => Service brokers
- => Application environment
- Network
- => Routes
Test Environment for SAP Cloud Platform, CF
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5911465/before.png)
Cloud Foundry space:
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/5912044/after.png)
Test Environment:
Test Environment:
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/6018169/pasted-from-clipboard.png)
- Containerization
- => Buildpacks
- Services
- => Service brokers
- => Application environment
- Network
- => Routes
Docker
cf service-keys
mustache
cf-local
container networking
Cloud Foundry
Test Environment
"docker-composing" the puzzle
version: '3'
services:
launchpad:
build: ../src/launchpad
container_name: launchpad
ports:
- "8080:8080"
networks:
- NET1
environment:
- PORT=8080
- VCAP_SERVICES={"portal-services":[{"binding_name":null,"credentials":{...
- DESTINATIONS=[{"name":"app1","url":"http://spring-app1","forwardAuthToken":true},...
- sapui5url=https://sapui5.hana.ondemand.com/1.56.10
app1:
build: ../src/app
container_name: spring-app1
networks:
- NET1
environment:
- SPRING_PROFILES_ACTIVE=cloud
- VCAP_APPLICATION={}
- VCAP_SERVICES={"postgresql":[{..."host":"mypostgres"..
postgres:
image: "postgres"
container_name: mypostgres
networks:
- NET1
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
Demo Time
![](http://cmapsanalytics.com/images/scn.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4693882/GitHub-Mark-120px-plus.png)
or DIY:
https://people.sap.com/victor.ionescu
@ivictor88
![](http://is4.mzstatic.com/image/thumb/Purple128/v4/a1/84/ab/a184abbc-01ba-1d7a-5542-ef8d4a7457fb/source/1200x630bb.jpg)
![](http://cmapsanalytics.com/images/scn.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/726649/images/4693882/GitHub-Mark-120px-plus.png)
ionescuv.github.io
Q&A
Testing CloudFoundry Apps..without CloudFoundry
By Victor Ionescu
Testing CloudFoundry Apps..without CloudFoundry
SAP InsideTrack Timisoara
- 2,117