2020-04-30 19:52:54 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-10-29 04:27:17 +08:00
|
|
|
help() {
|
2024-10-05 08:08:14 +08:00
|
|
|
echo >&2 " You can build with 'npm run watch' or you can build a release"
|
|
|
|
echo >&2 " For example: 'npm run build && npm run build:vscode && KEEP_MODULES=1 npm run release'"
|
|
|
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release npm run test:e2e'"
|
2021-10-29 04:27:17 +08:00
|
|
|
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
|
|
|
|
|
2022-01-05 05:02:25 +08:00
|
|
|
pushd test/e2e/extensions/test-extension
|
|
|
|
echo "Building test extension"
|
2024-10-05 08:08:14 +08:00
|
|
|
npm run build
|
2022-01-05 05:02:25 +08:00
|
|
|
popd
|
|
|
|
|
2021-06-23 05:34:44 +08: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-29 04:27:17 +08:00
|
|
|
help
|
2021-06-23 05:34:44 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-03-15 10:37:29 +08:00
|
|
|
if [[ ! -d $dir/lib/vscode/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
|
2024-10-16 07:15:10 +08:00
|
|
|
./node_modules/.bin/playwright test "$@"
|
2020-04-30 19:52:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|