2020-04-30 07:52:54 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
2021-10-28 13:27:17 -07:00
|
|
|
help() {
|
2026-11-20 21:38:16 +11:00
|
|
|
echo >&2 " You can build with 'pnpm run watch' or you can build a release"
|
|
|
|
|
echo >&2 " For example: 'pnpm run build && pnpm run build:vscode && KEEP_MODULES=1 pnpm run release'"
|
|
|
|
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e'"
|
2021-10-28 13:27:17 -07:00
|
|
|
echo >&2 " You can manually run that release with 'node ./release'"
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-30 07:52:54 -04:00
|
|
|
main() {
|
|
|
|
|
cd "$(dirname "$0")/../.."
|
2021-09-08 15:05:49 -04:00
|
|
|
|
2021-06-22 16:34:44 -05:00
|
|
|
source ./ci/lib.sh
|
|
|
|
|
|
2022-01-04 15:02:25 -06:00
|
|
|
pushd test/e2e/extensions/test-extension
|
|
|
|
|
echo "Building test extension"
|
2026-11-20 21:38:16 +11:00
|
|
|
pnpm run build
|
2022-01-04 15:02:25 -06:00
|
|
|
popd
|
|
|
|
|
|
2021-06-22 16:34:44 -05: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 13:27:17 -07:00
|
|
|
help
|
2021-06-22 16:34:44 -05:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2022-03-14 21:37:29 -05:00
|
|
|
if [[ ! -d $dir/lib/vscode/out ]]; then
|
2021-06-22 16:34:44 -05:00
|
|
|
echo >&2 "No VS Code build detected"
|
2021-10-28 13:27:17 -07:00
|
|
|
help
|
2021-06-22 16:34:44 -05:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2021-04-13 17:31:56 -07:00
|
|
|
cd test
|
2024-10-18 06:31:28 +02:00
|
|
|
./node_modules/.bin/playwright test "$@"
|
2020-04-30 07:52:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main "$@"
|