Skip to content

Commit b7e8556

Browse files
committed
clean up tests
1 parent dc0a766 commit b7e8556

13 files changed

+14
-722
lines changed
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,17 @@ To run all tests you can simply run `bash test_00_main.sh`. There are still some
2424
* get firebase projects, groups and results before mapping and save to disk
2525
* for each user and project set random results for X groups in firebase through REST api, authenticated as normal user
2626
* get firebase projects, groups and results after mapping and save to disk
27-
28-
**TODO**:
29-
* compare firebase before and after data, there are already some functions in `test_mock_results.py`
27+
* compare firebase before and after data
3028

3129
## Test Firebase to Postgres
3230
* `test_03_firebase_to_postgres.py`
3331
* copy new users from firebase to postgres
3432
* copy all results from firebase to postgres
3533

36-
**TODO**:
37-
* how can we make sure that we only update users created during testing?
38-
* how can we make sure that we only transfer results for projects created during testing
39-
4034
## Generate Stats
4135
* `test_04_generate_stats.py`
4236
* generate csv files for all projects and users for which we got results since a timestamp defined in `last_update.txt`
4337

44-
**TODO**:
45-
* check logic: what happens if `last_update.txt` is not there, but `--only_new_results` flag is set? --> stats for all projects and users should be created
46-
* how can we make sure that we only generate stats for projects and users created during testing
47-
4838
## Other
4939
* we don't have broader checks of firebase database rules
5040
* some database rules are checked indirectly, e.g. firebase read, write rules through REST api get, set requests during `test_02_mapping.py`

mapswipe_workers/tests/delete_old_firebase_stuff.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

mapswipe_workers/tests/test_05_clean_up.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def delete_local_files(project_id):
7878
fn = f'{DATA_PATH}/input_geometries/valid_input_{project_id}.geojson'
7979
if os.path.isfile(fn):
8080
os.remove(fn)
81+
8182
print(
8283
f'Local files: '
8384
f'deleted raw_input and valid_input files'
@@ -135,4 +136,16 @@ def delete_sample_users_from_postgres(pg_db, users):
135136
else:
136137
print('No users.pickle file found')
137138

139+
filename = 'firebase_data_after.pickle'
140+
if os.path.isfile(filename):
141+
os.remove(filename)
142+
else:
143+
print(f'No {filename} file found')
144+
145+
filename = 'firebase_data_before.pickle'
146+
if os.path.isfile(filename):
147+
os.remove(filename)
148+
else:
149+
print(f'No {filename} file found')
150+
138151
print('Deleted all sample data in Firebase, Postgres and on disk')

mapswipe_workers/tests/test_create_projects.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

mapswipe_workers/tests/test_create_projects_locally.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

mapswipe_workers/tests/test_generate_stats.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

mapswipe_workers/tests/test_initialize.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

mapswipe_workers/tests/test_main.sh

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)