Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Creates winodws test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
justin taft committed Oct 18, 2015
1 parent 3941713 commit 26d385a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
12 changes: 10 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ cache:
- '%CYG_CACHE%'

init:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
- 'echo Setting up Cygwin dependencies'
- '%CYG_ROOT%\setup-x86.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl -P unzip -P psmisc> NUL'


#DEBUG BEGIN
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- ps: throw "Failing tests"
#DBEUG END

- 'echo Check Cygwin setup'
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
- 'echo Done setting up Cygwin'
Expand All @@ -33,6 +38,8 @@ install:
- cmd: 'echo %PATH%'




build_script:
- cmd: 'echo Cygwin root is: %CYG_ROOT%'
- cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
Expand All @@ -46,12 +53,13 @@ build_script:
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; cat lein.sh"'
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ln -s /cygdrive/c/projects/lighttable/lein.sh lein; ls -la"'



- cmd: 'echo Running build.sh'
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./script/build.sh"'
- cmd: 'echo Runnig tests'
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./script/run-tests.sh"'

- cmd: 'echo run-tests.sh finished'
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ls /tmp/"'
- ps: throw "Failing tests"

2 changes: 2 additions & 0 deletions script/light-test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set LTPATH=%~dp0\..
c:\cygwin\bin\bash.exe -lc "cd '`cygpath -u $LTPATH`; ./script/light-test.sh"
1 change: 1 addition & 0 deletions script/light-test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

#!/bin/sh
./script/light.sh &> /tmp/lt-debug
8 changes: 8 additions & 0 deletions script/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ echo "Killing all chromedrivers & starting new instance".
killall "chromedriver"
chmod u+x $CHROMEDRIVER_PATH
$CHROMEDRIVER_PATH&
CHROME_PID = $!

echo "Running tests"
lein test
Expand All @@ -36,10 +37,17 @@ RETURN_CODE=$?
echo "===LIGHT TABLE DEBUG==="
cat /tmp/lt-debug


echo "Killing chrome"
kill $CHROME_PID


echo "Killing java"
taskkill /F /IM java.exe
echo "Killing bash.exe"
killall bash.exe
echo "Killing bash"
killall -9 bash
echo "Bash killed"


3 changes: 1 addition & 2 deletions test/lt/system_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@

(defn lt-fixture [func]
(lt-webdriver-helper/connect-to-light-table!)
(func)
(lt-webdriver-helper/teardown!))
(func))

(use-fixtures :each myfixture)

Expand Down
15 changes: 8 additions & 7 deletions test/lt/webdriver_helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
(defn get-project-directory []
(System/getProperty "user.dir"))

;TODO make path os independent
(defn get-lt-launch-script-location []
(str (get-project-directory) "/script/light-test.sh"))

(defn get-lt-test-launch-script-location [os-name]
"Returns script that launches light table for tests."
(str (get-project-directory) "/script/light-test"
(if (re-matches #"^(?i)windows" os-name)
".bat"
".sh")))

(defn start-lighttable-async []
(-> (Thread. (fn[]
(log (str "Starting lt at " (get-lt-launch-script-location)))
(Thread/sleep 5000)
(shell/sh "c:/cygwin/bin/bash" "-lc" "\"cd $APPVEYOR_BUILD_FOLDER; ./script/light-test.sh\"")
;(shell/sh "/bin/bash" (get-lt-launch-script-location))
))
(shell/sh get-lt-test-launch-script-location (System/getProperty "os.name")))
(.start)))

(defn connect-to-light-table! []
Expand Down

0 comments on commit 26d385a

Please sign in to comment.