Skip to contentSkip to conversation

patchtest: several enhancement

PATCH Superseded [email protected] 1 participant 3 messages Dec 29, 2018 – Jan 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patchtest: several enhancement

From: Changqing Li <[email protected]>

* since we need use git-pw in patchwork, and that need GitPython/ requests, so add them into requirements.txt

* fetch-mboxes: add option for supprt select which project to fetch , not always use default oe-core for pull-events

* test-mboxes: crontab's stdin is not atty, curret way will make patchtest get patch from stdin, but not the patch downloaded to folder mboxes. Use pipe stdin way to suppprt run test-mboxes in crontab

* pw-host-test/create-host-test-folder/create-host-crontab:
These scripts are for run test in docker, detail see usage.adoc

---
 requirements.txt                |   2 +
 scripts/create-host-crontab     |  88 ++++++++++++++++++++
 scripts/create-host-test-folder | 151 +++++++++++++++++++++++++++++++++
 scripts/fetch-mboxes            |   9 +-
 scripts/pw-host-test            | 179 ++++++++++++++++++++++++++++++++++++++++
 scripts/test-mboxes             |   2 +-
 usage.adoc                      |   8 ++
 7 files changed, 436 insertions(+), 3 deletions(-)
 create mode 100755 scripts/create-host-crontab
 create mode 100755 scripts/create-host-test-folder
 create mode 100755 scripts/pw-host-test
requirements.txt +2 -0
index 7f7afbf..62a4b5d 100644
@@ -1 +1,3 @@
 jinja2
+GitPython
+requests
scripts/create-host-crontab new file +88 -0

88 lines not on this page · raw message

scripts/create-host-test-folder new file +151 -0

151 lines not on this page · raw message

scripts/fetch-mboxes +7 -2
index 0f95e3e..f2f5115 100755
@@ -23,6 +23,7 @@
 repodir=''
 mboxdir='.'
 since=''
+project=''
 
 function usage() {
     cat << EOF
@@ -33,6 +34,7 @@ where OPTIONS are
     -r <repodir>   : Repository
     -m <mboxdir>   : Directory where mboxes are stored. Defaults to $mboxdir
     -s <timestamp> : Poll events since the defined timestamp
+    -p <project>   : Point which project to fectch
 
 and optional SERIES separated with spaces, i.e. '100 87'. Revision can be included and these appears after the series,
 joined with a dot, i.e. '100.2 87'. If series are not given, it will poll patchwork events using <timestamp> if given,
@@ -46,7 +48,7 @@ EOF
     exit 1
 }
 
-while getopts ":r:m:s:h" opt; do
+while getopts ":r:m:s:p:h" opt; do
     case $opt in
 	r)
 	    repodir=$OPTARG
@@ -57,6 +59,9 @@ while getopts ":r:m:s:h" opt; do
 	s)
 	    since=$OPTARG
 	    ;;
+    p)
+        project=$OPTARG
+        ;;
 	h)
 	    usage
 	    ;;
@@ -80,7 +85,7 @@ series="$@"
 
 # events come in pairs separated by a dot
 if [ -z "$series" ]; then
-    series="$(poll-events $repodir $since)"
+    series="$(poll-events --project $project $repodir $since)"
 fi
 
 if [ -n "$series" ]; then
scripts/pw-host-test new file +179 -0

179 lines not on this page · raw message

