2020-04-30 19:52:54 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-10-29 04:27:17 +08: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 19:52:54 +08:00
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
2021-09-09 03:05:49 +08:00
|
|
|
|
2021-06-23 05:34:44 +08:00
|
|
|
source ./ci/lib.sh
|
|
|
|
|
|
|
|
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-29 04:27:17 +08:00
|
|
|
help
|
2021-06-23 05:34:44 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-09-09 03:05:49 +08:00
|
|
|
if [[ ! -d $dir/vendor/modules/code-oss-dev/out ]]; then
|
2021-06-23 05:34:44 +08:00
|
|
|
echo >&2 "No VS Code build detected"
|
2021-10-29 04:27:17 +08:00
|
|
|
help
|
2021-06-23 05:34:44 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-04-14 08:31:56 +08:00
|
|
|
cd test
|
2021-06-23 05:34:44 +08:00
|
|
|
yarn playwright test "$@"
|
2020-04-30 19:52:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|