test-integration.bat 4.9 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 41 42 43
:: Integration & performance tests in AMD
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
if %errorlevel% neq 0 exit /b %errorlevel%

44
:: Tests in the extension host
45

R
rebornix 已提交
46 47 48
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% --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

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% --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% --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% --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
56 57
if %errorlevel% neq 0 exit /b %errorlevel%

58
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% --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% .
59 60
if %errorlevel% neq 0 exit /b %errorlevel%

61
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% --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% .
62
if %errorlevel% neq 0 exit /b %errorlevel%
A
Alexandru Dima 已提交
63

J
Joao Moreno 已提交
64 65
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 已提交
66
mkdir %GITWORKSPACE%
67
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% --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
J
maybe  
Joao Moreno 已提交
68
if %errorlevel% neq 0 exit /b %errorlevel%
69

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

74
rmdir /s /q %VSCODEUSERDATADIR%
75

J
build  
Joao Moreno 已提交
76 77
popd

78
endlocal