add ci_test.bat file for windows testing (#7557)

this relies on jruby being installed locally with the same version as
the one contained in the .ruby-version file at the root of the project

The jruby must be installed in %JRUBYSRCDIR%\%JRUBYVERSION%
This commit is contained in:
João Duarte 2017-07-10 13:50:34 +01:00 committed by GitHub
parent c32db3b2f8
commit a797bf3721

41
ci/ci_test.bat Normal file
View file

@ -0,0 +1,41 @@
@echo off
setlocal
REM Since we are using the system jruby, we need to make sure our jvm process
REM uses at least 1g of memory, If we don't do this we can get OOM issues when
REM installing gems. See https://github.com/elastic/logstash/issues/5179
SET JRUBY_OPTS="-J-Xmx1g"
SET SELECTEDTESTSUITE=%1
SET /p JRUBYVERSION=<.ruby-version
IF NOT EXIST %JRUBYSRCDIR% (
echo "Variable JRUBYSRCDIR must be declared with a valid directory. Aborting.."
exit /B 1
)
SET JRUBYPATH=%JRUBYSRCDIR%\%JRUBYVERSION%
IF NOT EXIST %JRUBYPATH% (
echo "Could not find JRuby in %JRUBYPATH%. Aborting.."
exit /B 1
)
SET RAKEPATH=%JRUBYPATH%\bin\rake
IF "%SELECTEDTESTSUITE%"=="core-fail-fast" (
echo "Running core-fail-fast tests"
%RAKEPATH% test:install-core
%RAKEPATH% test:core-fail-fast
) ELSE (
IF "%SELECTEDTESTSUITE%"=="all" (
echo "Running all plugins tests"
%RAKEPATH% test:install-all
%RAKEPATH% test:plugins
) ELSE (
echo "Running core tests"
%RAKEPATH% test:install-core
%RAKEPATH% test:core
)
)