Merge lp:~brian.curtin/ubuntuone-client/run-tests-buildout-cleanup into lp:ubuntuone-client

Proposed by Brian Curtin
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 1226
Merged at revision: 1227
Proposed branch: lp:~brian.curtin/ubuntuone-client/run-tests-buildout-cleanup
Merge into: lp:ubuntuone-client
Diff against target: 108 lines (+26/-53)
1 file modified
run-tests.bat (+26/-53)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-client/run-tests-buildout-cleanup
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+102394@code.launchpad.net

Commit message

- Make run-tests.bat work with the new buildout environment.

Description of the change

Allow run-tests.bat to work with the new buildout environment.

This depends on lp:~brian.curtin/ubuntuone-windows-installer/buildout-env

To post a comment you must log in.
1226. By Brian Curtin

Prefer the TRIAL_TEMP_DIR environment variable for Jenkins, and fall back to the local _trial_temp directory

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

+1

review: Approve
Revision history for this message
Manuel de la Peña (mandel) wrote :

Same here, worked with no problems!

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-04-09 20:07:05 +0000
+++ run-tests.bat 2012-04-18 17:33:51 +0000
@@ -27,58 +27,22 @@
2727
28@ECHO off28@ECHO off
2929
30:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
31:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
32SET REGQUERY27="REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve"
33SET REGQUERY2732="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve"
34SET REGQUERY26="REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve"
35SET REGQUERY2632="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve"
36SET PYTHONEXEPATH=""30SET PYTHONEXEPATH=""
3731
38:: This is very annoying; FOR /F will work differently depending on the output32set PYTHONPATH=..\ubuntu-sso-client;.
39:: of reg which is not consistent between OS versions (XP, 7). We must choose33
40:: the tokens according to OS version.34ECHO Checking for Python on the path
41SET PYTHONPATHTOKENS=335:: Look for Python from buildout
42VER | FIND "XP" > nul36FOR %%A in (python.exe) do (SET PYTHONEXEPATH=%%~$PATH:A)
43IF %ERRORLEVEL% == 0 (37FOR %%B in (u1trial) do (SET TRIALPATH=%%~$PATH:B)
44 SET PYTHONPATHTOKENS=4)38FOR %%C in (u1lint) do (SET LINTPATH=%%~$PATH:C)
4539FOR %%D in (pep8.exe) do (SET PEP8PATH=%%~$PATH:D)
46ECHO Checking if python 2.7 is in the system40
4741IF NOT "%PYTHONEXEPATH%" == "" GOTO :PYTHONPRESENT
48:: Look for python 2.7
49FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY27%') DO @SET PYTHONEXEPATH=%%A
50
51IF NOT %PYTHONEXEPATH% == "" (
52 GOTO :PYTHONPRESENT)
53
54ECHO Checking if python 2.6 is in the system
55:: we do not have python 2.7 in the system, try to find 2.6
56FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY26%') DO @SET PYTHONEXEPATH=%%A
57
58IF NOT %PYTHONEXEPATH% == "" (
59 GOTO :PYTHONPRESENT)
60
61:: we do not have python (2.6 or 2.7) this could hapen in the case that the
62:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
63
64:: Look for python 2.7 in WoW64
65ECHO Checking if python 2.7 32 is in the system
66FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2732%') DO @SET PYTHONEXEPATH=%%A
67
68IF NOT %PYTHONEXEPATH% == "" (
69 GOTO :PYTHONPRESENT)
70
71ECHO Checking if python 2.6 32 is in the system
72:: we do not have python 2.7 in the system, try to find 2.6
73FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2632%') DO @SET PYTHONEXEPATH=%%A
74
75IF NOT %PYTHONEXEPATH% == "" (
76 GOTO :PYTHONPRESENT)
7742
78ECHO Please ensure you have python installed43ECHO Please ensure you have python installed
79GOTO :END44GOTO :END
8045
81
82:PYTHONPRESENT46:PYTHONPRESENT
8347
84:: throw the first parameter away if is /skip-lint,48:: throw the first parameter away if is /skip-lint,
@@ -110,19 +74,28 @@
110COPY windows\clientdefs.py ubuntuone\clientdefs.py74COPY windows\clientdefs.py ubuntuone\clientdefs.py
111COPY windows\logging.conf data\logging.conf75COPY windows\logging.conf data\logging.conf
112:: execute the tests with a number of ignored linux only modules76:: execute the tests with a number of ignored linux only modules
113"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" --reactor=twisted -c -p tests\platform\linux %PARAMS% tests77"%PYTHONEXEPATH%" "%TRIALPATH%" --reactor=twisted -c -p tests\platform\linux %PARAMS% tests
11478
115IF %SKIPLINT% == 1 (79IF %SKIPLINT% == 1 (
116 ECHO Skipping style checks80 ECHO Skipping style checks
117 GOTO :CLEAN)81 GOTO :CLEAN)
118"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint"82ECHO Performing style checks...
119:: test for style if we can, if pep8 is not present, move to the end83"%PYTHONEXEPATH%" "%LINTPATH%"
120IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" (84
121 "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntuone85:: if pep8 is not present, move to the end
86IF EXIST "%PEP8PATH%" (
87 "%PEP8PATH%" --repeat ubuntuone
122)ELSE (88)ELSE (
123 ECHO Style checks were not done)89 ECHO Style checks were not done)
124:CLEAN90:CLEAN
91
92:: The dot must be escaped or the directory won't be found.
93IF EXIST \.coverage RMDIR /s /q \.coverage
94
125:: Delete the temp folders95:: Delete the temp folders
126RMDIR /s /q _trial_temp96IF "%TRIAL_TEMP_DIR%" == "" GOTO :TRIALTEMPEXISTS
127RMDIR /s /q .coverage97IF EXIST _trial_temp RMDIR /s /q _trial_temp
98: TRIALTEMPEXISTS
99IF EXIST "%TRIAL_TEMP_DIR%" RMDIR /s /q "%TRIAL_TEMP_DIR%"
100
128:END101:END

Subscribers

People subscribed via source and target branches