2020-04-30 13:52:54 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-10-28 22:27:17 +02:00
|
|
|
help() {
|
|
|
|
echo >&2 " You can build with 'yarn watch' or you can build a release"
|
|
|
|
echo >&2 " For example: 'yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release'"
|
|
|
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release yarn test:e2e'"
|
|
|
|
echo >&2 " You can manually run that release with 'node ./release'"
|
|
|
|
}
|
|
|
|
|
2020-04-30 13:52:54 +02:00
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
2021-09-08 21:05:49 +02:00
|
|
|
|
2021-06-22 23:34:44 +02:00
|
|
|
source ./ci/lib.sh
|
|
|
|
|
2022-01-04 22:02:25 +01:00
|
|
|
pushd test/e2e/extensions/test-extension
|
|
|
|
echo "Building test extension"
|
|
|
|
yarn build
|
|
|
|
popd
|
|
|
|
|
2021-06-22 23:34:44 +02:00
|
|
|
local dir="$PWD"
|
|
|
|
if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then
|
|
|
|
echo "Set CODE_SERVER_TEST_ENTRY to test another build of code-server"
|
|
|
|
else
|
|
|
|
pushd "$CODE_SERVER_TEST_ENTRY"
|
|
|
|
dir="$PWD"
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Testing build in '$dir'"
|
|
|
|
|
|
|
|
# Simple sanity checks to see that we've built. There could still be things
|
|
|
|
# wrong (native modules version issues, incomplete build, etc).
|
|
|
|
if [[ ! -d $dir/out ]]; then
|
|
|
|
echo >&2 "No code-server build detected"
|
2021-10-28 22:27:17 +02:00
|
|
|
help
|
2021-06-22 23:34:44 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-09-08 21:05:49 +02:00
|
|
|
if [[ ! -d $dir/vendor/modules/code-oss-dev/out ]]; then
|
2021-06-22 23:34:44 +02:00
|
|
|
echo >&2 "No VS Code build detected"
|
2021-10-28 22:27:17 +02:00
|
|
|
help
|
2021-06-22 23:34:44 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-04-14 02:31:56 +02:00
|
|
|
cd test
|
2021-06-22 23:34:44 +02:00
|
|
|
yarn playwright test "$@"
|
2020-04-30 13:52:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|