Skip to content

Commit

Permalink
Adding additional logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cssherman committed Jan 29, 2024
1 parent 5b899b7 commit 66dfd30
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions geos_ats_package/geos_ats/command_line_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def build_command_line_parser():

parser.add_argument("-l", "--logs", type=str, default=None)

parser.add_argument("-f", "--allow-failed-tests", default=False, action='store_true')

parser.add_argument(
"--failIfTestsFail",
action="store_true",
Expand Down
7 changes: 6 additions & 1 deletion geos_ats_package/geos_ats/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import subprocess
import time
import logging
from geos_ats import command_line_parsers
from geos_ats import command_line_parsers, test_builder

test_actions = ("run", "rerun", "check", "continue")
report_actions = ("run", "rerun", "report", "continue")
Expand Down Expand Up @@ -369,6 +369,11 @@ def main():
# Run ATS
# ---------------------------------
result = ats.manager.core()
if len(test_builder.test_build_failures):
tmp = ', '.join(test_builder.test_build_failures)
logger.error(f'The following ATS test failed to build: {tmp}')
if not options.allow_failed_tests:
raise Exception('Some tests failed to build')

# Make sure all the testcases requested were found
if testcases != "all":
Expand Down
19 changes: 17 additions & 2 deletions geos_ats_package/geos_ats/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
from dataclasses import dataclass, asdict
from ats.tests import AtsTest
from lxml import etree
import logging
from .test_steps import geos
from .test_case import TestCase

test_build_failures = []
logger = logging.getLogger('geos_ats')


@dataclass(frozen=True)
class RestartcheckParameters:
Expand Down Expand Up @@ -79,7 +83,7 @@ def collect_block_names(fname):
return results


def generate_geos_tests(decks: Iterable[TestDeck]):
def generate_geos_tests(decks: Iterable[TestDeck], test_type='smoke'):
"""
"""
for ii, deck in enumerate(decks):
Expand All @@ -99,7 +103,18 @@ def generate_geos_tests(decks: Iterable[TestDeck]):

testcase_name = "{}_{:02d}".format(deck.name, N)
base_name = "0to{:d}".format(deck.check_step)
xml_file = "{}.xml".format(deck.name)

# Search for the target xml file
xml_file = ''
for suffix in ['', f'_{test_type}']:
if os.path.isfile("{}{}.xml".format(deck.name, suffix)):
xml_file = "{}{}.xml".format(deck.name, suffix)

if not xml_file:
logger.error(f'Could not find a matching xml file for the test: {deck.name}')
test_build_failures.append(deck.name)
continue

xml_blocks = collect_block_names(xml_file)

checks = []
Expand Down

0 comments on commit 66dfd30

Please sign in to comment.