Skip to content
Snippets Groups Projects
Commit 689e8a07 authored by Philipp Rüssmann's avatar Philipp Rüssmann
Browse files

Add check if rabbitmq is running

parent 7a6460c4
No related branches found
No related tags found
No related merge requests found
echo
echo "Clone aiida-kkr"
#download aiida-kkr to have tests directory
git clone --depth=1 https://github.com/JuDFTteam/aiida-kkr.git
echo
echo "fake executable paths"
# fake code install (reuse already compiled code)
mkdir aiida-kkr/aiida_kkr/tests/jukkr
ln -s ../../kkr.x aiida-kkr/aiida_kkr/tests/jukkr/kkr.x
ln -s ../../voronoi.exe aiida-kkr/aiida_kkr/tests/jukkr/voronoi.exe
ln -s ../../../ElementDataBase aiida-kkr/aiida_kkr/tests/jukkr/ElementDataBase
ln -s ../../../../../../kkr.x aiida-kkr/aiida_kkr/tests/jukkr/kkr.x
ln -s ../../../../../../voronoi.exe aiida-kkr/aiida_kkr/tests/jukkr/voronoi.exe
ln -s ../../../../../../../ElementDataBase aiida-kkr/aiida_kkr/tests/jukkr/ElementDataBase
echo
echo "install aiida-kkr"
virtualenv venv_aiida-kkr && source venv_aiida-kkr/bin/activate && \
pip install git+https://github.com/JuDFTteam/masci-tools@master && \
cd aiida-kkr && pip install aiida-kkr && \
reentry scan -r aiida && cd ../
# now run aiida-kkr tests
cd aiida-kkr/aiida_kkr/tests/
echo
echo "change dbsetup.py"
# change dbsetup to match slurm settings
sed -i "s/kkr_codename = 'kkrhost'/kkr_codename = 'KKRhost'/g" dbsetup.py
#sed -i "s/computername = 'localhost'/computername = 'slurmcontrol'/g" dbsetup.py
#sed -i "s/kkr_codename = 'kkrhost'/kkr_codename = 'KKRcode'/g" dbsetup.py
echo
echo "run standard tests"
# first run tests without doing actual kkr or kkrimp calculations (only voronoi included)
./run_all.sh
#echo
#echo "run kkrhost tests"
# now do kkr calculations
pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_dos_workflow
pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_gf_writeout_workflow
pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_scf_workflow
#pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_dos_workflow
#pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_gf_writeout_workflow
#pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_scf_workflow
# and finally kkrimp calculations
#pytest --cov-report=term-missing --cov-append --cov=aiida_kkr --ignore=jukkr -k Test_kkrimp_scf_workflow
......
#!/usr/bin/env python
import pika
from time import sleep, time
import timeout_decorator
@timeout_decorator.timeout(5)
def rmq_listen():
channel.start_consuming()
# Part 1: send message
print "Start sending message..."
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
msg = 'Hello World! {}'.format(time())
channel.basic_publish(exchange='',routing_key='hello', body=msg)
print " [x] Sent '{}'".format(msg)
connection.close()
print "done sending message. Wait for 5 seconds and start receiving..."
sleep(5)
# Part 2: receive message
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print ' [*] Waiting 5 seconds for messages.'
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
channel.basic_consume(callback, queue='hello', no_ack=True)
try:
rmq_listen()
except timeout_decorator.timeout_decorator.TimeoutError:
print "Done waiting, now close connection"
connection.close()
......@@ -550,6 +550,8 @@ run_kkrhost:intel:aiida-kkr:
- tests/KKRhost/tools/setup_codes_aiida.sh
# start rabbitmq message broker in background
- rabbitmq-server -detached
# check if rabbit mq is running
- tests/KKRhost/tools/check_pika-rabbitmq.py
# finally run simple test case using kkr_scf workflow of aiida
- tests/KKRhost/tools/aiida_simple_test.py
# check some output of the calculation and export aiida database
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment