public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: "Ser, Simon" <simon.ser@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] runner/job_list: print error when job list is empty
Date: Mon, 25 Mar 2019 15:59:29 +0200	[thread overview]
Message-ID: <20190325135929.GY4038@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <64620257f9426e0536fc5b63924065d87c07c210.camel@intel.com>

On Mon, Mar 25, 2019 at 03:51:50PM +0200, Ser, Simon wrote:
> On Mon, 2019-03-25 at 13:19 +0200, Petri Latvala wrote:
> > On Thu, Mar 21, 2019 at 02:44:49PM +0200, Simon Ser wrote:
> > > Using a filter that doesn't match any test name resulted in the
> > > runner
> > > silently failing. Print an error message so that the user
> > > understands
> > > why the runner fails.
> > > 
> > > Signed-off-by: Simon Ser <simon.ser@intel.com>
> > > ---
> > >  runner/job_list.c | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/runner/job_list.c b/runner/job_list.c
> > > index 97bbb0be..f5c16af3 100644
> > > --- a/runner/job_list.c
> > > +++ b/runner/job_list.c
> > > @@ -133,6 +133,7 @@ static bool filtered_job_list(struct job_list
> > > *job_list,
> > >  {
> > >  	FILE *f;
> > >  	char buf[128];
> > > +	bool ok;
> > >  
> > >  	if (job_list->entries != NULL) {
> > >  		fprintf(stderr, "Caller didn't clear the job list, this
> > > shouldn't happen\n");
> > > @@ -179,7 +180,11 @@ static bool filtered_job_list(struct job_list
> > > *job_list,
> > >  			     &settings->exclude_regexes);
> > >  	}
> > >  
> > > -	return job_list->size != 0;
> > > +	ok = job_list->size != 0;
> > > +	if (!ok) {
> > > +		fprintf(stderr, "Filter didn't match any job name\n");
> > > +	}
> > > +	return ok;
> > >  }
> > >  
> > 
> > A unit test for this would be lovely (runner/runner_tests.c).
> 
> Do you mean adding a test that checks that an error message is printed?
> Or do you mean adding a test that checks that filtered_job_list fails
> when no test is matched?


Oh wait I misunderstood the patch completely! I thought you changed it
to fail when nothing matched! Disregard that comment.

An actual comment: We use the kernel coding style, so one-liner if
blocks should omit the braces. (Probably still a ton of violations of
this in runner/*...)

With that,

Reviewed-by: Petri Latvala <petri.latvala@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-25 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 12:44 [igt-dev] [PATCH i-g-t] runner/job_list: print error when job list is empty Simon Ser
2019-03-21 13:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-22  2:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-25 11:19 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2019-03-25 13:51   ` Ser, Simon
2019-03-25 13:59     ` Petri Latvala [this message]
2019-04-15 14:29       ` Ser, Simon
2019-04-16  9:56         ` Petri Latvala

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=20190325135929.GY4038@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=simon.ser@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox