test-integration.bat 5.6 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:typescript-language-features^
M
Matt Bierner 已提交
26
					compile-extension:vscode-custom-editor-tests^
27
					compile-extension:vscode-notebook-tests^
28 29 30 31 32
					compile-extension:emmet^
					compile-extension:css-language-features-server^
					compile-extension:html-language-features-server^
					compile-extension:json-language-features-server^
					compile-extension:git
33

34 35 36 37
	:: Configuration for more verbose output
	set VSCODE_CLI=1
	set ELECTRON_ENABLE_LOGGING=1

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

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

46
:: Tests in the extension host
47

48
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 已提交
49
if %errorlevel% neq 0 exit /b %errorlevel%
50

51
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 已提交
52
if %errorlevel% neq 0 exit /b %errorlevel%
53

54
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%
55 56
if %errorlevel% neq 0 exit /b %errorlevel%

57 58
REM 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%
REM if %errorlevel% neq 0 exit /b %errorlevel%
59

60
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\markdown-language-features\test-workspace --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%
61 62
if %errorlevel% neq 0 exit /b %errorlevel%

63
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% .
64
if %errorlevel% neq 0 exit /b %errorlevel%
A
Alexandru Dima 已提交
65

66 67 68
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%

J
Joao Moreno 已提交
69 70
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 已提交
71
mkdir %GITWORKSPACE%
72
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 已提交
73
if %errorlevel% neq 0 exit /b %errorlevel%
74

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

79
rmdir /s /q %VSCODEUSERDATADIR%
80

J
build  
Joao Moreno 已提交
81 82
popd

83
endlocal