提交 b31643de 编写于 作者: J Joao Moreno

Merge branch 'linux-unit-tests'

......@@ -91,6 +91,7 @@ const copyrightFilter = [
'!**/*.xpm',
'!**/*.opts',
'!**/*.disabled',
'!build/**/*.init',
'!resources/win32/bin/code.js',
'!extensions/markdown/media/tomorrow.css',
'!extensions/html/server/src/modes/typescript/*'
......
pat
\ No newline at end of file
......@@ -3,6 +3,8 @@ MAINTAINER Joao Moreno <joao.moreno@microsoft.com>
RUN dpkg --add-architecture i386
RUN apt-get update
# Dependencies
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib g++-multilib
RUN apt-get install -y zip
......@@ -27,3 +29,11 @@ RUN apt-get install -y libx11-xcb-dev libx11-xcb-dev:i386
RUN apt-get install -y libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
RUN apt-get install -y libxkbfile-dev
RUN apt-get install -y bc bsdmainutils
# Xvfb
# Thanks https://medium.com/@griggheo/running-headless-selenium-webdriver-tests-in-docker-containers-342fdbabf756
ADD xvfb.init /etc/init.d/xvfb
RUN chmod +x /etc/init.d/xvfb
RUN update-rc.d xvfb defaults
CMD (service xvfb start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
......@@ -29,10 +29,8 @@ step "Install distro dependencies" \
step "Build minified" \
npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-min"
if [ -z "$SKIP_UNIT_TESTS" ]; then
step "Run unit tests" \
./scripts/test.sh --xvfb --build --reporter dot
fi
step "Run unit tests" \
./scripts/test.sh --build --reporter dot
step "Publish release" \
./build/tfs/linux/release.sh
\ No newline at end of file
#!/bin/bash
if [ ! -f pat ]; then
echo "Error: file pat not found"
exit 1
fi
docker run \
-e VSTS_ACCOUNT="monacotools" \
-e VSTS_TOKEN="$(cat pat)" \
-e VSTS_AGENT="tb-lnx-local" \
-e VSTS_POOL=linux \
-e VSTS_WORK="/var/vsts/work" \
--name "tb-lnx-local" \
-it joaomoreno/vscode-vso-agent
\ No newline at end of file
#!/bin/bash
#
# /etc/rc.d/init.d/xvfbd
#
# chkconfig: 345 95 28
# description: Starts/Stops X Virtual Framebuffer server
# processname: Xvfb
#
### BEGIN INIT INFO
# Provides: xvfb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start xvfb at boot time
# Description: Enable xvfb provided by daemon.
### END INIT INFO
[ "${NETWORKING}" = "no" ] && exit 0
PROG="/usr/bin/Xvfb"
PROG_OPTIONS=":10 -ac"
PROG_OUTPUT="/tmp/Xvfb.out"
case "$1" in
start)
echo "Starting : X Virtual Frame Buffer "
$PROG $PROG_OPTIONS>>$PROG_OUTPUT 2>&1 &
disown -ar
;;
stop)
echo "Shutting down : X Virtual Frame Buffer"
killproc $PROG
RETVAL=$?
[ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/Xvfb
/var/run/Xvfb.pid
echo
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
status)
status Xvfb
RETVAL=$?
;;
*)
echo $"Usage: $0 (start|stop|restart|reload|status)"
exit 1
esac
exit $RETVAL
\ No newline at end of file
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(realpath "$0")))
......@@ -27,10 +28,7 @@ test -d node_modules || ./scripts/npm.sh install
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
# Unit Tests
if [[ "$1" == "--xvfb" ]]; then
cd $ROOT ; \
xvfb-run -a "$CODE" test/electron/index.js "$@"
elif [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; \
"$CODE" \
test/electron/index.js "$@"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册