-
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.
Merge pull request #23 from lsankar4033/fix_logging_for_ci
Fix logging for ci
- Loading branch information
Showing
7 changed files
with
82 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: python | ||
|
||
python: | ||
- 3.8 | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- pip install -U pip | ||
|
||
script: | ||
- ./steth.py logging_test |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import os | ||
|
||
from lib.runner import run_module, file_to_module, return_code_to_status | ||
|
||
LOGGING_TESTS_DIR = 'logging_tests' | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
async def run(args): | ||
return (1, ['error 1', 'error 2']) |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
async def run(args): | ||
return (0, []) |
File renamed without changes.
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