test-integration.bat 5.5 KB
Newer Older
A
Alexandru Dima 已提交
1 2 3
@echo off
setlocal

J
build  
Joao Moreno 已提交
4 5
pushd %~dp0\..

J
maybe  
Joao Moreno 已提交
6
set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2%
7
set VSCODECRASHDIR=%~dp0\..\.build\crashes
8

B
Benjamin Pasero 已提交
9
:: Figure out which Electron to use for running tests
10
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
11
	:: Run out of sources: no need to compile as code.bat takes care of it
12
	chcp 65001
13
	set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
14
	set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1
B
Benjamin Pasero 已提交
15

16
	echo Storing crash reports into '%VSCODECRASHDIR%'.
J
Joao Moreno 已提交
17
	echo Running integration tests out of sources.
18
) else (
B
Benjamin Pasero 已提交
19
	:: Run from a built: need to compile all test extensions
B
Benjamin Pasero 已提交
20 21
	:: because we run extension tests from their source folders
	:: and the build bundles extensions into .build webpacked
22 23 24
	call yarn gulp 	compile-extension:vscode-api-tests^
					compile-extension:vscode-colorize-tests^
					compile-extension:markdown-language-features^
25
					compile-extension:vscode-notebook-tests^
26 27 28 29 30
					compile-extension:emmet^
					compile-extension:css-language-features-server^
					compile-extension:html-language-features-server^
					compile-extension:json-language-features-server^
					compile-extension:git
31

32 33 34 35
	:: Configuration for more verbose output
	set VSCODE_CLI=1
	set ELECTRON_ENABLE_LOGGING=1

36
	echo Storing crash reports into '%VSCODECRASHDIR%'.
J
Joao Moreno 已提交
37
	echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build.
38 39
)

R
Rob Lourens 已提交
40
:: Integration & performance tests in AMD
41 42
::call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
::if %errorlevel% neq 0 exit /b %errorlevel%
R
Rob Lourens 已提交
43

44
:: Tests in the extension host
45

46 47
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-notebook-tests\test --enable-proposed-api=vscode.vscode-notebook-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-notebook-tests --extensionTestsPath=%~dp0\..\extensions\vscode-notebook-tests\out --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
:: if %errorlevel% neq 0 exit /b %errorlevel%
R
rebornix 已提交
48

49
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
D
Daniel Imms 已提交
50
if %errorlevel% neq 0 exit /b %errorlevel%
51

52
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
D
Daniel Imms 已提交
53
if %errorlevel% neq 0 exit /b %errorlevel%
54

55
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
56 57
if %errorlevel% neq 0 exit /b %errorlevel%

58 59 60 61
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\markdown-language-features\out\test\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\markdown-language-features --extensionTestsPath=%~dp0\..\extensions\markdown-language-features\out\test --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
62 63
if %errorlevel% neq 0 exit /b %errorlevel%

64
call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\out\test\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% .
65
if %errorlevel% neq 0 exit /b %errorlevel%
A
Alexandru Dima 已提交
66

J
Joao Moreno 已提交
67 68
for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i
set GITWORKSPACE=%TEMPDIR%\git-%RANDOM%
J
maybe  
Joao Moreno 已提交
69
mkdir %GITWORKSPACE%
70
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --enable-proposed-api=vscode.git --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
J
maybe  
Joao Moreno 已提交
71
if %errorlevel% neq 0 exit /b %errorlevel%
72

73
:: Tests in commonJS (HTML, CSS, JSON language server tests...)
74 75
call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js
if %errorlevel% neq 0 exit /b %errorlevel%
76

77
rmdir /s /q %VSCODEUSERDATADIR%
78

J
build  
Joao Moreno 已提交
79 80
popd

81
endlocal