You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the tests to support the new method for getting the UUID list
As a performance improvement, in 7fac452 we
switched to reading the uuids from the UUID database instead of looking at the
unique entries in the timeseries.
This resulted in an order of magnitude improvement
```
%timeit edb.get_uuid_db().distinct("uuid")
1.29 ms ± 12 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
```
```
%timeit edb.get_timeseries_db().distinct("user_id")
3.68 s ± 105 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
But it required that all users have an entry in the UUID DB to show up in the
`get_all_uuids()` call.
So we change this test to ensure that:
- change the existing test loading code to also register users if a
`registerEmail` is filled in; this required some refactoring
- for this test, pass in a registerEmail in the test object
Testing done:
```
$ ./e-mission-py.bash emission/tests/storageTests/TestTimeSeries.py TestTimeSeries.testGetUUIDList
storage not configured, falling back to sample, default configuration
Connecting to database URL localhost:27017
2021-08-10 12:38:33,424:INFO:4669529536:Before loading from emission/tests/data/real_examples/shankari_2015-aug-21, timeseries db size = 4527962
2021-08-10 12:38:33,471:INFO:4669529536:registering email = user1
Setting up real example for 4405c6ce-f8c8-4e37-b5b7-c69c0072135e
2021-08-10 12:38:37,001:INFO:4669529536:After loading, timeseries db size = 4530087
2021-08-10 12:38:37,019:DEBUG:4669529536:First few entries = ['2015-08-21T07:55:13.408000-07:00', '2015-08-21T07:55:13.408000-07:00', '2015-08-21T07:55:01.638000-07:00', '2015-08-21T07:55:07.414000-07:00', '2015-08-21T07:55:01.638000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:52.153000-07:00', '2015-08-21T07:55:07.414000-07:00']
2021-08-10 12:38:37,030:INFO:4669529536:Before loading from emission/tests/data/real_examples/shankari_2015-aug-27, timeseries db size = 4530087
2021-08-10 12:38:37,063:INFO:4669529536:registering email = user1
Setting up real example for 4405c6ce-f8c8-4e37-b5b7-c69c0072135e
2021-08-10 12:38:39,418:INFO:4669529536:After loading, timeseries db size = 4531569
2021-08-10 12:38:39,433:DEBUG:4669529536:First few entries = ['2015-08-21T07:55:13.408000-07:00', '2015-08-21T07:55:13.408000-07:00', '2015-08-21T07:55:01.638000-07:00', '2015-08-21T07:55:07.414000-07:00', '2015-08-21T07:55:01.638000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:51.095000-07:00', '2015-08-21T07:54:52.153000-07:00', '2015-08-21T07:55:07.414000-07:00']
.
----------------------------------------------------------------------
Ran 1 test in 6.193s
OK
```
0 commit comments