scripts/test-mboxes +1 -1
index 9137ba4..7df9c9a 100755
@@ -85,7 +85,7 @@ function testpatch() {
     patchfn=$(basename $patch)
 
     # run patchtest
-    PTRESULTS="$(patchtest $patch $repodir $startdir $extraptargs --json 2>$tmp)"
+    PTRESULTS="$(cat $patch | patchtest - $repodir $startdir $extraptargs --json 2>$tmp)"
 
     # store stdout/stderr and return if there was an error on pt execution
     if [ $? -ne 0 ]; then
usage.adoc +8 -0
index 4357529..f7f4111 100644
@@ -4,6 +4,7 @@
 
 . <<intro, Introduction>>
 . <<host, Host execution>>
+  .. <<Test in docker>>
 . <<guest, Guest execution>>
 . <<pw, Patchwork Git configuration>>
 . <<scenarios, Secundary scripts and common scenarios>>
@@ -83,6 +84,11 @@ cd <path to OE-core repository>
 git format-patch -1 --stdout | patchtest - <path to patchtest> <path to /pachtest-oe/tests>
 ----
 
+=== Test in Docker
+
+create-host-crontab/create-host-test-folder/pw-host-test is added for docker test. Detail usage
+can refer doc in patchwork, README.pw
+
 [[guest]]
 === Guest execution
 
@@ -293,3 +299,5 @@ the test results, just include the parameter `-A` (inside the new branch, you wi
 test failures). As in the `-o` case, the branch can be visited and commits review with standard
 `git-log/show` where results are stored as `git-notes`.
 
+
+
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 patchtest: several enhancement for docker

change in V2:
fix bug in pw-host-test

change in V1:
based on previous script guest, which run qemu, and run testcase in qemu, change to pw-host-test, change to run directly on host. and will be used by dockerfile in patchwork, detail deploy can refer change in patchwork for docker deployment.

Changqing Li (1):
patchtest: several enhancement

 requirements.txt                |   2 +
 scripts/create-host-crontab     |  88 +++++++++++++++++++
 scripts/create-host-test-folder | 151 ++++++++++++++++++++++++++++++++
 scripts/fetch-mboxes            |   9 +-
 scripts/pw-host-test            | 185 ++++++++++++++++++++++++++++++++++++++++
 scripts/test-mboxes             |   2 +-
 usage.adoc                      |   8 ++
 7 files changed, 442 insertions(+), 3 deletions(-)
 create mode 100755 scripts/create-host-crontab
 create mode 100755 scripts/create-host-test-folder
 create mode 100755 scripts/pw-host-test
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/1 patchtest: several enhancement

From: Changqing Li <[email protected]>

* since we need use git-pw in patchwork, and that need GitPython/ requests, so add them into requirements.txt

* fetch-mboxes: add option for supprt select which project to fetch , not always use default oe-core for pull-events

* test-mboxes: crontab's stdin is not atty, curret way will make patchtest get patch from stdin, but not the patch downloaded to folder mboxes. Use pipe stdin way to suppprt run test-mboxes in crontab

* pw-host-test/create-host-test-folder/create-host-crontab:
These scripts are for run test in docker, detail see usage.adoc

---
 requirements.txt                |   2 +
 scripts/create-host-crontab     |  88 +++++++++++++++++++
 scripts/create-host-test-folder | 151 ++++++++++++++++++++++++++++++++
 scripts/fetch-mboxes            |   9 +-
 scripts/pw-host-test            | 185 ++++++++++++++++++++++++++++++++++++++++
 scripts/test-mboxes             |   2 +-
 usage.adoc                      |   8 ++
 7 files changed, 442 insertions(+), 3 deletions(-)
 create mode 100755 scripts/create-host-crontab
 create mode 100755 scripts/create-host-test-folder
 create mode 100755 scripts/pw-host-test
requirements.txt +2 -0
index 7f7afbf..62a4b5d 100644
@@ -1 +1,3 @@
 jinja2
+GitPython
+requests
scripts/create-host-crontab new file +88 -0

88 lines not on this page · raw message

scripts/create-host-test-folder new file +151 -0

151 lines not on this page · raw message

scripts/fetch-mboxes +7 -2
index 0f95e3e..f2f5115 100755
@@ -23,6 +23,7 @@
 repodir=''
 mboxdir='.'
 since=''
+project=''
 
 function usage() {
     cat << EOF
@@ -33,6 +34,7 @@ where OPTIONS are
     -r <repodir>   : Repository
     -m <mboxdir>   : Directory where mboxes are stored. Defaults to $mboxdir
     -s <timestamp> : Poll events since the defined timestamp
+    -p <project>   : Point which project to fectch
 
 and optional SERIES separated with spaces, i.e. '100 87'. Revision can be included and these appears after the series,
 joined with a dot, i.e. '100.2 87'. If series are not given, it will poll patchwork events using <timestamp> if given,
@@ -46,7 +48,7 @@ EOF
     exit 1
 }
 
-while getopts ":r:m:s:h" opt; do
+while getopts ":r:m:s:p:h" opt; do
     case $opt in
 	r)
 	    repodir=$OPTARG
@@ -57,6 +59,9 @@ while getopts ":r:m:s:h" opt; do
 	s)
 	    since=$OPTARG
 	    ;;
+    p)
+        project=$OPTARG
+        ;;
 	h)
 	    usage
 	    ;;
@@ -80,7 +85,7 @@ series="$@"
 
 # events come in pairs separated by a dot
 if [ -z "$series" ]; then
-    series="$(poll-events $repodir $since)"
+    series="$(poll-events --project $project $repodir $since)"
 fi
 
 if [ -n "$series" ]; then
scripts/pw-host-test new file +185 -0

185 lines not on this page · raw message

scripts/test-mboxes +1 -1
index 9137ba4..7df9c9a 100755
@@ -85,7 +85,7 @@ function testpatch() {
     patchfn=$(basename $patch)
 
     # run patchtest
-    PTRESULTS="$(patchtest $patch $repodir $startdir $extraptargs --json 2>$tmp)"
+    PTRESULTS="$(cat $patch | patchtest - $repodir $startdir $extraptargs --json 2>$tmp)"
 
     # store stdout/stderr and return if there was an error on pt execution
     if [ $? -ne 0 ]; then
usage.adoc +8 -0
index 4357529..f7f4111 100644
@@ -4,6 +4,7 @@
 
 . <<intro, Introduction>>
 . <<host, Host execution>>
+  .. <<Test in docker>>
 . <<guest, Guest execution>>
 . <<pw, Patchwork Git configuration>>
 . <<scenarios, Secundary scripts and common scenarios>>
@@ -83,6 +84,11 @@ cd <path to OE-core repository>
 git format-patch -1 --stdout | patchtest - <path to patchtest> <path to /pachtest-oe/tests>
 ----
 
+=== Test in Docker
+
+create-host-crontab/create-host-test-folder/pw-host-test is added for docker test. Detail usage
+can refer doc in patchwork, README.pw
+
 [[guest]]
 === Guest execution
 
@@ -293,3 +299,5 @@ the test results, just include the parameter `-A` (inside the new branch, you wi
 test failures). As in the `-o` case, the branch can be visited and commits review with standard
 `git-log/show` where results are stored as `git-notes`.
 
+
+
Signature · 1 line
2.7.4