diff mbox

[i-g-t] scripts/run-test.sh: Piglit overwrite option.

Message ID 1458309731-3065-1-git-send-email-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi March 18, 2016, 2:02 p.m. UTC
The following piglit commit adds one option to overwrite files:

commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db
Author: Dylan Baker <baker.dylan.c@gmail.com>
Date:   Mon Feb 1 15:08:23 2016 -0800

    framework/programs/run.py: Add option for overwriting files

So our run-script.sh test that creates the directory before executing
the tests were failing with:

"Fatal Error: Cannot overwrite existing folder w/o the -o /--overwrite option being sent"

I believe it took a while to notice that because many of us never
upgrade the piglit. But also the risk with this patch is to have an environment
with the old piglit so the result will be:
piglit: error: unrecognized arguments: --overwrite

So, let's start the discussion and also provide the patch that allows
some people with new version to get it running.

Cc: Dylan Baker <baker.dylan.c@gmail.com>
Cc: Alexandra Yates <alexandra.yates@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 scripts/run-tests.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Marius Vlad March 21, 2016, 10:53 a.m. UTC | #1
Isn't this as https://patchwork.freedesktop.org/series/4177/?

On Fri, Mar 18, 2016 at 07:02:11AM -0700, Rodrigo Vivi wrote:
> The following piglit commit adds one option to overwrite files:
> 
> commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db
> Author: Dylan Baker <baker.dylan.c@gmail.com>
> Date:   Mon Feb 1 15:08:23 2016 -0800
> 
>     framework/programs/run.py: Add option for overwriting files
> 
> So our run-script.sh test that creates the directory before executing
> the tests were failing with:
> 
> "Fatal Error: Cannot overwrite existing folder w/o the -o /--overwrite option being sent"
> 
> I believe it took a while to notice that because many of us never
> upgrade the piglit. But also the risk with this patch is to have an environment
> with the old piglit so the result will be:
> piglit: error: unrecognized arguments: --overwrite

Maybe we can test against piglit version and use it accordingly.

> 
> So, let's start the discussion and also provide the patch that allows
> some people with new version to get it running.
> 
> Cc: Dylan Baker <baker.dylan.c@gmail.com>
> Cc: Alexandra Yates <alexandra.yates@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  scripts/run-tests.sh | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
> index 99e6124..b1abeab 100755
> --- a/scripts/run-tests.sh
> +++ b/scripts/run-tests.sh
> @@ -124,8 +124,7 @@ fi
>  if [ "x$RESUME" != "x" ]; then
>  	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS" $NORETRY
>  else
> -	mkdir -p "$RESULTS"
> -	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
> +	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run --overwrite igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
>  fi
>  
>  if [ "$SUMMARY" == "html" ]; then
> -- 
> 2.4.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Feceoru, Gabriel March 21, 2016, 11:27 a.m. UTC | #2
On 18.03.2016 16:02, Rodrigo Vivi wrote:
> The following piglit commit adds one option to overwrite files:
>
> commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db
> Author: Dylan Baker <baker.dylan.c@gmail.com>
> Date:   Mon Feb 1 15:08:23 2016 -0800
>
>      framework/programs/run.py: Add option for overwriting files
>
> So our run-script.sh test that creates the directory before executing
> the tests were failing with:
>
> "Fatal Error: Cannot overwrite existing folder w/o the -o /--overwrite option being sent"
>
> I believe it took a while to notice that because many of us never
> upgrade the piglit. But also the risk with this patch is to have an environment
> with the old piglit so the result will be:
> piglit: error: unrecognized arguments: --overwrite
>
> So, let's start the discussion and also provide the patch that allows
> some people with new version to get it running.
>
> Cc: Dylan Baker <baker.dylan.c@gmail.com>
> Cc: Alexandra Yates <alexandra.yates@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>   scripts/run-tests.sh | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
> index 99e6124..b1abeab 100755
> --- a/scripts/run-tests.sh
> +++ b/scripts/run-tests.sh
> @@ -124,8 +124,7 @@ fi
>   if [ "x$RESUME" != "x" ]; then
>   	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS" $NORETRY
>   else
> -	mkdir -p "$RESULTS"
> -	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
> +	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run --overwrite igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
>   fi
>
>   if [ "$SUMMARY" == "html" ]; then
>

I've sent something similar some time ago:

https://patchwork.freedesktop.org/patch/76050/

Gabriel.
Rodrigo Vivi March 22, 2016, 2 a.m. UTC | #3
On Mon, 2016-03-21 at 12:53 +0200, Marius Vlad wrote:
> Isn't this as https://patchwork.freedesktop.org/series/4177/?

> 

> On Fri, Mar 18, 2016 at 07:02:11AM -0700, Rodrigo Vivi wrote:

> > The following piglit commit adds one option to overwrite files:

