Skip to content

Commit

Permalink
Merge pull request SAP-archive#6 from hana-infrastructure/contest
Browse files Browse the repository at this point in the history
Contest
  • Loading branch information
firnkes committed Aug 11, 2016
2 parents 296461f + 8175c7f commit 5ef8911
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
23 changes: 23 additions & 0 deletions contest/run_tests.py
@@ -0,0 +1,23 @@
import socket
import time
import pytest
import sys

def main():

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

while True:
result = sock.connect_ex(('127.0.0.1', 30015))
if result == 0:
break
else:
print("hana not available yet, retrying...")
time.sleep(10)

rc = pytest.main(sys.argv[1:])
if rc != 0:
sys.exit("pytest run has failed")

if __name__ == "__main__":
main()
26 changes: 26 additions & 0 deletions contest/taskDef.yaml
@@ -0,0 +1,26 @@
version: 0.1
name: pyhdb-test
containers:
- name: pytest-runner
image: docker.wdf.sap.corp:51037/contest/pytest-runner:2.7
command: ['bash', '-c', 'python /src/${REPO_NAME}/contest/run_tests.py /src/${REPO_NAME}/tests/']
resources:
requests:
cpu: 1000m
memory: 500m
withHelpers:
- kind: exportDir
mountPath: /exports
- kind: syncEventSources
mountPath: /src
- kind: injectEventData

- name: hana
image: docker.wdf.sap.corp:51037/contest/ppms_hana_112_04_standalone:1.0
resources:
requests:
cpu: 2000m
memory: 12Gi

command: ['bash', '/tools/build', '/tools/wait.sh']
mainContainer: pytest-runner
5 changes: 5 additions & 0 deletions setup.cfg
@@ -0,0 +1,5 @@
[pytest]
hana_host = localhost
hana_port = 30015
hana_user = System
hana_password = Password01

0 comments on commit 5ef8911

Please sign in to comment.