2022-09-22 12:33:32 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
help() {
|
2026-11-20 21:38:16 +11:00
|
|
|
echo >&2 " You can build the release with 'KEEP_MODULES=1 pnpm run release'"
|
2022-09-22 12:33:32 -07:00
|
|
|
echo >&2 " Or you can pass in a custom path."
|
2026-11-20 21:38:16 +11:00
|
|
|
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' pnpm run test:integration"
|
2022-09-22 12:33:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Make sure a code-server release works. You can pass in the path otherwise it
|
2026-03-27 17:08:35 -08:00
|
|
|
# will look for $RELEASE_PATH in the current directory.
|
2022-09-22 12:33:32 -07:00
|
|
|
#
|
|
|
|
|
# This is to make sure we don't have Node version errors or any other
|
|
|
|
|
# compilation-related errors.
|
|
|
|
|
main() {
|
|
|
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
|
|
|
|
|
|
source ./ci/lib.sh
|
|
|
|
|
|
2026-03-27 17:08:35 -08:00
|
|
|
local path="$RELEASE_PATH/bin/code-server"
|
2022-09-22 12:33:32 -07:00
|
|
|
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
|
|
|
|
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
|
|
|
|
else
|
|
|
|
|
path="$CODE_SERVER_PATH"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Running tests with code-server binary: '$path'"
|
|
|
|
|
|
|
|
|
|
if [[ ! -f $path ]]; then
|
|
|
|
|
echo >&2 "No code-server build detected"
|
|
|
|
|
echo >&2 "Looked in $path"
|
|
|
|
|
help
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-11-20 21:38:16 +11:00
|
|
|
CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" \
|
|
|
|
|
--coverage=false \
|
|
|
|
|
--testRegex "./test/integration/help.test.ts"
|
2022-09-22 12:33:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main "$@"
|