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