GMHazard Tester is a simple flask application to do two jobs:

  1. Benchmark tests for PR - GMHazard
  2. Daily API tests
    1. Core API - It is currently disabled as it keeps failing within the daily tests, whereas it passes with no issue if you manually do it on Mantle or local
    2. Project API - It needs set up

Simple Flask server with one endpoint to communicate with GitHub, specifically the GMHazard repository.

Whenever we create pull request(s) on this repo, GitHub will send a request to our test server to perform a benchmark test - gmhazard_clac and sha_calc

We implemented workers with Celery - More information

Workflow

  1. Open a pull request on GMHazard repo
  2. GitHub sends a request to our gmhazar_tester server
  3. Then the server tells the worker to do some setup - Create a virtual environment, install some required packages - Check the file called setup.sh
  4. Then run pytests for gmhazard_calc and sha_calc - Check the file called run_tests.sh
  5. After the tests are completed, it checks the test results. If it passes, you see a green light on the pull request, and the test directory will also be removed.
    However, if the tests fail, you see a red light on the pull request, and the server will send a message to the Slack channel to tag the person who opened the pull request to investigate

Just like any other Flask servers we have, it's already written in a service script. Hence, all you have to do is, run the following commands:

  1. Make sure you pull the latest main branch at

    /home/seistech/tests/gmhazard_tester
  2. Restart the server and worker with

    # To check the worker's status
    sudo service gmhazard_tests_worker status
    
    # To start a worker service
    sudo service gmhazard_tests_worker start
    
    # To stop a worker service
    sudo service gmhazard_tests_worker stop
    # To check the server's status
    sudo service gmhazard_tests_server status
    
    # To start a server service
    sudo service gmhazard_tests_server start
    
    # To stop a server service
    sudo service gmhazard_tests_server stop
  • No labels