Merge lp:~brian.curtin/dirspec/windows-buildout into lp:dirspec

Proposed by Brian Curtin
Status: Merged
Approved by: Diego Sarmentero
Approved revision: 12
Merged at revision: 12
Proposed branch: lp:~brian.curtin/dirspec/windows-buildout
Merge into: lp:dirspec
Diff against target: 57 lines (+18/-24)
1 file modified
run-tests.bat (+18/-24)
To merge this branch: bzr merge lp:~brian.curtin/dirspec/windows-buildout
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) Approve
dobey (community) Approve
Review via email: mp+115423@code.launchpad.net

Commit message

Adjust run-tests.bat to work with the Windows buildout environment.

Description of the change

Update run-tests.bat to work with our buildout environments.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

+FOR %%B in (u1trial) do (SET TRIALPATH=%%~$PATH:B)

We are not using u1trial in dirspec, nor have we ever been (as it would introduce a circular dep, and now a dep on twisted which doesn't work with python3). This line should be removed.

review: Needs Fixing
12. By Brian Curtin

c&p error, trial isn't used here

Revision history for this message
Brian Curtin (brian.curtin) wrote :

Fixed. That was a block pasted in from the other run-tests.bat files.

windowsbatchlint would have caught that

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Mike McCracken (mikemc) wrote :

Just left as a comment because I'm about to leave for a few days, but I can't run the tests with the buildout python - I think I must be missing a dependency somewhere?

C:\Users\mmccrack\Canonical\ubuntuone-windows-installer\scripts\devsetup\parts\dirspec>python setup.py test
running test
running egg_info
writing dirspec.egg-info\PKG-INFO
writing top-level names to dirspec.egg-info\top_level.txt
writing dependency_links to dirspec.egg-info\dependency_links.txt
reading manifest file 'dirspec.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dirspec.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "C:\Users\mmccrack\Canonical\ubuntuone-windows-installer\scripts\devsetup\bin\python-script.py", line 58, in <module>
    execfile(__file__)
  File "setup.py", line 26, in <module>
    test_suite='dirspec.tests',
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\command\test.py", line 137, in run
    self.with_project_on_sys_path(self.run_tests)
  File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\command\test.py", line 117, in with_project_on_sys_path
    func()
  File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\command\test.py", line 146, in run_tests
    testLoader = loader_class()
  File "C:\Python27\lib\unittest\main.py", line 94, in __init__
    self.parseArgs(argv)
  File "C:\Python27\lib\unittest\main.py", line 149, in parseArgs
    self.createTests()
  File "C:\Python27\lib\unittest\main.py", line 158, in createTests
    self.module)
  File "C:\Python27\lib\unittest\loader.py", line 128, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "C:\Python27\lib\unittest\loader.py", line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'tests'

Revision history for this message
Brian Curtin (brian.curtin) wrote :

Ah yes, you need testtools installed. That's a part of a previous change to dirspec that Rodney made. If you manually add it to your buildout it'll work. I'll get it added to the buildout.cfg in bzr.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'run-tests.bat'
--- run-tests.bat 2012-07-13 18:55:53 +0000
+++ run-tests.bat 2012-07-17 20:59:23 +0000
@@ -12,35 +12,29 @@
12:: You should have received a copy of the GNU General Public License along12:: You should have received a copy of the GNU General Public License along
13:: with this program. If not, see <http://www.gnu.org/licenses/>.13:: with this program. If not, see <http://www.gnu.org/licenses/>.
14@ECHO off14@ECHO off
15:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,15
16:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.16SET PYTHONEXEPATH=""
17SET PYTHONEXECPATH=""17SET PYTHONPATH=.
18:: This is very annoying; FOR /F will work differently depending on the output18
19:: of reg which is not consistent between OS versions (XP, 7). We must choose19ECHO Checking for Python on the path
20:: the tokens according to OS version.20:: Look for Python from buildout
21SET PYTHONPATHTOKENS=321FOR %%A in (python.exe) do (SET PYTHONEXEPATH=%%~$PATH:A)
22VER | FIND "XP" > nul22FOR %%C in (pyflakes) do (SET FLAKESPATH=%%~$PATH:C)
23IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=423FOR %%D in (pep8.exe) do (SET PEP8PATH=%%~$PATH:D)
24ECHO Checking if python 2.7 is in the system24
25:: Look for python 2.725IF NOT "%PYTHONEXEPATH%" == "" GOTO :PYTHONPRESENT
26FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXECPATH=%%A26
27IF NOT %PYTHONEXECPATH% == "" GOTO :PYTHONPRESENT
28ECHO Checking if python 2.6 is in the system
29:: we do not have python 2.7 in the system, try to find 2.6
30FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXECPATH=%%A
31IF NOT %PYTHONEXECPATH% == "" GOTO :PYTHONPRESENT
32:: we do not have python (2.6 or 2.7), therefore we go to end
33ECHO Please ensure you have python installed27ECHO Please ensure you have python installed
34GOTO :END28GOTO :END
3529
36:PYTHONPRESENT30:PYTHONPRESENT
37ECHO Python found, executing the tests...31ECHO Python found, executing the tests...
38:: execute the tests with a number of ignored linux only modules32:: execute the tests with a number of ignored linux only modules
39"%PYTHONEXECPATH%\python.exe" setup.py build test clean33"%PYTHONEXEPATH%" setup.py build test clean
40"%PYTHONEXECPATH%\python.exe" "%PYTHONEXECPATH%\Scripts\pyflakes" dirspec34"%PYTHONEXEPATH%" "%FLAKESPATH%" dirspec
41:: test for style if we can, if pep8 is not present, move to the end35:: test for style if we can, if pep8 is not present, move to the end
42IF EXIST "%PYTHONEXECPATH%Scripts\pep8.exe"36IF EXIST "%PEP8PATH%" (
43"%PYTHONEXECPATH%\Scripts\pep8.exe" --repeat dirspec37"%PEP8PATH%" --repeat dirspec
44ELSE38)ELSE (
45ECHO Style checks were not done39ECHO Style checks were not done)
46:END40:END

Subscribers

People subscribed via source and target branches