> > 

> > commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db

> > Author: Dylan Baker <baker.dylan.c@gmail.com>

> > Date:   Mon Feb 1 15:08:23 2016 -0800

> > 

> >     framework/programs/run.py: Add option for overwriting files

> > 

> > So our run-script.sh test that creates the directory before

> > executing

> > the tests were failing with:

> > 

> > "Fatal Error: Cannot overwrite existing folder w/o the -o /-

> > -overwrite option being sent"

> > 

> > I believe it took a while to notice that because many of us never

> > upgrade the piglit. But also the risk with this patch is to have an

> > environment

> > with the old piglit so the result will be:

> > piglit: error: unrecognized arguments: --overwrite

> 

> Maybe we can test against piglit version and use it accordingly.


Yeah, I wondered that... but apparently piglit doesn't return the
version...
The ugly way that came to my mind was something like:

$PIGLIT run --help | grep overwrite > /dev/null
if [ $? -eq 0 ]; then
 # use overwwrite
else
 # keep the old
fi

any non-ugly idea?

> 

> > 

> > So, let's start the discussion and also provide the patch that

> > allows

> > some people with new version to get it running.

> > 

> > Cc: Dylan Baker <baker.dylan.c@gmail.com>

> > Cc: Alexandra Yates <alexandra.yates@intel.com>

> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > ---

> >  scripts/run-tests.sh | 3 +--

> >  1 file changed, 1 insertion(+), 2 deletions(-)

> > 

> > diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh

> > index 99e6124..b1abeab 100755

> > --- a/scripts/run-tests.sh

> > +++ b/scripts/run-tests.sh

> > @@ -124,8 +124,7 @@ fi

> >  if [ "x$RESUME" != "x" ]; then

> >  	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume

> > "$RESULTS" $NORETRY

> >  else

> > -	mkdir -p "$RESULTS"

> > -	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt

> > "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER

> > +	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run -

> > -overwrite igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER

> >  fi

> >  

> >  if [ "$SUMMARY" == "html" ]; then
Rodrigo Vivi March 22, 2016, 2:05 a.m. UTC | #4
ops, I have missed that. I'm really sorry Gabriel for duplicating that
effort.

After we figure out what to do with different piglit versions we can
take yours... 

Sorry,
Rodrigo.

On Mon, 2016-03-21 at 13:27 +0200, Gabriel Feceoru wrote:
> 

> On 18.03.2016 16:02, Rodrigo Vivi wrote:

> > The following piglit commit adds one option to overwrite files:

> > 

> > commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db

> > Author: Dylan Baker <baker.dylan.c@gmail.com>

> > Date:   Mon Feb 1 15:08:23 2016 -0800

> > 

> >      framework/programs/run.py: Add option for overwriting files

> > 

> > So our run-script.sh test that creates the directory before

> > executing

> > the tests were failing with:

> > 

> > "Fatal Error: Cannot overwrite existing folder w/o the -o /-

> > -overwrite option being sent"

> > 

> > I believe it took a while to notice that because many of us never

> > upgrade the piglit. But also the risk with this patch is to have an

> > environment

> > with the old piglit so the result will be:

> > piglit: error: unrecognized arguments: --overwrite

> > 

> > So, let's start the discussion and also provide the patch that

> > allows

> > some people with new version to get it running.

> > 

> > Cc: Dylan Baker <baker.dylan.c@gmail.com>

> > Cc: Alexandra Yates <alexandra.yates@intel.com>

> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > ---

> >   scripts/run-tests.sh | 3 +--

> >   1 file changed, 1 insertion(+), 2 deletions(-)

> > 

> > diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh

> > index 99e6124..b1abeab 100755

> > --- a/scripts/run-tests.sh

> > +++ b/scripts/run-tests.sh

> > @@ -124,8 +124,7 @@ fi

> >   if [ "x$RESUME" != "x" ]; then

> >   	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume

> > "$RESULTS" $NORETRY

> >   else

> > -	mkdir -p "$RESULTS"

> > -	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt

> > "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER

> > +	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run -

> > -overwrite igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER

> >   fi

> > 

> >   if [ "$SUMMARY" == "html" ]; then

> > 

> 

> I've sent something similar some time ago:

> 

> https://patchwork.freedesktop.org/patch/76050/

> 

> Gabriel.

>
Dylan Baker March 22, 2016, 4:34 p.m. UTC | #5
Quoting Vivi, Rodrigo (2016-03-21 19:00:10)
> On Mon, 2016-03-21 at 12:53 +0200, Marius Vlad wrote:
> > Isn't this as https://patchwork.freedesktop.org/series/4177/?
> > 
> > On Fri, Mar 18, 2016 at 07:02:11AM -0700, Rodrigo Vivi wrote:
> > > The following piglit commit adds one option to overwrite files:
> > > 
> > > commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db
> > > Author: Dylan Baker <baker.dylan.c@gmail.com>
> > > Date:   Mon Feb 1 15:08:23 2016 -0800
> > > 
> > >     framework/programs/run.py: Add option for overwriting files
> > > 
> > > So our run-script.sh test that creates the directory before
> > > executing
> > > the tests were failing with:
> > > 
> > > "Fatal Error: Cannot overwrite existing folder w/o the -o /-
> > > -overwrite option being sent"
> > > 
> > > I believe it took a while to notice that because many of us never
> > > upgrade the piglit. But also the risk with this patch is to have an
> > > environment
> > > with the old piglit so the result will be:
> > > piglit: error: unrecognized arguments: --overwrite
> > 
> > Maybe we can test against piglit version and use it accordingly.
> 
> Yeah, I wondered that... but apparently piglit doesn't return the
> version...
> The ugly way that came to my mind was something like:
> 
> $PIGLIT run --help | grep overwrite > /dev/null
> if [ $? -eq 0 ]; then
>  # use overwwrite
> else
>  # keep the old
> fi
> 
> any non-ugly idea?
> 

I was just thinking that it was stupid that piglit doesn't have a
version of any kind. I'm planning to add one although it will only be a
git sha and maybe a date since piglit intentionally doesn't have major
or minor version numbers.

Dylan
Rodrigo Vivi March 24, 2016, 1:52 a.m. UTC | #6
On Tue, 2016-03-22 at 09:34 -0700, Dylan Baker wrote:
> Quoting Vivi, Rodrigo (2016-03-21 19:00:10)

> > On Mon, 2016-03-21 at 12:53 +0200, Marius Vlad wrote:

> > > Isn't this as https://patchwork.freedesktop.org/series/4177/?

> > > 

> > > On Fri, Mar 18, 2016 at 07:02:11AM -0700, Rodrigo Vivi wrote:

> > > > The following piglit commit adds one option to overwrite files:

> > > > 

> > > > commit ec317ece07afdf9c8a26de04bdec8a94e5d7b2db

> > > > Author: Dylan Baker <baker.dylan.c@gmail.com>

> > > > Date:   Mon Feb 1 15:08:23 2016 -0800

> > > > 

> > > >     framework/programs/run.py: Add option for overwriting files

> > > > 

> > > > So our run-script.sh test that creates the directory before

> > > > executing

> > > > the tests were failing with:

> > > > 

> > > > "Fatal Error: Cannot overwrite existing folder w/o the -o /-

> > > > -overwrite option being sent"

> > > > 

> > > > I believe it took a while to notice that because many of us

> > > > never

> > > > upgrade the piglit. But also the risk with this patch is to

> > > > have an

> > > > environment

> > > > with the old piglit so the result will be:

> > > > piglit: error: unrecognized arguments: --overwrite

> > > 

> > > Maybe we can test against piglit version and use it accordingly.

> > 

> > Yeah, I wondered that... but apparently piglit doesn't return the

> > version...

> > The ugly way that came to my mind was something like:

> > 

> > $PIGLIT run --help | grep overwrite > /dev/null

> > if [ $? -eq 0 ]; then

> >  # use overwwrite

> > else

> >  # keep the old

> > fi

> > 

> > any non-ugly idea?

> > 

> 

> I was just thinking that it was stupid that piglit doesn't have a

> version of any kind. I'm planning to add one although it will only be

> a

> git sha and maybe a date since piglit intentionally doesn't have

> major

> or minor version numbers.


Thanks Dylan.... But how will you handle the piglig installed in
/usr/local/bin? Maybe we can have one version in our piglit dir inside
igt but another version in the system what could be different and
misslead this check.


> 

> Dylan
Dylan Baker March 24, 2016, 3:17 p.m. UTC | #7
Quoting Vivi, Rodrigo (2016-03-23 18:52:38)
> 
> Thanks Dylan.... But how will you handle the piglig installed in
> /usr/local/bin? Maybe we can have one version in our piglit dir inside
> igt but another version in the system what could be different and
> misslead this check.
> 

I have this: https://patchwork.freedesktop.org/patch/77901/, the only
problem I see with it is that my cmake isn't correct, and the file wont
be regenerated if the git commit changes.

The basic idea is that if piglit is installed a version.py is generated
and when it's not git is directly called to get the sha and date. Does
this meet your requirements?

Dylan
diff mbox

Patch

diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 99e6124..b1abeab 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -124,8 +124,7 @@  fi
 if [ "x$RESUME" != "x" ]; then
 	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS" $NORETRY
 else
-	mkdir -p "$RESULTS"
-	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
+	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run --overwrite igt "$RESULTS" -s $VERBOSE $EXCLUDE $FILTER
 fi
 
 if [ "$SUMMARY" == "html" ]; then