-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64e38b5
commit c3b4631
Showing
4 changed files
with
30 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
import os | ||
from typing import List | ||
|
||
from sclients import SUPPORTED_CLIENTS | ||
|
||
from lib.beacon_state import BeaconState | ||
from lib.runner import run_module, file_to_module, return_code_to_status | ||
from lib.test_groups import get_test_groups, TestGroup | ||
|
||
LOGGING_TESTS_DIR = 'logging_tests' | ||
|
||
LOGGING_TEST_FILE_TO_CONFIGS = { | ||
'logging_tests/test_success.py': [BeaconState.DEFAULT], | ||
'logging_tests/test_fail.py': [BeaconState.DEFAULT], | ||
} | ||
|
||
|
||
def get_logging_test_groups() -> List[TestGroup]: | ||
return get_test_groups(LOGGING_TEST_FILE_TO_CONFIGS, SUPPORTED_CLIENTS, None) | ||
|
||
|
||
def all_logging_test_files(): | ||
tests = [] | ||
for root, dirs, files in os.walk(LOGGING_TESTS_DIR): | ||
tests.extend([f'{root}/{f}' for f in files if f.endswith('.py')]) | ||
|
||
return tests | ||
|
||
|
||
def run_logging_tests(client): | ||
print(client) | ||
|
||
failures = {} | ||
for file in all_logging_test_files(): | ||
module = file_to_module(file) | ||
(return_code, logs) = run_module(module, {}) | ||
|
||
print(f'\t{module} {return_code_to_status(return_code)}') | ||
if return_code != 0: | ||
failures[module] = (return_code, logs) | ||
|
||
if len(failures) > 0: | ||
for module, (return_code, logs) in failures.items(): | ||
print('') | ||
print(f'\t{module} {return_code_to_status(return_code)}') | ||
|
||
for log in logs: | ||
print(f'\t{log}') | ||
|
||
return 1 | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters