From ecd7ce3b76a5890a79396c765e4753fa35f9c169 Mon Sep 17 00:00:00 2001 From: Sean McGrail Date: Tue, 24 Dec 2024 17:43:01 +0000 Subject: [PATCH] Feedback --- tests/ci/run_x509_limbo.sh | 2 +- tests/ci/x509/limbo-report/annotate.go | 19 +++++++++---------- tests/ci/x509/x509-limbo.patch | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/ci/run_x509_limbo.sh b/tests/ci/run_x509_limbo.sh index eca06b6ece..02e5c36e68 100755 --- a/tests/ci/run_x509_limbo.sh +++ b/tests/ci/run_x509_limbo.sh @@ -10,7 +10,7 @@ source tests/ci/common_posix_setup.sh # Subsequent follow-up PRs will wire this up into a new CodeBuild project and handle producing and tracking # the reports. -SCRATCH_DIR="${SRC_ROOT}/scratch" +SCRATCH_DIR="${SYS_ROOT}/scratch" X509_CI_DIR="${SRC_ROOT}/tests/ci/x509" X509_LIMBO_SRC="${SCRATCH_DIR}/x509-limbo" diff --git a/tests/ci/x509/limbo-report/annotate.go b/tests/ci/x509/limbo-report/annotate.go index 691be8b48c..e8ee0ca8f1 100644 --- a/tests/ci/x509/limbo-report/annotate.go +++ b/tests/ci/x509/limbo-report/annotate.go @@ -14,7 +14,7 @@ import ( "sort" ) -var annotateHelpDoc string = `report annotate [-csv] -limbo +var annotateHelpDoc string = `report annotate [-csv] Annotates a standard x509-limbo results file with information from the provided test descriptors. By default this will write the result back to the process standard output. @@ -24,13 +24,11 @@ Options: ` var annotateCommand struct { - limboFilePath string - formatAsCsv bool + formatAsCsv bool } var annotateFlagSet = func() *flag.FlagSet { fs := flag.NewFlagSet("annotate", flag.ExitOnError) - fs.StringVar(&annotateCommand.limboFilePath, "limbo", "limbo.json", "location of the limbo test cases") fs.BoolVar(&annotateCommand.formatAsCsv, "csv", false, "format output as csv rather then the default") fs.Usage = func() { fmt.Fprint(fs.Output(), annotateHelpDoc) @@ -43,16 +41,17 @@ func runAnnotateCommand(args []string) error { if err := annotateFlagSet.Parse(args); err != nil { return err } - limbo, err := parseLimboFile(annotateCommand.limboFilePath) - if err != nil { - return err + + if len(annotateFlagSet.Args()) != 2 { + return fmt.Errorf("expect two positional arguments") } - if len(annotateFlagSet.Args()) != 1 { - return fmt.Errorf("expect one positional argument for the result file name") + limbo, err := parseLimboFile(annotateFlagSet.Arg(0)) + if err != nil { + return err } - harnessFilePath := annotateFlagSet.Arg(0) + harnessFilePath := annotateFlagSet.Arg(1) harnessBytes, err := os.ReadFile(harnessFilePath) if err != nil { log.Fatalf("failed to read harnessFile(%v): %v", harnessFilePath, err) diff --git a/tests/ci/x509/x509-limbo.patch b/tests/ci/x509/x509-limbo.patch index 25517ea976..9ac10db6de 100644 --- a/tests/ci/x509/x509-limbo.patch +++ b/tests/ci/x509/x509-limbo.patch @@ -73,7 +73,7 @@ index 0000000..2305b42 + +.PHONY: verify-aws-lc-source +verify-aws-lc-source: -+ @if [[ -z "${AWS_LC_SRC_DIR}" ]]; then \ ++ @if [ test -z "${AWS_LC_SRC_DIR}" ]; then \ + echo "AWS_LC_SRC_DIR environment variable is missing and is required to specify AWS-LC source location" && false; \ + fi +