2017-10-07 00:33:22 +08:00
|
|
|
#!/bin/bash
|
2016-03-08 18:50:56 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
|
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
|
|
|
ROOT=$(dirname $(dirname $(realpath "$0")))
|
|
|
|
else
|
|
|
|
ROOT=$(dirname $(dirname $(readlink -f $0)))
|
2019-10-11 03:26:28 +08:00
|
|
|
LINUX_NO_SANDBOX="--no-sandbox" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
|
2016-03-08 18:50:56 +08:00
|
|
|
fi
|
|
|
|
|
2020-02-04 19:32:02 +08:00
|
|
|
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
|
2017-04-25 14:50:57 +08:00
|
|
|
cd $ROOT
|
|
|
|
|
2019-09-02 17:26:26 +08:00
|
|
|
# Figure out which Electron to use for running tests
|
|
|
|
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
|
|
|
|
then
|
2019-09-04 14:55:20 +08:00
|
|
|
# Run out of sources: no need to compile as code.sh takes care of it
|
2019-09-02 17:26:26 +08:00
|
|
|
INTEGRATION_TEST_ELECTRON_PATH="./scripts/code.sh"
|
2019-09-04 14:55:20 +08:00
|
|
|
|
|
|
|
echo "Running integration tests out of sources."
|
2019-09-02 17:26:26 +08:00
|
|
|
else
|
2019-09-04 14:55:20 +08:00
|
|
|
# Run from a built: need to compile all test extensions
|
2019-09-02 17:26:26 +08:00
|
|
|
yarn gulp compile-extension:vscode-api-tests
|
|
|
|
yarn gulp compile-extension:vscode-colorize-tests
|
|
|
|
yarn gulp compile-extension:markdown-language-features
|
|
|
|
yarn gulp compile-extension:emmet
|
|
|
|
yarn gulp compile-extension:css-language-features-server
|
|
|
|
yarn gulp compile-extension:html-language-features-server
|
|
|
|
yarn gulp compile-extension:json-language-features-server
|
2020-02-04 20:04:38 +08:00
|
|
|
yarn gulp compile-extension:git
|
2019-09-02 17:26:26 +08:00
|
|
|
|
2020-01-15 23:36:03 +08:00
|
|
|
# Configuration for more verbose output
|
|
|
|
export VSCODE_CLI=1
|
|
|
|
export ELECTRON_ENABLE_STACK_DUMPING=1
|
|
|
|
export ELECTRON_ENABLE_LOGGING=1
|
|
|
|
|
2019-09-04 14:55:20 +08:00
|
|
|
echo "Running integration tests with '$INTEGRATION_TEST_ELECTRON_PATH' as build."
|
2019-09-02 17:26:26 +08:00
|
|
|
fi
|
|
|
|
|
2018-10-30 06:23:39 +08:00
|
|
|
# Integration tests in AMD
|
2019-09-18 19:55:03 +08:00
|
|
|
./scripts/test.sh --runGlob **/*.integrationTest.js "$@"
|
2018-10-30 06:23:39 +08:00
|
|
|
|
2017-11-15 18:15:41 +08:00
|
|
|
# Tests in the extension host
|
2019-10-09 00:02:55 +08:00
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
2020-02-10 22:32:59 +08:00
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/markdown-language-features/out/test/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/emmet/out/test/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
2020-02-04 19:35:16 +08:00
|
|
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/git --extensionTestsPath=$ROOT/extensions/git/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
|
2019-10-09 00:02:55 +08:00
|
|
|
|
2018-06-12 23:24:23 +08:00
|
|
|
# Tests in commonJS
|
|
|
|
cd $ROOT/extensions/css-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
|
|
|
cd $ROOT/extensions/html-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
2017-03-17 23:52:31 +08:00
|
|
|
|
2017-04-25 14:50:57 +08:00
|
|
|
rm -r $VSCODEUSERDATADIR
|