Skip to content

Commit

Permalink
Add prefix path option for test config in reporter (#33)
Browse files Browse the repository at this point in the history
The current rel_offset only captures command-line input necessary for
tests to run correctly, but not the path to the test config.

Since the root directory always starts from the test config, then
applies the command-line directory offset if requested there is no
runtime metadata regularly available on where the test config may be
located within a project. Similar to the `--exec` relative location of
the `runner.py` we can provide the relative prefix of the test config
from the project root directory.
  • Loading branch information
islas authored Dec 13, 2024
2 parents dfc8e6d + bf25773 commit 043a4b6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .ci/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def getSummaryPrintedStr( masterDict, metadata ) :
if not testlog["success"] :
testCmd = cmdFormat.format(
runner=metadata["rel_exec"],
file=metadata["rel_file"],
file=metadata["rel_prefix"] + "/" + metadata["rel_file"],
test=test,
offset="" if metadata["rel_offset"] == "" else "-d " + metadata["rel_offset"]
)
Expand Down Expand Up @@ -103,6 +103,13 @@ def getOptionsParser():
type=str,
default="<location to hpc-workflows/.ci/runner.py>"
)
parser.add_argument(
"-p", "--prefix",
dest="prefix",
help="Prefix path to prepend to test config when outputting instructions on reproduction",
type=str,
default="<folder path to test config>"
)
parser.add_argument(
"-f", "--failedStepsOnly",
dest="failedStepsOnly",
Expand Down Expand Up @@ -150,7 +157,8 @@ def main() :
logs = json.load( fp )

metadata = logs.pop( "metadata", None )
metadata["rel_exec"] = options.exec
metadata["rel_exec"] = options.exec
metadata["rel_prefix"] = options.prefix
failure = False

startGroup = None
Expand Down

0 comments on commit 043a4b6

Please sign in to comment.