From 68c6182b83f7e4ae829fa6f9f86cccf22ea156f3 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 15 Nov 2017 11:15:41 +0100 Subject: [PATCH] clean up test scripts, bring back html server tests --- scripts/{test-mocha.bat => node-electron.bat} | 9 +-------- scripts/{test-mocha.sh => node-electron.sh} | 10 ++-------- scripts/test-int-mocha.bat | 1 - scripts/test-int-mocha.sh | 1 - scripts/test-integration.bat | 9 +++++++-- scripts/test-integration.sh | 11 ++++++++--- test/mocha.opts | 4 +--- 7 files changed, 19 insertions(+), 26 deletions(-) rename scripts/{test-mocha.bat => node-electron.bat} (57%) rename scripts/{test-mocha.sh => node-electron.sh} (81%) delete mode 100644 scripts/test-int-mocha.bat delete mode 100755 scripts/test-int-mocha.sh diff --git a/scripts/test-mocha.bat b/scripts/node-electron.bat similarity index 57% rename from scripts/test-mocha.bat rename to scripts/node-electron.bat index e1aa4bef47f..4ddb95b3cae 100644 --- a/scripts/test-mocha.bat +++ b/scripts/node-electron.bat @@ -10,15 +10,8 @@ set NAMESHORT=%NAMESHORT: "=% set NAMESHORT=%NAMESHORT:"=%.exe set CODE=".build\electron\%NAMESHORT%" -rem TFS Builds -if not "%BUILD_BUILDID%" == "" ( - %CODE% .\node_modules\mocha\bin\_mocha %* -) +%CODE% %* -rem Otherwise -if "%BUILD_BUILDID%" == "" ( - %CODE% .\node_modules\mocha\bin\_mocha --reporter dot %* -) popd endlocal diff --git a/scripts/test-mocha.sh b/scripts/node-electron.sh similarity index 81% rename from scripts/test-mocha.sh rename to scripts/node-electron.sh index 9aa16fa3241..a1c2cf469b0 100755 --- a/scripts/test-mocha.sh +++ b/scripts/node-electron.sh @@ -20,23 +20,17 @@ fi INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`" INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null) -# Node modules -test -d node_modules || ./scripts/npm.sh install # Get electron (test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron -# Build -test -d out || ./node_modules/.bin/gulp compile - -# Unit Tests export VSCODE_DEV=1 if [[ "$OSTYPE" == "darwin"* ]]; then cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \ "$CODE" \ - node_modules/mocha/bin/_mocha "$@" + "$@" else cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \ "$CODE" \ - node_modules/mocha/bin/_mocha "$@" + "$@" fi diff --git a/scripts/test-int-mocha.bat b/scripts/test-int-mocha.bat deleted file mode 100644 index 482aadc5bd5..00000000000 --- a/scripts/test-int-mocha.bat +++ /dev/null @@ -1 +0,0 @@ -.\scripts\test.bat --runGlob **\*.integrationTest.js -g integration %* diff --git a/scripts/test-int-mocha.sh b/scripts/test-int-mocha.sh deleted file mode 100755 index c0a8913886a..00000000000 --- a/scripts/test-int-mocha.sh +++ /dev/null @@ -1 +0,0 @@ -./scripts/test.sh --runGlob **/*.integrationTest.js -g integration "$@" \ No newline at end of file diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 0a2b92e00d7..3c807be78ae 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -8,12 +8,17 @@ if not "%APPVEYOR%" == "" ( ) set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5% -:: Integration Tests +:: Tests in the extension host .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR% .\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --user-data-dir=%VSCODEUSERDATADIR% -.\scripts\test-int-mocha.bat .\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR% +:: Integration & performance tests in AMD +.\scripts\test.bat --runGlob **\*.integrationTest.js %* + +:: Tests in commonJS (language servers tests...) +.\scripts\mocha-electron.bat .\extensions\html\server\out\test\ + rmdir /s /q %VSCODEUSERDATADIR% popd diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 0a9eea1b077..911b411015f 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -12,10 +12,15 @@ fi cd $ROOT -# Integration Tests +# Tests in the extension host ./scripts/code.sh $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started ./scripts/code.sh $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started -./scripts/test-int-mocha.sh -./scripts/code.sh $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started +#./scripts/code.sh $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started + +# Integration tests in AMD +./scripts/test.sh --runGlob **/*.integrationTest.js "$@" + +# Tests in commonJS (language server tests...) +./scripts/node-electron.sh ./node_modules/mocha/bin/_mocha ./extensions/html/server/out/test/ rm -r $VSCODEUSERDATADIR diff --git a/test/mocha.opts b/test/mocha.opts index d6b09ce6e07..52e4348c3ed 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,4 +1,2 @@ ---delay --ui tdd ---timeout 10000 -test/all.js +--timeout 10000 \ No newline at end of file -- GitLab