-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8533e0c
commit 6395f19
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
node('docker') { | ||
|
||
stage('Preparation') { | ||
|
||
def mycontainer = docker.image('elastest/ci-docker-e2e:latest') | ||
mycontainer.pull() | ||
mycontainer.inside("-u jenkins -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm") { | ||
sh '/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &' | ||
git 'https://github.com/elastest/elastest-monitoring-service.git' | ||
|
||
stage('ElasTest starting'){ | ||
sh "docker run --rm -v /var/run/docker.sock:/var/run/docker.sock elastest/platform stop" | ||
try { | ||
sh "docker rm -f elastest-platform" | ||
} catch(e) { | ||
echo "Error: $e" | ||
} | ||
|
||
sh "docker run --name elastest-platform -d --rm -v /var/run/docker.sock:/var/run/docker.sock elastest/platform start --mode experimental-lite" | ||
sh "docker run --rm -v /var/run/docker.sock:/var/run/docker.sock elastest/platform wait --running=240" | ||
sh "docker logs elastest-platform" | ||
|
||
containerId= sh ( | ||
script: 'cat /proc/self/cgroup | grep "docker" | sed s/\\\\//\\\\n/g | tail -1', | ||
returnStdout: true | ||
).trim() | ||
|
||
echo "containerId = ${containerId}" | ||
sh "docker network connect elastest_elastest "+ containerId | ||
etEmpApi= sh ( | ||
script: 'docker inspect --format=\\"{{.NetworkSettings.Networks.elastest_elastest.IPAddress}}\\" elastest_etm_1', | ||
returnStdout: true | ||
).trim() | ||
echo "ETM container IP=${etEmpApi}" | ||
|
||
elastestURL= sh( | ||
script: 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock elastest/platform wait --running=240 | grep available | sed "s/.*at //"', | ||
returnStdout: true | ||
).trim() | ||
echo "Elastest URL=${elastestURL}" | ||
} | ||
|
||
stage ("E2E tests") { | ||
cd e2e-test | ||
python e2etest.py ${elastestURL}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import unittest | ||
import requests | ||
import os | ||
import sys | ||
|
||
def e2etests(): | ||
tormurl=sys.argv[1] | ||
print tormurl | ||
#proxyurl="http://" + "localhost" + ":8080/" | ||
|
||
#def test_send_request(self): | ||
# s=requests.Session() | ||
# response=s.get(tormurl) | ||
# assert "ElasTest Torm" in response.text | ||
|
||
if __name__=="__main__": | ||
e2etests() |