From c3fc3cf4c6a07b8e658de2c50e9009b0b3fee0c6 Mon Sep 17 00:00:00 2001 From: Katie Worton Date: Tue, 28 Nov 2023 13:57:47 +0000 Subject: [PATCH] fetch-and-launch-reproducer,validate-inputs: add wrappers retriggering Add wrapper for retriggering builds and tests. Add script to validate inputs. --- fetch-and-launch-reproducer.sh | 11 +++++++++ validate-inputs.py | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 fetch-and-launch-reproducer.sh create mode 100644 validate-inputs.py diff --git a/fetch-and-launch-reproducer.sh b/fetch-and-launch-reproducer.sh new file mode 100644 index 0000000..8a5e0a0 --- /dev/null +++ b/fetch-and-launch-reproducer.sh @@ -0,0 +1,11 @@ +# Environment variables needed: +# - TUXSUITE_TOKEN - the token to submit tuxsuite reproducer + +TESTRUN=$1 +REPRODUCER=$2 +pip install -r requirements.txt +inputs="--testrun $TESTRUN --filename $REPRODUCER" +echo $inputs +python validate-inputs.py $inputs +python squad-create-reproducer-from-testrun $inputs --plan +tuxsuite plan $REPRODUCER \ No newline at end of file diff --git a/validate-inputs.py b/validate-inputs.py new file mode 100644 index 0000000..861f1b3 --- /dev/null +++ b/validate-inputs.py @@ -0,0 +1,43 @@ +from argparse import ArgumentParser +import logging +from pathlib import Path + + +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + + +def parse_args(raw_args): + parser = ArgumentParser() + + parser.add_argument( + "--testrun", + required=True, + help="The ID of the TestRun.", + ) + + parser.add_argument( + "--filename", + required=True, + help="The reproducer file.", + ) + + parser.add_argument( + "--plan", + required=False, + action="store_true", + default=False, + help="Fetch a TuxPlan reproducer rather than a TuxTest of TuxBuild reproducer.", + ) + + return parser.parse_args(raw_args) + + +def run(raw_args=None): + args = parse_args(raw_args) + + return 0 + + +if __name__ == "__main__": + exit(run())