From 5c2f04c6595eef6cb2afd6ad2b4928856ed131d6 Mon Sep 17 00:00:00 2001 From: Nikolay Stanchev <ns17@it-innovation.soton.ac.uk> Date: Fri, 2 Mar 2018 13:38:55 +0000 Subject: [PATCH] [ Issue #56 ] - Update README file, info for generating test data --- README.md | 15 +++++++++++++-- test/streaming-sim/StreamingSim.py | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5407eb9..48e1606 100644 --- a/README.md +++ b/README.md @@ -119,11 +119,22 @@ use this } ``` -Run a python script to generate the test data sets +The next step is to generate the test data, which could be done in two ways. + +First option is to run a python script to generate the test data sets `python3 /vagrant/test/streaming-sim/StreamingSim.py` -Test the generated data set by executing the following command +This script could also be used to clear the generated data by using the '-c' option + +`python3 /vagrant/test/streaming-sim/StreamingSim.py -c` + +The second option is to directly run the testing module, which will detect if the data was generated, and if not, will automatically +generate the data before executing the tests. Keep in mind that if the test data is being generated using this way, a 10 seconds timeout +is given after the generation is finished so that the data could properly be inserted into the database. If the data was already generated +using the first option, only the tests would be executed. + +The command for running the testing module is `pytest -s /vagrant/test/streaming-sim/VerifySimResults.py` diff --git a/test/streaming-sim/StreamingSim.py b/test/streaming-sim/StreamingSim.py index 9c9b35e..a2e3737 100644 --- a/test/streaming-sim/StreamingSim.py +++ b/test/streaming-sim/StreamingSim.py @@ -210,6 +210,8 @@ def run_simulation_fixture(): if "CLMCMetrics" not in dbs: simulator = Sim(INFLUX_DB_URL) simulator.run(SIMULATION_TIME_SEC) + + print("10 seconds timeout is given so that the data could properly be inserted into the database.") import time time.sleep(10) -- GitLab