← Back to team overview

ufl team mailing list archive

Re: UFL and buildbot

 

Here is the patch.

Johannes

On Tue, March 10, 2009 09:05, Johannes Ring wrote:
> The tests now failed on Windows but it was not reported to ufl-dev.
> However, this was a problem with the buildbot and I have fixed that now.
> The Windows problem is a familiar one and I will try come up with a patch.
>
> Johannes
>
> On Tue, March 10, 2009 08:47, Martin Sandve Alnæs wrote:
>> Ok! Thanks.
>>
>> Martin
>>
>>
>>
>> On Tue, Mar 10, 2009 at 8:45 AM, Johannes Ring <johannr@xxxxxxxxx>
>> wrote:
>>> On Mon, March 9, 2009 16:03, Martin Sandve Alnæs wrote:
>>>> I checked in a failing test, but nothing seems to be happening? How
>>>> long should it usually take?
>>>
>>> The buildbot starts to build UFL three minutes after a commit. The test
>>> did fail as you can see from the log:
>>>
>>> http://fenics.org:8080/builders/ufl-hardy-i386/builds/2/steps/ufl%20check/logs/stdio
>>>
>>> The problem in this case is that test/test.py always exits with 0
>>> (success) even if some tests failed. You should modify the test script
>>> to
>>> return an exit code different from 0 on failure, e.g. replace the
>>> bottom
>>> loop with this:
>>>
>>> # Run tests
>>> failed_tests = []
>>> for test in tests:
>>>    print "Running tests: %s" % test
>>>    failure = system("python %s.py" % test)
>>>    if failure:
>>>        failed_tests.append(test)
>>>    print ""
>>>
>>> sys.exit(len(failed_tests))
>>>
>>> Johannes
>>>
>>>> Martin
>>>>
>>>>
>>>>
>>>> On Mon, Mar 9, 2009 at 3:55 PM, Johannes Ring <johannr@xxxxxxxxx>
>>>> wrote:
>>>>> On Mon, March 9, 2009 15:45, Martin Sandve Alnæs wrote:
>>>>>> On Mon, Mar 9, 2009 at 3:31 PM, Johannes Ring <johannr@xxxxxxxxx>
>>>>>> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a couple of issues regarding UFL and the buildbot:
>>>>>>>
>>>>>>> 1. The Windows buildslave failed during build. The following patch
>>>>>>> should
>>>>>>> fix this:
>>>>>>>
>>>>>>> --- a/setup.py  Sun Mar 08 20:18:58 2009 +0100
>>>>>>> +++ b/setup.py  Mon Mar 09 15:19:26 2009 +0100
>>>>>>> @@ -41,5 +41,5 @@
>>>>>>>                  "scripts/ufl-convert",
>>>>>>>                  "scripts/form2ufl"],
>>>>>>>       packages = ["ufl", "ufl.algorithms"],
>>>>>>> -      package_dir = {"ufl": "ufl/"},
>>>>>>> +      package_dir = {"ufl": "ufl"},
>>>>>>>       data_files = [("lib/pkgconfig", ["ufl-%d.pc" % major])])
>>>>>>
>>>>>> Done.
>>>>>>
>>>>>>> 2. The buildbot is not currently triggered by a commit. To fix
>>>>>>> this,
>>>>>>> add
>>>>>>> the following line under the [hooks] section in .hg/hgrc:
>>>>>>>
>>>>>>> changegroup.jhbuildbot = hg-notify UFL jhbuildbot@xxxxxxxxxx
>>>>>>
>>>>>> Done.
>>>>>>
>>>>>>> 3. Let me know if you want the buildbot to send an email to ufl-dev
>>>>>>> if/when the build or tests fails.
>>>>>>
>>>>>> Yes please. We should keep it stable now.
>>>>>
>>>>> Done.
>>>>>
>>>>> Johannes
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>
# HG changeset patch
# User Johannes Ring <johannr@xxxxxxxxx>
# Date 1236674752 -3600
# Node ID 8e77e1867035b72e56ce86b371c674cb7971182f
# Parent  b9feb0644e955873c633339f3a75181bc3d8f865
Windows fix in setup.py (install batch files).

diff -r b9feb0644e95 -r 8e77e1867035 setup.py
--- a/setup.py	Tue Mar 10 08:51:06 2009 +0100
+++ b/setup.py	Tue Mar 10 09:45:52 2009 +0100
@@ -2,8 +2,9 @@
 
 from distutils.core import setup
 from distutils import sysconfig
-from os.path import join as pjoin
+from os.path import join as pjoin, split as psplit
 import sys
+import platform
 
 # Version number
 major = 0
@@ -29,18 +30,33 @@
 # FIXME: better way for this? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 file.close()
 
+scripts = [pjoin("scripts", "ufl-analyse"),
+           pjoin("scripts", "ufl2latex"),
+           pjoin("scripts", "ufl2pdf"),
+           pjoin("scripts", "ufl-convert"),
+           pjoin("scripts", "form2ufl")]
+
+if platform.system() == "Windows" or "bdist_wininst" in sys.argv:
+    # In the Windows command prompt we can't execute Python scripts 
+    # without a .py extension. A solution is to create batch files
+    # that runs the different scripts.
+    batch_files = []
+    for script in scripts:
+        batch_file = script + ".bat"
+        f = open(batch_file, "w")
+        f.write('python "%%~dp0\%s" %%*' % psplit(script)[1])
+        f.close()
+        batch_files.append(batch_file)
+    scripts.extend(batch_files)
+
 setup(name = "UFL",
       version = "%d.%d" % (major, minor),
       description = "Unified Form Language",
       author = "Martin Sandve Alnaes, Anders Logg",
       author_email = "ufl-dev@xxxxxxxxxx",
       url = "http://www.fenics.org/ufl/";,
-      scripts = ["scripts/ufl-analyse",
-                 "scripts/ufl2latex",
-                 "scripts/ufl2pdf",
-                 "scripts/ufl-convert",
-                 "scripts/form2ufl"],
+      scripts = scripts,
       packages = ["ufl", "ufl.algorithms"],
       package_dir = {"ufl": "ufl"},
-      data_files = [("lib/pkgconfig", ["ufl-%d.pc" % major])])
+      data_files = [(pjoin("lib", "pkgconfig"), ["ufl-%d.pc" % major])])
 

References