Skip to content

Commit

Permalink
Implement Automatic Removal for Tests from Dashboard and MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
RashulChutani committed Jan 11, 2023
1 parent 681c11e commit 1191e11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions determine_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def determine_tests_line(_tests_file, _line, _tests_to_run):
# Check for any new tests present
old_tests = tests["index_mapping"]
added_tests = set(new_tests) - set(old_tests)
removed_tests = set(old_tests) - set(new_tests)
with open("tests_to_remove", "w") as f:
for test in removed_tests:
f.write(test + "\n")
added_tests = list(added_tests)
if len(added_tests) > 10:
added_tests = added_tests[:10]
Expand Down
18 changes: 10 additions & 8 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ def remove_from_db(collection, id, submod, backend, test):
db[coll[0]], coll[1], submod, backend, test_fn, res
)

"""
with open("tests_to_remove", "r") as f:
for line in f:
test, backend = line.split(",")
coll, submod, test_fn = get_submodule(test)
print(coll, submod, test_fn)
remove_from_db(db[coll[0]], coll[1], submod, backend, test_fn)
"""
try:
with open("tests_to_remove", "r") as f:
for line in f:
test, backend = line.split(",")
coll, submod, test_fn = get_submodule(test)
print(coll, submod, test_fn)
remove_from_db(db[coll[0]], coll[1], submod, backend, test_fn)
except:
pass

if failed:
exit(1)

0 comments on commit 1191e11

Please sign in to comment.