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 runtest script with all the dependencies #4

Open
perellonieto opened this issue Jun 9, 2017 · 5 comments
Open

Add runtest script with all the dependencies #4

perellonieto opened this issue Jun 9, 2017 · 5 comments

Comments

@perellonieto
Copy link
Member

Should we create a script with a contained runtest maybe using Docker containers? Something like this runtest.sh

#!/bin/bash

echo "Activating virtual environment"
. ./venv/bin/activate

echo "Starting MongoDB server"
sudo service mongodb start
#
#MONGODB_CONTAINER=`docker run --name hs_mongodb -p 27017:27017 -d library/mongo`
## Wait for the MONGODB port to be available
#until nc -z $(docker inspect --format='{{.NetworkSettings.IPAddress}}' $MONGODB_CONTAINER) 27017
#do
#    echo "waiting for docker MongoDB container..."
#    sleep 0.5
#done

echo "Starting docker MQTT container"
MQTT_CONTAINER=`docker run --name hs_mqtt -d -ti -p 1883:1883 -p 9001:9001 toke/mosquitto`
# Wait for the MQTT port to be available
until nc -z $(docker inspect --format='{{.NetworkSettings.IPAddress}}' $MQTT_CONTAINER) 9001
do
    echo "waiting for docker MQTT container..."
    sleep 0.5
done
nosetests --with-coverage

echo "Stopping docker MQTT container"
docker stop hs_mqtt
echo "Removing docker MQTT container"
docker rm hs_mqtt
echo "Stopping MongoDB server"
sudo service mongodb stop

I had to comment the MongoDB container and run my own version of MongoDB because I don't have enough space in my root.

@perellonieto perellonieto changed the title Runtest Add runtest script with all the dependencies Jun 9, 2017
@tdiethe
Copy link
Member

tdiethe commented Jun 16, 2017

Looks like a good idea - although do the new dockerfiles mean this is no longer needed?

@perellonieto
Copy link
Member Author

You are right about the new docker bundle. I tried it and at this moment it runs the test. However, in my understanding, it pulls the master branch and runs the test of the last version in GitHub.
I finished one version of the script that runs it locally in the pull request #6 .
The script needs to be improved as there are some problems if the script does not finish properly.

@tdiethe
Copy link
Member

tdiethe commented Jun 19, 2017

Ok sounds good

@tdiethe tdiethe added this to the Public Announcement milestone Jun 23, 2017
@tdiethe
Copy link
Member

tdiethe commented Jul 24, 2017

Can this one be closed?

@tdiethe tdiethe removed this from the Public Announcement milestone Jul 27, 2017
@perellonieto
Copy link
Member Author

The commit 6271d2d solves partially this issue. However, it could be improved.
At this moment it assumes the following

  • MongoDB server is not running
  • MQTT servers is not running
  • Docker is installed
    And then, it starts a MongoDB and MQTT docker containers. If they start properly, then the unit-test start.

Do you think this is enough, or should we extend this script for cases where only MongoDB server is running or other possible permutations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants