Skip to contentSkip to conversation

Making the test-suite easier to run

igt In review Damien Lespiau 3 participants 35 messages Nov 15, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The objective of this series is to make the test-suite easier to run by embedding a copy a piglit and providing porcelain on top of it in the form of a makefile target. Beside python, there's no external dependency to run the test suite after this series.

The provided makefile target runs the full test suite. I'm still interested in providing, as a follow-up of this work, shorcuts for subsets of the testsuite that can be useful for developpers, subset what we would maintain in tree. For instance:
- tests selected by topic: running gem_.* Vs kms_.* Vs pm_.* (or maybe when running, say, gt tests, exlude ^kms_.* ^pm_.* so we still still a lot of the other tests (core_, drm_, ...)
- quick subtests (where we disable long running stress, race, ... tests)

patches 21-23 are something a bit different, try to pave the way for quick runs (by really the first tiny step).

The README has been updated and I copy/paste it here the documentation for what would be the new way to run tests:

After having compiled the tests, one can run the test-suite with:

$ sudo make run-tests

"make run-tests" create a $date-piglit-results.$n directory with the results of the run. More specifically:
- $date-piglit-results.$n/main JSON file with the test results
- $date-piglit-results.$n/html/index.html HTML summary of the run

Where $date is the date formated with date +%Y%m%d and $n the nth run of the day.

PIGLIT_FLAGS can be used to give options to the underlying piglit runner. For instance, to exclude test matching '^kms_':

$ sudo make run-tests PIGLIT_FLAGS="-x ^kms_"

For the list of piglit options, run:

$ ./piglit/piglit-run.py -h

Another useful feature is to be able to resume an interrupted run. To do that, make run-tests needs to know which run we are talking about:

$ sudo make run-tests RESUME=$date-piglit-results.$n

or, more succinctly:

$ sudo make run-tests R=$date-piglit-results.$n

It's possible to combine PIGLIT_FLAGS and RESUME. This is useful to resume runs where a specific test deterministically hang the machine:

$ sudo make run-tests PIGLIT_FLAGS="-x drv_module_reload" R=$date-piglit-results.$n

HTH,

Signature · 1 line
Damien
#1 lore raw

PATCH 1/23 piglit: Add a script to synchronise the piglit test runner

The goal is to to remove the need to clone and compile piglit to run a piglit enabled igt. Compiling piglit is not actually needed and we can just grab the python files from a reference checktout.

---
 piglit/sync-from-piglit | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100755 piglit/sync-from-piglit
piglit/sync-from-piglit new file +24 -0
new file mode 100755
index 0000000..20a95ff
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+PIGLIT_DIR=$1
+BASE_DIR="$(cd "$(dirname "$0")"; pwd -P)"
+EXCLUDE_FILE="$BASE_DIR/sync-exclude"
+
+[ -z "$PIGLIT_DIR" ] && {
+	echo "Error: You must specify the piglit directory to sync from"
+	exit 1
+}
+
+cat <<EOF > $EXCLUDE_FILE
+tests
+*.pyc
+*_test.py
+EOF
+
+rsync -rtv --exclude-from $EXCLUDE_FILE	\
+	$PIGLIT_DIR/framework		\
+	$PIGLIT_DIR/templates		\
+	$PIGLIT_DIR/piglit-*.py		\
+	$BASE_DIR
+
+rm -f $EXCLUDE_FILE
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/23 piglit: Import piglit

In reply to Damien Lespiau

Let's embed a copy of the piglit test runner, so we don't this external dependency, removing an excuse to not run a complete series of tests

---
 .gitignore                         |   2 +
 piglit/framework/__init__.py       |  21 ++
 piglit/framework/core.py           | 696 +++++++++++++++++++++++++++++++++++++
 piglit/framework/exectest.py       | 304 ++++++++++++++++
 piglit/framework/gleantest.py      |  49 +++
 piglit/framework/junit.py          | 377 ++++++++++++++++++++
 piglit/framework/log.py            |  53 +++
 piglit/framework/patterns.py       |  90 +++++
 piglit/framework/status.py         | 226 ++++++++++++
 piglit/framework/summary.py        | 525 ++++++++++++++++++++++++++++
 piglit/framework/threadpool.py     |  67 ++++
 piglit/framework/threads.py        |  43 +++
 piglit/piglit-framework-tests.py   |  47 +++
 piglit/piglit-merge-results.py     |  53 +++
 piglit/piglit-print-commands.py    |  86 +++++
 piglit/piglit-run.py               | 184 ++++++++++
 piglit/piglit-summary-html.py      |  98 ++++++
 piglit/piglit-summary-junit.py     | 128 +++++++
 piglit/piglit-summary.py           |  80 +++++
 piglit/templates/empty_status.mako |  27 ++
 piglit/templates/index.css         |  78 +++++
 piglit/templates/index.mako        |  81 +++++
 piglit/templates/result.css        |  37 ++
 piglit/templates/test_result.mako  |  66 ++++
 piglit/templates/testrun_info.mako |  49 +++
 25 files changed, 3467 insertions(+)
 create mode 100644 piglit/framework/__init__.py
 create mode 100644 piglit/framework/core.py
 create mode 100644 piglit/framework/exectest.py
 create mode 100644 piglit/framework/gleantest.py
 create mode 100644 piglit/framework/junit.py
 create mode 100644 piglit/framework/log.py
 create mode 100644 piglit/framework/patterns.py
 create mode 100644 piglit/framework/status.py
 create mode 100644 piglit/framework/summary.py
 create mode 100644 piglit/framework/threadpool.py
 create mode 100644 piglit/framework/threads.py
 create mode 100755 piglit/piglit-framework-tests.py
 create mode 100755 piglit/piglit-merge-results.py
 create mode 100755 piglit/piglit-print-commands.py
 create mode 100755 piglit/piglit-run.py
 create mode 100755 piglit/piglit-summary-html.py
 create mode 100755 piglit/piglit-summary-junit.py
 create mode 100755 piglit/piglit-summary.py
 create mode 100644 piglit/templates/empty_status.mako
 create mode 100644 piglit/templates/index.css
 create mode 100644 piglit/templates/index.mako
 create mode 100644 piglit/templates/result.css
 create mode 100644 piglit/templates/test_result.mako
 create mode 100644 piglit/templates/testrun_info.mako
.gitignore +2 -0
index f5b326e..c9a5302 100644
@@ -78,6 +78,8 @@ core
 #
 *.swo
 *.swp
+*.pyc
+/.makotmp
 cscope.*
 TAGS
 build-aux/
piglit/framework/__init__.py new file +21 -0
new file mode 100644
index 0000000..3cf6d82
@@ -0,0 +1,21 @@
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# This permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHOR(S) BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
piglit/framework/core.py new file +696 -0

696 lines not on this page · raw message

piglit/framework/exectest.py new file +304 -0

304 lines not on this page · raw message

piglit/framework/gleantest.py new file +49 -0

49 lines not on this page · raw message

piglit/framework/junit.py new file +377 -0

377 lines not on this page · raw message

piglit/framework/log.py new file +53 -0

53 lines not on this page · raw message

piglit/framework/patterns.py new file +90 -0

90 lines not on this page · raw message

piglit/framework/status.py new file +226 -0

226 lines not on this page · raw message

piglit/framework/summary.py new file +525 -0

525 lines not on this page · raw message

piglit/framework/threadpool.py new file +67 -0

67 lines not on this page · raw message

piglit/framework/threads.py new file +43 -0

43 lines not on this page · raw message

piglit/piglit-framework-tests.py new file +47 -0

47 lines not on this page · raw message

piglit/piglit-merge-results.py new file +53 -0

53 lines not on this page · raw message

piglit/piglit-print-commands.py new file +86 -0

86 lines not on this page · raw message

piglit/piglit-run.py new file +184 -0

184 lines not on this page · raw message

piglit/piglit-summary-html.py new file +98 -0

98 lines not on this page · raw message

piglit/piglit-summary-junit.py new file +128 -0

73 lines not on this page · raw message

piglit/piglit-summary.py new file +80 -0

80 lines not on this page · raw message

piglit/templates/empty_status.mako new file +27 -0
new file mode 100644
index 0000000..8ee6fba

Lines of this file are not shown. View the raw message.

piglit/templates/index.css new file +78 -0

78 lines not on this page · raw message

piglit/templates/index.mako new file +81 -0

81 lines not on this page · raw message

piglit/templates/result.css new file +37 -0
new file mode 100644
index 0000000..19bfedc

Lines of this file are not shown. View the raw message.

piglit/templates/test_result.mako new file +66 -0

66 lines not on this page · raw message

piglit/templates/testrun_info.mako new file +49 -0

49 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/23 piglit: Import igt.tests from piglit

In reply to Damien Lespiau
---
 piglit/tests/igt.tests | 125 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 piglit/tests/igt.tests
piglit/tests/igt.tests new file +125 -0
new file mode 100644
index 0000000..f388492
@@ -0,0 +1,125 @@
+#
+# Copyright (c) 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# This permission notice shall be included in all copies or
+# substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHOR(S) BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+import os
+import re
+import sys
+import subprocess
+
+from os import path
+from framework.core import testBinDir, TestProfile
+from framework.exectest import ExecTest
+
+#############################################################################
+##### IGTTest: Execute an intel-gpu-tools test
+#####
+##### To use this, create an igt symlink in piglit/bin which points to the root
+##### of the intel-gpu-tools sources with the compiled tests. Piglit will
+##### automatically add all tests into the 'igt' category.
+#############################################################################
+
+if not os.path.exists(os.path.join(testBinDir, 'igt')):
+    print "igt symlink not found!"
+    sys.exit(0)
+
+# Chase the piglit/bin/igt symlink to find where the tests really live.
+igtTestRoot = path.join(path.realpath(path.join(testBinDir, 'igt')), 'tests')
+
+profile = TestProfile()
+
+class IGTTest(ExecTest):
+    def __init__(self, binary, arguments=[]):
+        ExecTest.__init__(self, [path.join(igtTestRoot, binary)] + arguments)
+        self.timeout = 60*20 # 20 minutes deadline by default
+
+    def interpretResult(self, out, returncode, results, dmesg):
+        if returncode == 0:
+            results['result'] = 'dmesg-warn' if dmesg != '' else 'pass'
+        elif returncode == 77:
+            results['result'] = 'skip'
+        else:
+            results['result'] = 'dmesg-fail' if dmesg != '' else 'fail'
+        return out
+    def run(self, env):
+        env.dmesg = True
+        return ExecTest.run(self, env)
+
+def listTests(listname):
+    oldDir = os.getcwd()
+    try:
+        os.chdir(igtTestRoot)
+        proc = subprocess.Popen(
+                ['make', listname ],
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                env=os.environ.copy(),
+                universal_newlines=True
+                )
+        out, err = proc.communicate()
+        returncode = proc.returncode
+    finally:
+        os.chdir(oldDir)
+
+    lines = out.split('\n')
+    found_header = False
+    progs = ""
+
+    for line in lines:
+        if found_header:
+            progs = line.split(" ")
+            break
+
+        if "TESTLIST" in line:
+            found_header = True;
+
+    return progs
+
+singleTests = listTests("list-single-tests")
+
+for test in singleTests:
+    profile.test_list[path.join('igt', test)] = IGTTest(test)
+
+def addSubTestCases(test):
+    proc = subprocess.Popen(
+            [path.join(igtTestRoot, test), '--list-subtests' ],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE,
+            env=os.environ.copy(),
+            universal_newlines=True
+            )
+    out, err = proc.communicate()
+    returncode = proc.returncode
+
+    subtests = out.split("\n")
+
+    for subtest in subtests:
+        if subtest == "":
+            continue
+        profile.test_list[path.join('igt', test, subtest)] = \
+            IGTTest(test, ['--run-subtest', subtest])
+
+multiTests = listTests("list-multi-tests")
+
+for test in multiTests:
+    addSubTestCases(test)
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/23 piglit: Adapt igt.tests to discover the tests directory itself

In reply to Damien Lespiau
---
 piglit/tests/igt.tests | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
piglit/tests/igt.tests +3 -13
index f388492..16e4586 100644
@@ -31,20 +31,10 @@ from os import path
 from framework.core import testBinDir, TestProfile
 from framework.exectest import ExecTest
 
-#############################################################################
-##### IGTTest: Execute an intel-gpu-tools test
-#####
-##### To use this, create an igt symlink in piglit/bin which points to the root
-##### of the intel-gpu-tools sources with the compiled tests. Piglit will
-##### automatically add all tests into the 'igt' category.
-#############################################################################
-
-if not os.path.exists(os.path.join(testBinDir, 'igt')):
-    print "igt symlink not found!"
-    sys.exit(0)
-
 # Chase the piglit/bin/igt symlink to find where the tests really live.
-igtTestRoot = path.join(path.realpath(path.join(testBinDir, 'igt')), 'tests')
+piglitRoot = path.join(path.dirname(path.realpath(__file__)), os.pardir)
+igtRoot = path.join(piglitRoot, os.pardir)
+igtTestRoot = path.join(igtRoot, 'tests')
 
 profile = TestProfile()
 
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 5/23 piglit: Add a 'run-tests' Makefile target

In reply to Damien Lespiau

Let's start to craft porcelain targets to run the test suite. First stop, run the piglit tests enumerated by igt.tests.

---
 Makefile.am             | 20 ++++++++++++++++++++
 scripts/Makefile.am     |  2 +-
 scripts/build-piglit.sh | 20 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 scripts/build-piglit.sh
Makefile.am +20 -0
index d7a479c..8611929 100644
@@ -46,3 +46,23 @@ ChangeLog:
 	$(CHANGELOG_CMD)
 
 dist-hook: ChangeLog INSTALL
+
+#
+# Useful shortcuts to run tests
+#
+PIGLIT := $(srcdir)/piglit/piglit-run.py
+PIGLIT_SUMMARY := $(srcdir)/piglit/piglit-summary.py -s
+PIGLIT_HTML := $(srcdir)/piglit/piglit-summary-html.py
+IGT_TESTS := $(abs_srcdir)/piglit/tests/igt.tests
+TEST_TARGETS := #
+
+TEST_TARGETS += run-test
+run-tests:
+	@source $(srcdir)/scripts/build-piglit.sh && \
+	output=$$(igt_result_directory) && \
+	$(PIGLIT) $(IGT_TESTS) $$output && \
+	$(PIGLIT_HTML) $$output/html $$output/main && \
+	$(PIGLIT_SUMMARY) $$output/main
+
+
+.PHONY: $(TEST_TARGETS)
scripts/Makefile.am +1 -1
index baf3612..1cabd3f 100644
@@ -1,3 +1,3 @@
 
-dist_noinst_SCRIPTS = who.sh
+dist_noinst_SCRIPTS = who.sh build-piglit.sh
 noinst_PYTHON = throttle.py
scripts/build-piglit.sh new file +20 -0
new file mode 100644
index 0000000..832b5bf
@@ -0,0 +1,20 @@
+#!/bin/bash
+# This script is sourced by Makefiles to provide various utility functions
+
+function igt_result_directory()
+{
+	suite=$1
+	[ -z "$suite" ] && suite=results
+
+	date=`date +%Y%m%d`
+	base=$date-piglit-$suite
+
+	n=1
+	dir=$base.$n
+	while [ -e "$dir" ]; do
+		let n+=1
+		dir=$base.$n
+	done
+
+	echo $dir
+}
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 6/23 piglit: Add the option to inject piglit arguments

In reply to Damien Lespiau

This is useful in extreme cases (for instance, to exclude drv_module_reload if known to fail).

---
 Makefile.am | 1 +
 1 file changed, 1 insertion(+)
Makefile.am +1 -0
index 8611929..471dd3d 100644
@@ -61,6 +61,7 @@ run-tests:
 	@source $(srcdir)/scripts/build-piglit.sh && \
 	output=$$(igt_result_directory) && \
 	$(PIGLIT) $(IGT_TESTS) $$output && \
+	$(PIGLIT) $${PIGLIT_FLAGS} $(IGT_TESTS) $$output && \
 	$(PIGLIT_HTML) $$output/html $$output/main && \
 	$(PIGLIT_SUMMARY) $$output/main
 
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 7/23 piglit: Support resuming from a previous run

In reply to Damien Lespiau

It can happen that the machine hard hangs in one of tests, say, drv_module_reload. We really want to support resuming the run in that case (probably excluding the faulty test as well). This commit adds an easy way to do that:

sudo make run-tests PIGLIT_FLAGS="-x module_reload" RESUME=20131114-piglit-results.1

---
 Makefile.am | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
Makefile.am +12 -3
index 471dd3d..5742b82 100644
@@ -58,9 +58,18 @@ TEST_TARGETS := #
 
 TEST_TARGETS += run-test
 run-tests:
-	@source $(srcdir)/scripts/build-piglit.sh && \
-	output=$$(igt_result_directory) && \
-	$(PIGLIT) $(IGT_TESTS) $$output && \
+	@if [ -n "$(RESUME)" ]; then \
+		[ ! -f $(RESUME)/main ] && { \
+			echo "$(RESUME) is not a valid piglit project"; \
+			exit 1; \
+		}; \
+		output=$(RESUME); \
+		echo "Resuming $(RESUME)..."; \
+		PIGLIT_FLAGS="--resume $$PIGLIT_FLAGS"; \
+	else \
+		source $(srcdir)/scripts/build-piglit.sh && \
+		output=$$(igt_result_directory); \
+	fi; \
 	$(PIGLIT) $${PIGLIT_FLAGS} $(IGT_TESTS) $$output && \
 	$(PIGLIT_HTML) $$output/html $$output/main && \
 	$(PIGLIT_SUMMARY) $$output/main
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 8/23 piglit: Merge filters from previous invocations when resuming

In reply to Damien Lespiau

This commit has been posted to the piglit ml:

http://lists.freedesktop.org/archives/piglit/2013-November/008452.html

---
 piglit/piglit-run.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
piglit/piglit-run.py +9 -4
index 1d63cd4..d11d409 100755
@@ -99,10 +99,15 @@ def main():
         old_results = core.load_results(resultsDir)
         profileFilename = old_results.options['profile']
 
-        # Changing the args to the old args allows us to set them
-        # all in one places down the way
-        args.exclude_tests = old_results.options['exclude_filter']
-        args.include_tests = old_results.options['filter']
+        # Append the test filters that were given in previous runs to the ones
+        # given in the resume invocation
+        for f in old_results.options['exclude_filter']:
+            if f not in args.exclude_tests:
+                args.exclude_tests.append(f)
+
+        for f in old_results.options['filter']:
+            if f not in args.include_tests:
+                args.include_tests.append(f)
 
     # Otherwise parse additional settings from the command line
     else:
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 9/23 piglit: Fix resuming of previous runs

In reply to Damien Lespiau

When resuming and loading the partial JSON file from disk, the 'status' property is replaced by status.Status objects. When serializing back those objects, JSONEncoder is unhappy because it doesn't know how to serialize status.Status objects and gives up with exceptions like:

TypeError: skip is not JSON serializable

We can write a small subclass of JSONEncoder that knows about Status objects and use it to do the initial write back of the partial JSON file.

This commit has been posted on the piglit ml:

http://lists.freedesktop.org/archives/piglit/2013-November/008447.html

---
 piglit/framework/core.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
piglit/framework/core.py +6 -1
index e7767c2..e0fe46c 100644
@@ -58,6 +58,11 @@ __all__ = ['Environment',
            'Test',
            'testBinDir']
 
+class PiglitJSONEncoder(json.JSONEncoder):
+    def default(self, o):
+        if isinstance(o, status.Status):
+            return str(o)
+        return json.JSONEncoder.default(self, o)
 
 class JSONWriter:
     '''
@@ -108,7 +113,7 @@ class JSONWriter:
         self.file = file
         self.__indent_level = 0
         self.__inhibit_next_indent = False
-        self.__encoder = json.JSONEncoder(indent=self.INDENT)
+        self.__encoder = PiglitJSONEncoder(indent=self.INDENT)
 
         # self.__is_collection_empty
         #
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 10/23 piglit: Run our test suite with --no-concurrency

In reply to Damien Lespiau

Tests tend to assume they are the only thing running, some need DRM master, some fill the memory. All in all, they are some correctness issues if we run tests concurrently.

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index 5742b82..f280879 100644
@@ -50,7 +50,7 @@ dist-hook: ChangeLog INSTALL
 #
 # Useful shortcuts to run tests
 #
-PIGLIT := $(srcdir)/piglit/piglit-run.py
+PIGLIT := $(srcdir)/piglit/piglit-run.py --no-concurrency
 PIGLIT_SUMMARY := $(srcdir)/piglit/piglit-summary.py -s
 PIGLIT_HTML := $(srcdir)/piglit/piglit-summary-html.py
 IGT_TESTS := $(abs_srcdir)/piglit/tests/igt.tests
Signature · 1 line
1.8.3.1
#11 lore raw

Re: [PATCH 10/23] piglit: Run our test suite with --no-concurrency

Quoted 6 lines · Damien Lespiau

Tests tend to assume they are the only thing running, some need DRM master, some fill the memory. All in all, they are some correctness issues if we run tests concurrently.

Concurrency is a per-test opt-in thing in piglit. So this is cargo-cult and worse will prevent us to run a subset of tests to run in parallel (e.g. once we have a naming scheme for abi stuff).
-Daniel

Quoted 24 lines
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index 5742b82..f280879 100644
@@ -50,7 +50,7 @@ dist-hook: ChangeLog INSTALL
 #
 # Useful shortcuts to run tests
 #
-PIGLIT := $(srcdir)/piglit/piglit-run.py
+PIGLIT := $(srcdir)/piglit/piglit-run.py --no-concurrency
 PIGLIT_SUMMARY := $(srcdir)/piglit/piglit-summary.py -s
 PIGLIT_HTML := $(srcdir)/piglit/piglit-summary-html.py
 IGT_TESTS := $(abs_srcdir)/piglit/tests/igt.tests
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#12 lore raw

Re: [PATCH 10/23] piglit: Run our test suite with --no-concurrency

Quoted 11 lines · Daniel Vetter
Quoted 6 lines · Damien Lespiau

Tests tend to assume they are the only thing running, some need DRM master, some fill the memory. All in all, they are some correctness issues if we run tests concurrently.

Concurrency is a per-test opt-in thing in piglit. So this is cargo-cult and worse will prevent us to run a subset of tests to run in parallel (e.g. once we have a naming scheme for abi stuff).

Right now, the concurrency runs have big problems. Running anything along drv_module_reload will fail to open the device (and as it fails quickly, a lot of tests will end up being "skipped" (instead of failing, which is another bug)).

Hence using --no-concurrency for now. It's something we can maintain in tree though, and remove once we are more confident it has a reasonable chance to work.

Signature · 1 line
Damien
#13 lore raw

PATCH 11/23 piglit: Generate a Makefile.am from the sync script

In reply to Damien Lespiau

When syncing the piglit runner, also generate the Makefile.am to include the runner in a dist'ed tarball

---
 Makefile.am             |  2 +-
 configure.ac            |  1 +
 piglit/Makefile.am      | 29 +++++++++++++++++++++++++++++
 piglit/sync-from-piglit | 20 ++++++++++++++++++++
 4 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 piglit/Makefile.am
Makefile.am +1 -1
index f280879..0f9af6c 100644
@@ -32,7 +32,7 @@ SUBDIRS += debugger
 endif
 
 if BUILD_TESTS
-SUBDIRS += tests
+SUBDIRS += piglit tests
 endif
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
configure.ac +1 -0
index 0403529..18ab05d 100644
@@ -193,6 +193,7 @@ AC_CONFIG_FILES([
 		 lib/Makefile
 		 man/Makefile
 		 scripts/Makefile
+		 piglit/Makefile
 		 tests/Makefile
 		 tools/Makefile
 		 tools/quick_dump/Makefile
piglit/Makefile.am new file +29 -0
new file mode 100644
index 0000000..0362786
@@ -0,0 +1,29 @@
+# This file is generated, do not edit"
+EXTRA_DIST = \
+	tests/igt.tests \
+	templates/testrun_info.mako \
+	templates/test_result.mako \
+	templates/index.mako \
+	templates/index.css \
+	templates/result.css \
+	templates/empty_status.mako \
+	piglit-merge-results.py \
+	piglit-summary.py \
+	sync-from-piglit \
+	piglit-run.py \
+	framework/status.py \
+	framework/log.py \
+	framework/patterns.py \
+	framework/junit.py \
+	framework/threads.py \
+	framework/gleantest.py \
+	framework/__init__.py \
+	framework/exectest.py \
+	framework/summary.py \
+	framework/core.py \
+	framework/threadpool.py \
+	piglit-summary-junit.py \
+	piglit-framework-tests.py \
+	piglit-print-commands.py \
+	piglit-summary-html.py \
+	$(NULL)
piglit/sync-from-piglit +20 -0
index 20a95ff..b3b7bd8 100755
@@ -21,4 +21,24 @@ rsync -rtv --exclude-from $EXCLUDE_FILE	\
 	$PIGLIT_DIR/piglit-*.py		\
 	$BASE_DIR
 
+files=$(cd $BASE_DIR && find .			\
+		-not -type d 			\
+		-not -name "*.pyc" 		\
+		-not -name "*.sw?" 		\
+		-not -name sync-exclude		\
+		-not -name "Makefile*" |	\
+		grep -v -e "^.$" |		\
+		sed -e 's#^\./##')
+for f in $files; do
+	FILE_LIST="\t$f \\
+$FILE_LIST"
+done
+
+cat <<EOF > $BASE_DIR/Makefile.am
+# This file is generated, do not edit"
+EXTRA_DIST = \\
+EOF
+echo -n -e "$FILE_LIST" >> $BASE_DIR/Makefile.am
+echo -e "\t\$(NULL)"  >> $BASE_DIR/Makefile.am
+
 rm -f $EXCLUDE_FILE
Signature · 1 line
1.8.3.1
#14 lore raw

PATCH 12/23 piglit: Always write the HTML test results

In reply to Damien Lespiau

Even if a previous run has already done it. Useful when resuming an already done test (which in turns is useful to load/write the json file to apply any piglit change).

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index 0f9af6c..4eace31 100644
@@ -71,7 +71,7 @@ run-tests:
 		output=$$(igt_result_directory); \
 	fi; \
 	$(PIGLIT) $${PIGLIT_FLAGS} $(IGT_TESTS) $$output && \
-	$(PIGLIT_HTML) $$output/html $$output/main && \
+	$(PIGLIT_HTML) --overwrite $$output/html $$output/main && \
 	$(PIGLIT_SUMMARY) $$output/main
 
 
Signature · 1 line
1.8.3.1
#15 lore raw

PATCH 13/23 piglit: Add a hint that there's an HTML summary

In reply to Damien Lespiau

And also add the possibility for someone to copy/paste the index.html path to view the HTML summary for use with, say, xdg-open.

---
 Makefile.am | 1 +
 1 file changed, 1 insertion(+)
Makefile.am +1 -0
index 4eace31..bd86a29 100644
@@ -72,6 +72,7 @@ run-tests:
 	fi; \
 	$(PIGLIT) $${PIGLIT_FLAGS} $(IGT_TESTS) $$output && \
 	$(PIGLIT_HTML) --overwrite $$output/html $$output/main && \
+	echo "HTML summary is at $$output/html/index.html" && \
 	$(PIGLIT_SUMMARY) $$output/main
 
 
Signature · 1 line
1.8.3.1
#16 lore raw

PATCH 14/23 framework: Humanize time values in the HTML report

In reply to Damien Lespiau

It's a bit hard to parse raw seconds, so make those time values easier to read while trying to preserve roughly enough relevant precision to be useful.

It gives strings like:

22.4ms
7.798s
42.3s
7min 25s
...

v2: Remove support for days, weeks, months and years, surely no test
should be that long! (Daniel Vetter)
Display 1 decimal if the duration is < 60s (Daniel Vetter)

Sent to the piglit ml:
http://lists.freedesktop.org/archives/piglit/2013-November/008464.html

---
 piglit/framework/summary.py | 40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)
piglit/framework/summary.py +38 -2
index 8fbe2a8..a85353a 100644
@@ -38,6 +38,42 @@ __all__ = [
 ]
 
 
+INTERVALS = (1, 60, 3600)
+NAMES = ('s', 'min', 'hr')
+
+# Gives a human readable elapsed time
+# @amount is a string with a number of seconds
+def humanize_time(amount):
+    result = []
+
+    if amount == 'None':
+        return 'None'
+
+    amount_f = float(amount)
+    if (amount_f < 1):
+        amount_ms = amount_f * 1000
+        if amount_ms < 1:
+            return "< 1ms"
+        return "%.1fms" % amount_ms
+
+    # if < 10s, consider ms are important
+    if amount_f < 10:
+        return "%.03fs" % amount_f
+
+    # still display 1 decimal when < 60s
+    if amount_f < 60:
+        return "%.01fs" % amount_f
+
+    amount = int(amount_f)
+
+    for i in range(len(NAMES) - 1, -1, -1):
+       a = amount / INTERVALS[i]
+       if a > 0:
+          result.append("%d%s" % (a, NAMES[i]))
+          amount -= a * INTERVALS[i]
+
+    return " ".join(result)
+
 class HTMLIndex(list):
     """
     Builds HTML output to be passed to the index mako template, which will be
@@ -420,7 +456,7 @@ class Summary:
 
             with open(path.join(destination, each.name, "index.html"), 'w') as out:
                 out.write(testindex.render(name=each.name,
-                                           time=each.time_elapsed,
+                                           time=humanize_time(each.time_elapsed),
                                            options=each.options,
                                            glxinfo=each.glxinfo,
                                            lspci=each.lspci))
@@ -447,7 +483,7 @@ class Summary:
                             # disapear at somepoint
                             env=value.get('environment', None),
                             returncode=value.get('returncode', 'None'),
-                            time=value.get('time', 'None'),
+                            time=humanize_time(value.get('time', 'None')),
                             info=value.get('info', 'None'),
                             traceback=value.get('traceback', 'None'),
                             command=value.get('command', 'None'),
Signature · 1 line
1.8.3.1
#17 lore raw

PATCH 15/23 piglit: Support R= as RESUME= for the lazies

In reply to Damien Lespiau
---
 Makefile.am | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Makefile.am +6 -5
index bd86a29..5086406 100644
@@ -58,13 +58,14 @@ TEST_TARGETS := #
 
 TEST_TARGETS += run-test
 run-tests:
-	@if [ -n "$(RESUME)" ]; then \
-		[ ! -f $(RESUME)/main ] && { \
-			echo "$(RESUME) is not a valid piglit project"; \
+	@[ -z "$(RESUME)" -a -n "$(R)" ] && RESUME=$(R); \
+	if [ -n "$$RESUME" ]; then \
+		[ ! -f $$RESUME/main ] && { \
+			echo "$$RESUME is not a valid piglit project"; \
 			exit 1; \
 		}; \
-		output=$(RESUME); \
-		echo "Resuming $(RESUME)..."; \
+		output=$$RESUME; \
+		echo "Resuming $$RESUME..."; \
 		PIGLIT_FLAGS="--resume $$PIGLIT_FLAGS"; \
 	else \
 		source $(srcdir)/scripts/build-piglit.sh && \
Signature · 1 line
1.8.3.1
#18 lore raw

PATCH 16/23 drm_lib.sh: Tune the DRM master message a bit

In reply to Damien Lespiau

check_drm_clients can be used to make sure there's no master running. Tune a bit the error message as this is really what we want to test.

---
 tests/drm_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/drm_lib.sh +1 -1
index 97f6f92..92b379f 100755
@@ -31,7 +31,7 @@ fi
 # read everything we can
 if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
 	[ -n "$DRM_LIB_ALLOW_NO_MASTER" ] || \
-		die "ERROR: other drm clients running"
+		die "ERROR: a drm master is already running"
 fi
 
 i915_sfs_path=
Signature · 1 line
1.8.3.1
#19 lore raw

Re: [PATCH 16/23] drm_lib.sh: Tune the DRM master message a bit

Quoted 13 lines · Damien Lespiau

check_drm_clients can be used to make sure there's no master running. Tune a bit the error message as this is really what we want to test.

---
 tests/drm_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/drm_lib.sh +0 -0
index 97f6f92..92b379f 100755

tests/drm_lib.sh fi · line 34

Quoted 5 lines
tests/drm_lib.sh +1 -1
@@ -31,7 +31,7 @@ fi
 # read everything we can
 if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
 	[ -n "$DRM_LIB_ALLOW_NO_MASTER" ] || \
-		die "ERROR: other drm clients running"
+		die "ERROR: a drm master is already running"

Imo the current line is clear enough and we do actually check for any drm client, not just master ... But I don't really care.
-Daniel

Quoted 10 lines
tests/drm_lib.sh +0 -0
 fi
 
 i915_sfs_path=
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#20 lore raw

Re: [PATCH 16/23] drm_lib.sh: Tune the DRM master message a bit

Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Damien Lespiau

check_drm_clients can be used to make sure there's no master running. Tune a bit the error message as this is really what we want to test.

---
 tests/drm_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

tests/drm_lib.sh fi · line 34

Quoted 10 lines
tests/drm_lib.sh +1 -1
index 97f6f92..92b379f 100755
@@ -31,7 +31,7 @@ fi
 # read everything we can
 if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
 	[ -n "$DRM_LIB_ALLOW_NO_MASTER" ] || \
-		die "ERROR: other drm clients running"
+		die "ERROR: a drm master is already running"

Imo the current line is clear enough and we do actually check for any drm client, not just master ... But I don't really care.

Me neither, I'm fine with dropping the patch.

Signature · 1 line
Damien
#21 lore raw

PATCH 17/23 piglit: Make sure there's no DRM master before launching the tests

In reply to Damien Lespiau

Also, use && between statements so we stop the chain once something fails.

---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile.am +2 -1
index 5086406..e790efe 100644
@@ -59,6 +59,7 @@ TEST_TARGETS := #
 TEST_TARGETS += run-test
 run-tests:
 	@[ -z "$(RESUME)" -a -n "$(R)" ] && RESUME=$(R); \
+	$(srcdir)/tests/check_drm_clients && \
 	if [ -n "$$RESUME" ]; then \
 		[ ! -f $$RESUME/main ] && { \
 			echo "$$RESUME is not a valid piglit project"; \
@@ -70,7 +71,7 @@ run-tests:
 	else \
 		source $(srcdir)/scripts/build-piglit.sh && \
 		output=$$(igt_result_directory); \
-	fi; \
+	fi && \
 	$(PIGLIT) $${PIGLIT_FLAGS} $(IGT_TESTS) $$output && \
 	$(PIGLIT_HTML) --overwrite $$output/html $$output/main && \
 	echo "HTML summary is at $$output/html/index.html" && \
Signature · 1 line
1.8.3.1
#22 lore raw

PATCH 18/23 piglit: Make sure we are running the tests as root

In reply to Damien Lespiau
---
 Makefile.am            | 1 +
 tests/Makefile.sources | 1 +
 tests/check_root       | 5 +++++
 3 files changed, 7 insertions(+)
 create mode 100755 tests/check_root
Makefile.am +1 -0
index e790efe..7988d01 100644
@@ -59,6 +59,7 @@ TEST_TARGETS := #
 TEST_TARGETS += run-test
 run-tests:
 	@[ -z "$(RESUME)" -a -n "$(R)" ] && RESUME=$(R); \
+	$(srcdir)/tests/check_root && \
 	$(srcdir)/tests/check_drm_clients && \
 	if [ -n "$$RESUME" ]; then \
 		[ ! -f $$RESUME/main ] && { \
tests/Makefile.sources +1 -0
index a02b93d..eb2b511 100644
@@ -187,6 +187,7 @@ HANG = \
 
 scripts = \
 	check_drm_clients \
+	check_root \
 	ddx_intel_after_fbdev \
 	debugfs_wedged \
 	drm_lib.sh \
tests/check_root new file +5 -0
new file mode 100755
index 0000000..5d49f0d
@@ -0,0 +1,5 @@
+#!/bin/sh
+[ `id -u` = 0 ] || {
+	echo "Error: Not running as root"
+	exit 1
+}
Signature · 1 line
1.8.3.1
#23 lore raw

PATCH 19/23 piglit: Update the README file with the new way of running tests

In reply to Damien Lespiau
---
 README | 54 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 22 deletions(-)
README +32 -22
index 246e24c..021888f 100644
@@ -24,38 +24,48 @@ tests/
 	changes.  Hopefully this can cover the relevant cases we need to
 	worry about, including backwards compatibility.
 
-	Note: The old automake based testrunner had to be scraped due to
-	upstream changes which broke dynamic creation of the test list. Of
-	course it is still possible to directly run tests, even when not always
-	limiting tests to specific subtests (like piglit does).
+	After having compiled the tests, one can run the test-suite with:
 
-	The more comfortable way to run tests is with piglit. First grab piglit
-	from:
+	$ sudo make run-tests
 
-	git://anongit.freedesktop.org/piglit
+	As we have display tests, we need to be DRM master. As a result the
+	test suite can only be run if no other DRM client is active.
+	Similarly, some tests access debugfs, so we need to be root.
 
-	and build it (no need to install anything). Then we need to link up the
-	i-g-t sources with piglit
+	"make run-tests" create a $date-piglit-results.$n directory with the
+	results of the run. More specifically:
+	  - $date-piglit-results.$n/main JSON file with the test results
+	  - $date-piglit-results.$n/html/index.html HTML summary of the run
 
-	piglit-sources $ cd bin
-	piglit-sources/bin $ ln $i-g-t-sources igt -s
+	Where $date is the date formated with `date +%Y%m%d` and $n the nth run
+	of the day.
 
-	The tests in the i-g-t sources need to have been built already. Then we
-	can run the testcases with (as usual as root, no other drm clients
-	running):
+	PIGLIT_FLAGS can be used to give options to the underlying piglit
+	runner. For instance, to exclude test matching '^kms_':
 
-	piglit-sources # ./piglit-run.py tests/igt.tests <results-file>
+	$ sudo make run-tests PIGLIT_FLAGS="-x ^kms_"
 
-	The testlist is built at runtime, so no need to update anything in
-	piglit when adding new tests. See
+	For the list of piglit options, run:
 
-	piglit-sources $ ./piglit-run.py -h
+	$ ./piglit/piglit-run.py -h
 
-	for some useful options.
+	Another useful feature is to be able to resume an interrupted run. To
+	do that, make run-tests needs to know which run we are talking about:
 
-	Piglit only runs a default set of tests and is useful for regression
-	testing. Other tests not run are:
-	- tests that might hang the gpu, see HANG in Makefile.am
+	$ sudo make run-tests RESUME=$date-piglit-results.$n
+
+	or, more succinctly:
+
+	$ sudo make run-tests R=$date-piglit-results.$n
+
+	It's possible to combine PIGLIT_FLAGS and RESUME. This is useful to
+	resume runs where a specific test deterministically hang the machine:
+
+	$ sudo make run-tests PIGLIT_FLAGS="-x drv_module_reload" R=$date-piglit-results.$n
+
+	"make run-tests" only runs a default set of tests and is useful for
+	regression testing. Other tests not run are:
+	- tests that might hang the gpu, see HANG in tests/Makefile.sources
 	- gem_stress, a stress test suite. Look at the source for all the
 	  various options.
 	- testdisplay is only run in the default mode. testdisplay has tons of
Signature · 1 line
1.8.3.1
#24 lore raw

Re: [PATCH 19/23] piglit: Update the README file with the new way of running tests

Quoted 1 line · Damien Lespiau

Hm, I'd keep the references to the real piglit somewhere, since our copy here is just for convenience. Development should happen upstream. -Daniel

Quoted 86 lines
---
 README | 54 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 22 deletions(-)
README +32 -22
index 246e24c..021888f 100644
@@ -24,38 +24,48 @@ tests/
 	changes.  Hopefully this can cover the relevant cases we need to
 	worry about, including backwards compatibility.
 
-	Note: The old automake based testrunner had to be scraped due to
-	upstream changes which broke dynamic creation of the test list. Of
-	course it is still possible to directly run tests, even when not always
-	limiting tests to specific subtests (like piglit does).
+	After having compiled the tests, one can run the test-suite with:
 
-	The more comfortable way to run tests is with piglit. First grab piglit
-	from:
+	$ sudo make run-tests
 
-	git://anongit.freedesktop.org/piglit
+	As we have display tests, we need to be DRM master. As a result the
+	test suite can only be run if no other DRM client is active.
+	Similarly, some tests access debugfs, so we need to be root.
 
-	and build it (no need to install anything). Then we need to link up the
-	i-g-t sources with piglit
+	"make run-tests" create a $date-piglit-results.$n directory with the
+	results of the run. More specifically:
+	  - $date-piglit-results.$n/main JSON file with the test results
+	  - $date-piglit-results.$n/html/index.html HTML summary of the run
 
-	piglit-sources $ cd bin
-	piglit-sources/bin $ ln $i-g-t-sources igt -s
+	Where $date is the date formated with `date +%Y%m%d` and $n the nth run
+	of the day.
 
-	The tests in the i-g-t sources need to have been built already. Then we
-	can run the testcases with (as usual as root, no other drm clients
-	running):
+	PIGLIT_FLAGS can be used to give options to the underlying piglit
+	runner. For instance, to exclude test matching '^kms_':
 
-	piglit-sources # ./piglit-run.py tests/igt.tests <results-file>
+	$ sudo make run-tests PIGLIT_FLAGS="-x ^kms_"
 
-	The testlist is built at runtime, so no need to update anything in
-	piglit when adding new tests. See
+	For the list of piglit options, run:
 
-	piglit-sources $ ./piglit-run.py -h
+	$ ./piglit/piglit-run.py -h
 
-	for some useful options.
+	Another useful feature is to be able to resume an interrupted run. To
+	do that, make run-tests needs to know which run we are talking about:
 
-	Piglit only runs a default set of tests and is useful for regression
-	testing. Other tests not run are:
-	- tests that might hang the gpu, see HANG in Makefile.am
+	$ sudo make run-tests RESUME=$date-piglit-results.$n
+
+	or, more succinctly:
+
+	$ sudo make run-tests R=$date-piglit-results.$n
+
+	It's possible to combine PIGLIT_FLAGS and RESUME. This is useful to
+	resume runs where a specific test deterministically hang the machine:
+
+	$ sudo make run-tests PIGLIT_FLAGS="-x drv_module_reload" R=$date-piglit-results.$n
+
+	"make run-tests" only runs a default set of tests and is useful for
+	regression testing. Other tests not run are:
+	- tests that might hang the gpu, see HANG in tests/Makefile.sources
 	- gem_stress, a stress test suite. Look at the source for all the
 	  various options.
 	- testdisplay is only run in the default mode. testdisplay has tons of
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#25 lore raw

Re: [PATCH 19/23] piglit: Update the README file with the new way of running tests

Quoted 5 lines · Daniel Vetter
Quoted 1 line · Damien Lespiau

Hm, I'd keep the references to the real piglit somewhere, since our copy here is just for convenience. Development should happen upstream.

Right, I thought it goes without saying, but a note about this is definitly better.

Signature · 1 line
Damien
#26 lore raw

PATCH 20/23 framework: Dump the result of 'uname -a' in the report

In reply to Damien Lespiau

Sent to the piglit ml:
http://lists.freedesktop.org/archives/piglit/2013-November/008465.html

---
 piglit/framework/core.py           | 3 +++
 piglit/framework/summary.py        | 1 +
 piglit/templates/testrun_info.mako | 6 ++++++
 3 files changed, 10 insertions(+)
piglit/framework/core.py +3 -0
index e0fe46c..e0b49f8 100644
@@ -293,11 +293,13 @@ class TestrunResult:
         self.serialized_keys = ['options',
                                 'name',
                                 'tests',
+                                'uname',
                                 'wglinfo',
                                 'glxinfo',
                                 'lspci',
                                 'time_elapsed']
         self.name = None
+        self.uname = None
         self.glxinfo = None
         self.lspci = None
         self.time_elapsed = None
@@ -432,6 +434,7 @@ class Environment:
         else:
             result['glxinfo'] = self.run('glxinfo')
         if system == 'Linux':
+            result['uname'] = self.run(['uname', '-a'])
             result['lspci'] = self.run('lspci')
         return result
 
piglit/framework/summary.py +1 -0
index a85353a..13596ea 100644
@@ -458,6 +458,7 @@ class Summary:
                 out.write(testindex.render(name=each.name,
                                            time=humanize_time(each.time_elapsed),
                                            options=each.options,
+                                           uname=each.uname,
                                            glxinfo=each.glxinfo,
                                            lspci=each.lspci))
 
piglit/templates/testrun_info.mako +6 -0
index e6e00b3..6ff1f44 100644
@@ -30,6 +30,12 @@
         <td>${options}</td>
       </tr>
       <tr>
+        <td>uname -a</td>
+        <td>
+          <pre>${uname}</pre>
+        </td>
+      </tr>
+      <tr>
         <td>lspci</td>
         <td>
           <pre>${lspci}</pre>
Signature · 1 line
1.8.3.1
#27 lore raw

PATCH 21/23 lib: Introduce igt_run_quick()

In reply to Damien Lespiau

Turns out that we'd like to be able a "quick" version of the tests on real hardware as well. So "in simulation" and "quick" are two different concepts.

Note that "in simulation" implies "quick", so igt_run_quick() tests if we are running on simulation before looking at the IGT_QUICK env variable.

---
 lib/drmtest.c | 15 +++++++++++++++
 lib/drmtest.h |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)
lib/drmtest.c +15 -0
index 15ed847..5760c87 100644
@@ -1278,6 +1278,21 @@ bool igt_run_in_simulation(void)
 	return simulation;
 }
 
+bool igt_run_quick(void)
+{
+	static int quick = -1;
+
+	if (quick == -1) {
+		if (igt_run_in_simulation())
+			quick = true;
+		else
+			quick = env_set("IGT_QUICK", false);
+	}
+
+	return quick;
+}
+
+
 /**
  * igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
  *
lib/drmtest.h +2 -1
index 5295a7b..c93fe6b 100644
@@ -300,8 +300,9 @@ static inline void gem_require_ring(int fd, int ring_id)
 	}
 }
 
-/* helpers to automatically reduce test runtime in simulation */
+/* helpers to automatically reduce test runtime */
 bool igt_run_in_simulation(void);
+bool igt_run_quick(void);
 #define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
 /**
  * igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
Signature · 1 line
1.8.3.1
#28 lore raw

PATCH 22/23 lib: Change SLOW_QUICK() to use igt_run_quick()

In reply to Damien Lespiau

IGT_QUICK=1 is now triggering the quick version of the tests.

---
 lib/drmtest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/drmtest.h +1 -1
index c93fe6b..3a07329 100644
@@ -303,7 +303,7 @@ static inline void gem_require_ring(int fd, int ring_id)
 /* helpers to automatically reduce test runtime */
 bool igt_run_in_simulation(void);
 bool igt_run_quick(void);
-#define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
+#define SLOW_QUICK(slow,quick) (igt_run_quick() ? (quick) : (slow))
 /**
  * igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
  *
Signature · 1 line
1.8.3.1
#29 lore raw

PATCH 23/23 pm_pc8: Use SLOW_QUICK() with the number of rounds

In reply to Damien Lespiau

igt has some test suite wide support to specify slow/quick numbers of rounds with the SLOW_QUICK() macro.

This allows us to run the tests with IGT_QUICK=1 and get the fast version of tests and provide a unified interface.

---
 tests/pm_pc8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/pm_pc8.c +1 -1
index efeae21..7003d5a 100644
@@ -1280,7 +1280,7 @@ static void gem_execbuf_stress_subtest(int rounds, int wait_flags)
 
 int main(int argc, char *argv[])
 {
-	int rounds = 50;
+	int rounds = SLOW_QUICK(50, 10);
 
 	igt_subtest_init(argc, argv);
 
Signature · 1 line
1.8.3.1
#30 lore raw
In reply to Damien Lespiau
Quoted 2 lines · Damien Lespiau

Another useful feature is to be able to resume an interrupted run. To do that, make run-tests needs to know which run we are talking about:

There's a known bug with piglit here in that resuming doesn't conserve --no-concurrency from the initial work. Dylan Baker has fixed it and we can get the fix with the next piglit sync.

Signature · 1 line
Damien
#31 lore raw
In reply to Damien Lespiau
Quoted 14 lines · Damien Lespiau

The objective of this series is to make the test-suite easier to run by embedding a copy a piglit and providing porcelain on top of it in the form of a makefile target. Beside python, there's no external dependency to run the test suite after this series.

The provided makefile target runs the full test suite. I'm still interested in providing, as a follow-up of this work, shorcuts for subsets of the testsuite that can be useful for developpers, subset what we would maintain in tree. For instance:
- tests selected by topic: running gem_.* Vs kms_.* Vs pm_.* (or maybe when running, say, gt tests, exlude ^kms_.* ^pm_.* so we still still a lot of the other tests (core_, drm_, ...)
- quick subtests (where we disable long running stress, race, ... tests)

Quoted 2 lines

patches 21-23 are something a bit different, try to pave the way for quick runs (by really the first tiny step).

I'm ok with doing the slow/quick thing if people like it.o

On the real deal (i.e. patches 1-20) a few overall comments:

- I think we need to make it very clear that piglit should still be developed upstream. So local changes shouldn't be allowed at all imo. Afaics that would only affect tests/igt.tests - can't we fix that by replicating the symlink, too?

- The makefile target looks like a script. I think it'd be better to extract it as a real script.

- I'm not too terribly sold on the convenience script. Imo it shouldn't be more than executable documentation, since I'm a bit afraid that we'll add neat features (like fancy resume with auto-blocking of crashing tests) to it that would better be done in upstream piglit to benefit everyone.

But overall I agree that we need a local copy of piglit since apparently way too few people on our team us it to run igts. And running igts without piglit is just nuts.

Cheers, Daniel

Quoted 48 lines

The README has been updated and I copy/paste it here the documentation for what would be the new way to run tests:

After having compiled the tests, one can run the test-suite with:

$ sudo make run-tests

"make run-tests" create a $date-piglit-results.$n directory with the results of the run. More specifically:
- $date-piglit-results.$n/main JSON file with the test results
- $date-piglit-results.$n/html/index.html HTML summary of the run

Where $date is the date formated with date +%Y%m%d and $n the nth run of the day.

PIGLIT_FLAGS can be used to give options to the underlying piglit runner. For instance, to exclude test matching '^kms_':

$ sudo make run-tests PIGLIT_FLAGS="-x ^kms_"

For the list of piglit options, run:

$ ./piglit/piglit-run.py -h

Another useful feature is to be able to resume an interrupted run. To do that, make run-tests needs to know which run we are talking about:

$ sudo make run-tests RESUME=$date-piglit-results.$n

or, more succinctly:

$ sudo make run-tests R=$date-piglit-results.$n

It's possible to combine PIGLIT_FLAGS and RESUME. This is useful to resume runs where a specific test deterministically hang the machine:

$ sudo make run-tests PIGLIT_FLAGS="-x drv_module_reload" R=$date-piglit-results.$n

HTH,

Signature · 6 lines
Damien

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#32 lore raw
Quoted 33 lines

-----Original Message-----
From: [email protected] [mailto:intel-gfx- [email protected]] On Behalf Of Daniel Vetter
Sent: Friday, November 15, 2013 5:23 PM
To: Lespiau, Damien
Cc: [email protected]
Subject: Re: [Intel-gfx] [igt] Making the test-suite easier to run

Quoted 11 lines · Damien Lespiau

The objective of this series is to make the test-suite easier to run by embedding a copy a piglit and providing porcelain on top of it in the form of a makefile target. Beside python, there's no external dependency to run the test suite after this series.

The provided makefile target runs the full test suite. I'm still interested in providing, as a follow-up of this work, shorcuts for subsets of the testsuite that can be useful for developpers, subset what we would maintain in tree. For
instance:
- tests selected by topic: running gem_.* Vs kms_.* Vs pm_.* (or maybe

when

Quoted 7 lines

running, say, gt tests, exlude ^kms_.* ^pm_.* so we still still a lot of the other tests (core_, drm_, ...)
- quick subtests (where we disable long running stress, race, ...
tests)

patches 21-23 are something a bit different, try to pave the way for quick runs (by really the first tiny step).

I'm ok with doing the slow/quick thing if people like it.o

On the real deal (i.e. patches 1-20) a few overall comments:

Quoted 7 lines

- I think we need to make it very clear that piglit should still be developed upstream. So local changes shouldn't be allowed at all imo. Afaics that would only affect tests/igt.tests - can't we fix that by replicating the symlink, too?

- The makefile target looks like a script. I think it'd be better to extract it as a real script.

+1 on that. The make target is not a valid option for Android (If I manage to run python on Android, I mean...)

Quoted 64 lines

- I'm not too terribly sold on the convenience script. Imo it shouldn't be more than executable documentation, since I'm a bit afraid that we'll add neat features (like fancy resume with auto-blocking of crashing tests) to it that would better be done in upstream piglit to benefit everyone.

But overall I agree that we need a local copy of piglit since apparently way too few people on our team us it to run igts. And running igts without piglit is just nuts.

Cheers, Daniel

Quoted 2 lines

The README has been updated and I copy/paste it here the

documentation

Quoted 6 lines

for what would be the new way to run tests:

After having compiled the tests, one can run the test-suite with:

$ sudo make run-tests

Quoted 7 lines

"make run-tests" create a $date-piglit-results.$n directory with the results of the run. More specifically:
- $date-piglit-results.$n/main JSON file with the test results
- $date-piglit-results.$n/html/index.html HTML summary of
the run

Where $date is the date formated with date +%Y%m%d and $n the

nth run

Quoted 28 lines

of the day.

PIGLIT_FLAGS can be used to give options to the underlying piglit runner. For instance, to exclude test matching '^kms_':

$ sudo make run-tests PIGLIT_FLAGS="-x ^kms_"

For the list of piglit options, run:

$ ./piglit/piglit-run.py -h

Another useful feature is to be able to resume an interrupted run. To do that, make run-tests needs to know which run we are talking about:

$ sudo make run-tests RESUME=$date-piglit-results.$n

or, more succinctly:

$ sudo make run-tests R=$date-piglit-results.$n

It's possible to combine PIGLIT_FLAGS and RESUME. This is useful to resume runs where a specific test deterministically hang the machine:

$ sudo make run-tests PIGLIT_FLAGS="-x drv_module_reload"
R=$date-piglit-results.$n

HTH,

Quoted 7 lines

--
Damien

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 8 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

#33 lore raw
In reply to Daniel Vetter
Quoted 2 lines · Daniel Vetter

- I think we need to make it very clear that piglit should still be developed upstream. So local changes shouldn't be allowed at all imo.

Sure, I'll wait until my patches are upstreamed to resend the series without the local patches.

Quoted 2 lines

Afaics that would only affect tests/igt.tests - can't we fix that by replicating the symlink, too?

I was thinking to completely remove igt.tests from upstream piglit. There isn't anything special about the location of igt.tests, you just need to give a (absolute) path to it when launching piglit-run.py and not being in the piglit-run.py directory. As igt.test is really coupled with igt, it makes sense to carry it in our tree, IMO.

Quoted 2 lines

- The makefile target looks like a script. I think it'd be better to extract it as a real script.

Can do.

Quoted 5 lines

- I'm not too terribly sold on the convenience script. Imo it shouldn't be more than executable documentation, since I'm a bit afraid that we'll add neat features (like fancy resume with auto-blocking of crashing tests) to it that would better be done in upstream piglit to benefit everyone.

Point taken. We can judge when adding a feature if it'd be better to do it upstream of if it's just a convenience wrapper for us.

But what I really want is the convenience and well defined runs that everyone can replicate (a lof of details to remember, concurrent Vs not-concurrent, how to generate the HTML report, ...). And I'd like to add more: eg. give the 10 tests that take the longest time in the run so people can look at them and try to make them faster, ...

Also I really want quicker subsets of the test-suite, people don't run the full test-suite everytime they work on a series and this just step 1/ towards that goal. Running a subset is better than running nothing at all :)

Signature · 1 line
Damien
#34 lore raw
Quoted 7 lines · Damien Lespiau
Quoted 2 lines · Daniel Vetter

- I think we need to make it very clear that piglit should still be developed upstream. So local changes shouldn't be allowed at all imo.

Sure, I'll wait until my patches are upstreamed to resend the series without the local patches.

Quoted 8 lines
Quoted 2 lines

Afaics that would only affect tests/igt.tests - can't we fix that by replicating the symlink, too?

I was thinking to completely remove igt.tests from upstream piglit. There isn't anything special about the location of igt.tests, you just need to give a (absolute) path to it when launching piglit-run.py and not being in the piglit-run.py directory. As igt.test is really coupled with igt, it makes sense to carry it in our tree, IMO.

It's also coupled with piglit. If we move it completely then enabling new piglit features will be a bit a pain. The only reason I can see to keep it in igt only is if we want to change the way we generate the test list (the current way with Makefile target will probably not amuse Oscar). But that's about the only thing.

Quoted 20 lines
Quoted 2 lines

- The makefile target looks like a script. I think it'd be better to extract it as a real script.

Can do.

Quoted 5 lines

- I'm not too terribly sold on the convenience script. Imo it shouldn't be more than executable documentation, since I'm a bit afraid that we'll add neat features (like fancy resume with auto-blocking of crashing tests) to it that would better be done in upstream piglit to benefit everyone.

Point taken. We can judge when adding a feature if it'd be better to do it upstream of if it's just a convenience wrapper for us.

But what I really want is the convenience and well defined runs that everyone can replicate (a lof of details to remember, concurrent Vs not-concurrent, how to generate the HTML report, ...). And I'd like to add more: eg. give the 10 tests that take the longest time in the run so people can look at them and try to make them faster, ...

Quoted 4 lines

Also I really want quicker subsets of the test-suite, people don't run the full test-suite everytime they work on a series and this just step 1/ towards that goal. Running a subset is better than running nothing at all :)

Yeah, like I've said it makes sense. I just have the long-term dream of pimping piglit into a generally useful gfx testrunner, maybe even with a bit of code to support centrally stored test results. Would help a lot for my own little lab here ;-)

Cheers, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch