All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Tim.Bird@sony.com>
To: daniel.sangorrin@toshiba.co.jp, fuego@lists.linuxfoundation.org
Subject: Re: [Fuego] [PATCH 2/3] OF: create a spec.json on each run
Date: Fri, 7 Sep 2018 18:31:43 +0000	[thread overview]
Message-ID: <ECADFF3FD767C149AD96A924E7EA6EAF7C1D7E23@USCULXMSG01.am.sony.com> (raw)
In-Reply-To: <1536055292-34772-3-git-send-email-daniel.sangorrin@toshiba.co.jp>

> -----Original Message-----
> From: Daniel Sangorrin
> 
> This patch outputs the spec used in a run into a spec.json
> file at the run's log folder. Although prolog.sh already
> contains the variables from the spec, it is useful to have
> a spec.json file that we can share. Also, this spec.json
> file could be created by other means such as dynamic
> variables instead of coming from a semi-permanent source.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> ---
>  engine/scripts/ovgen.py | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/engine/scripts/ovgen.py b/engine/scripts/ovgen.py
> index 7c1f05f..ef09e85 100755
> --- a/engine/scripts/ovgen.py
> +++ b/engine/scripts/ovgen.py
> @@ -397,7 +397,7 @@ def generateProlog(logdir, ofcls, classes, testdir,
> testspec):
> 
>          file.write(outfile, "\n")
> 
> -    ts = parseSpec(testdir, testspec)
> +    ts = parseSpec(logdir, testdir, testspec)
>      generateSpec(ts, outfile)
> 
>  # generateSpec - generate shell output for the spec
> @@ -431,9 +431,24 @@ def generateSpec(ts, fout):
>              fout.write(outPattern + "\n")
>              fout.write(outMessage + "\n")
> 
> -def parseSpec(testdir, testspec):
> +def parseSpec(logdir, testdir, testspec):
>      # FIXTHIS: get fuego-core from env
> -    specpath = '/fuego-core/engine/tests/%s/spec.json' % (testdir)
> +    specpath = logdir + '/spec.json'
> +    if not os.path.exists(specpath):
> +        # create a spec.json by stripping the test's spec.json
> +        test_specpath = '/fuego-core/engine/tests/%s/spec.json' % (testdir)
> +        with open(test_specpath) as f:
> +            try:
> +                test_spec_data = json.load(f)
> +            except:
> +                error_out("Error parsing spec file %s" % specpath)
> +        for key in test_spec_data['specs'].keys():
> +            if key != testspec:
> +                del test_spec_data['specs'][key]
> +        print "test spec data" + str(test_spec_data)

I'm changing this to a debug_print()

> +        with open(specpath, 'w+') as spec_file:
> +            json.dump(test_spec_data, spec_file)
> +
>      ts = TestSpecs()
> 
>      debug_print("Parsing %s spec file" % (specpath))
> --
> 2.7.4

OK - looks good.  Applied (and adjusted).
 -- Tim


  reply	other threads:[~2018-09-07 18:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 10:01 [Fuego] Dynamic variables Daniel Sangorrin
2018-09-04 10:01 ` [Fuego] [PATCH 1/3] of: use logdir argument instead of prolog.sh Daniel Sangorrin
2018-09-07 18:25   ` Tim.Bird
2018-09-04 10:01 ` [Fuego] [PATCH 2/3] OF: create a spec.json on each run Daniel Sangorrin
2018-09-07 18:31   ` Tim.Bird [this message]
2018-09-04 10:01 ` [Fuego] [PATCH 3/3] ftc: add dynamic-vars to ftc run-test Daniel Sangorrin
2018-09-07 18:55   ` Tim.Bird
2018-10-05  1:43     ` Daniel Sangorrin
2018-10-06  1:18       ` Tim.Bird

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ECADFF3FD767C149AD96A924E7EA6EAF7C1D7E23@USCULXMSG01.am.sony.com \
    --to=tim.bird@sony.com \
    --cc=daniel.sangorrin@toshiba.co.jp \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.