e-mission / em-public-dashboard

A simple and stupid public dashboard prototype.
BSD 3-Clause "New" or "Revised" License
1 stars 23 forks source link

Enable automated testing for Public Dashboard #171

Open iantei opened 1 day ago

iantei commented 1 day ago

Currently, we are testing the changes for the Public Dashboard in the following way:

  1. Load the dataset into MongoDB using load_mongodump.sh script.

  2. Execute the docker-compose:

    docker-compose -f docker-compose.yml build
    docker-compose -f docker-compose.yml up
  3. Once the docker containers are up, we enter into the docker container for server

    docker exec -it em-public-dashboard-notebook-server-1 /bin/bash
    source setup/activate.sh && cd saved-notebooks
  4. Then execute the generate_plots.py scripts to pass notebooks as the args

    python bin/generate_plots.py generic_metrics.ipynb default
    python bin/generate_plots.py generic_metrics_sensed.ipynb default
    ...
  5. Then launch the http://localhost:3274 and test the changes in it.

iantei commented 16 hours ago

Explored into other repository, primarily, e-mission-server, to see how the testing was executed automatically.

Following approach has been used for the setup of automated testing:

CMD ["/bin/bash", "/start_script.sh"]


This runs: `start_script.sh` which has the following:

source setup/setup_tests.sh source setup/activate_tests.sh ./runAllTests.sh


runAllTests.sh has the following script:

PYTHONPATH=. python -m unittest discover -s emission/tests -p Test*;



Finds all the unites files which start with Test, and executes the test.
iantei commented 16 hours ago

e-mission-server makes use of GitHub Actions and unittest - unit testing framework, to execute test cases for the e-mission-server automatically.

iantei commented 15 hours ago

For em-public-dashboard, we have extensive use of .ipynb python Jupyter notebooks, along with few python .py files.

iantei commented 15 hours ago

While following the above mentioned steps in e-mission-server enables unit testing the code of em-public-dashboard; I am also considering the aspect of how can we automate this process :

Accounting both of the cases of automating the current process in more linear way, and utilizing the automation unit testing process alike in server side, I would like to propose two different tasks at a very high level to execute this task of "Enable automated testing for Public Dashboard":

@shankari @JGreenlee Please let me know about your thoughts on this.