Skip to content

Commit 62f050f

Browse files
committed
Add a simple test
1 parent 5742537 commit 62f050f

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"scripts": {
44
"runner": "cd ./scripts && node --max-old-space-size=32384 -r ts-node/register ./build.ts",
55
"start": "nodemon --watch ../../../out --verbose ../../../out/vs/server/main.js",
6+
"test": "./scripts/test.sh",
67
"watch": "cd ../../../ && yarn watch",
78
"build": "yarn && yarn runner build",
89
"package": "yarn runner package",

scripts/ci.bash

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# ci.bash -- Build code-server in the CI.
33

44
set -euo pipefail
@@ -9,7 +9,7 @@ function main() {
99
# Get the version information. If a specific version wasn't set, generate it
1010
# from the tag and VS Code version.
1111
local vscode_version=${VSCODE_VERSION:-1.41.1}
12-
local code_server_version=${VERSION:-2.${TRAVIS_TAG:-${DRONE_TAG:-daily}}-vsc$vscode_version}
12+
local code_server_version=${VERSION:-2.${TRAVIS_TAG:-${DRONE_TAG:-daily}}}
1313

1414
# Remove everything that isn't the current VS Code source for caching
1515
# (otherwise the cache will contain old versions).
@@ -32,9 +32,7 @@ function main() {
3232
}
3333

3434
run-yarn build
35-
if [[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] ; then
36-
run-yarn binary
37-
fi
35+
run-yarn binary
3836
if [[ -n ${PACKAGE:-} ]] ; then
3937
run-yarn package
4038
fi

scripts/test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
# test.sh -- Simple test for CI.
3+
# We'll have more involved tests eventually. This just ensures the binary has
4+
# been built and runs.
5+
6+
set -eu
7+
8+
main() {
9+
cd "$(dirname "$0")/.."
10+
11+
version=$(./binaries/code-server* --version | head -1)
12+
echo "Got '$version' for the version"
13+
case $version in
14+
*2.*-vsc1.41.1) exit 0 ;;
15+
*) exit 1 ;;
16+
esac
17+
}
18+
19+
main "$@"

0 commit comments

Comments
 (0)