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

Create tests for URL endpoints #40

Open
chovanecm opened this issue Jun 1, 2017 · 0 comments
Open

Create tests for URL endpoints #40

chovanecm opened this issue Jun 1, 2017 · 0 comments
Assignees
Labels

Comments

@chovanecm
Copy link
Owner

chovanecm commented Jun 1, 2017

For testing that the Sacredboard backend returns what is expected, tests should be created that send requests to the Backend and check the response.
The tester should be able to select the backend to test against but the tests should be performed on a known set of data.

What to test:

  1. /api/run - simple fetch, sorting, filtering, pagination
  2. /api/run/ - a single run including the full run object, including config and info.
  3. TBD

The outputs in json may have different formatting (e.g. not pretty-printed).
Note: the content of "object" contains dates serialized as timestamps: there is currently no front-end functionality to convert it to back to a date as it is not needed (the start_time is already passed as a formatted string in the Run header):

        "start_time":{  
           "$date":1489763136401
        },

/api/run Example

{
    "draw": 1,
    "recordsTotal": 2,
    "recordsFiltered": 2,
    "data": [
    {
        "id": "3",
        "experiment_name": "iris_rbf_svm",
        "command": "run",
        "status": "COMPLETED",
        "is_alive": false,
        "start_time": "15:05:36 17.3.2017",
        "heartbeat": "15:05:36 17.3.2017",
        "heartbeat_diff": 6535250.874869,
        "hostname": "vmmint18",
        
        "result":0.95
    },
        
    {
        "id": "4",
        "experiment_name": "German nouns",
        "command": "runExperiment",
        "status": "RUNNING",
        "is_alive": false,
        "start_time": "09:49:56 30.3.2017",
        "heartbeat": "09:50:26 30.3.2017",
        "heartbeat_diff": 5430960.722107,
        "hostname": "ntbthinkpad",
        
        "result":""
    }]

/api/run/id Example where id=3

{  
   "draw":1,
   "recordsTotal":1,
   "recordsFiltered":1,
   "data":[  
      {  
         "id":"3",
         "experiment_name":"iris_rbf_svm",
         "command":"run",
         "status":"COMPLETED",
         "is_alive":false,
         "start_time":"15:05:36 17.3.2017",
         "heartbeat":"15:05:36 17.3.2017",
         "heartbeat_diff":6535396.954588,
         "hostname":"vmmint18",
         "result":0.95,
         "object":{  
            "host":{  
               "python_version":"3.5.2",
               "cpu":"Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz",
               "os":[  
                  "Linux",
                  "Linux-4.4.0-64-generic-x86_64-with-LinuxMint-18.1-serena"
               ],
               "hostname":"vmmint18"
            },
            "info":{  

            },
            "result":0.95,
            "format":"MongoObserver-0.7.0",
            "status":"COMPLETED",
            "heartbeat":{  
               "$date":1489763136431
            },
            "config":{  
               "array":[  
                  "One",
                  "Two"
               ],
               "C":1.0,
               "seed":562201636,
               "gamma":0.7
            },
            "stop_time":{  
               "$date":1489763136430
            },
            "captured_out":"INFO - iris_rbf_svm - Running command 'run'\nINFO - iris_rbf_svm - Started run with ID \"3\"\nINFO - iris_rbf_svm - Result: 0.95\nINFO - iris_rbf_svm - Completed after 0:00:00\n",
            "start_time":{  
               "$date":1489763136401
            },
            "experiment":{  
               "dependencies":[  
                  "numpy==1.12.0",
                  "sacred==0.7b2",
                  "sklearn==0.18.1"
               ],
               "base_dir":"/media/sf_Martin/Documents/archiv/archiv/\u0161kola/\u010cVUT/Magistr/Diplomka/sandbox",
               "name":"iris_rbf_svm",
               "sources":[  
                  [  
                     "iris.py",
                     {  
                        "$oid":"58cbfb407ef9e60d73d66868"
                     }
                  ]
               ],
               "repositories":[  

               ]
            },
            "resources":[  

            ],
            "_id":3,
            "meta":{  
               "options":{  
                  "--print_config":false,
                  "COMMAND":null,
                  "--comment":null,
                  "--loglevel":null,
                  "--beat_interval":null,
                  "--priority":null,
                  "--tiny_db":null,
                  "--queue":false,
                  "UPDATE":[  

                  ],
                  "--file_storage":null,
                  "--unobserved":false,
                  "with":false,
                  "help":false,
                  "--mongo_db":"sacred07",
                  "--sql":null,
                  "--pdb":false,
                  "--help":false,
                  "--debug":false,
                  "--enforce_clean":false,
                  "--force":false
               },
               "command":"run"
            },
            "artifacts":[  

            ],
            "command":"run"
         }
      }
   ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant