mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Fix test script overwriting grep option (#8209)
* Fix test script overwriting grep option * Better logic and fix unstable scripts too
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set ADS_TEST_GREP=@UNSTABLE@
|
||||
@@ -5,6 +6,6 @@ set ADS_TEST_INVERT_GREP=
|
||||
|
||||
echo Running UNSTABLE ADS Core Tests
|
||||
|
||||
call %~dp0\test.bat
|
||||
call %~dp0\test.bat %*
|
||||
|
||||
endlocal
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
PASSED_ARGS="$@"
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
ROOT=$(dirname $(dirname $(realpath "$0")))
|
||||
@@ -15,4 +17,4 @@ export ADS_TEST_INVERT_GREP=
|
||||
|
||||
echo Running UNSTABLE ADS Core Tests
|
||||
|
||||
./scripts/test.sh
|
||||
./scripts/test.sh $PASSED_ARGS
|
||||
|
||||
@@ -22,17 +22,9 @@ if "%ADS_TEST_GREP%" == "" (
|
||||
set ADS_TEST_INVERT_GREP=1
|
||||
)
|
||||
|
||||
set CODE_ARGS=--grep %ADS_TEST_GREP%
|
||||
|
||||
if "%ADS_TEST_INVERT_GREP%" == "1" (
|
||||
set CODE_ARGS=%CODE_ARGS% --invert
|
||||
) else if "%ADS_TEST_INVERT_GREP%" == "true" (
|
||||
set CODE_ARGS=%CODE_ARGS% --invert
|
||||
)
|
||||
|
||||
:: Run tests
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
%CODE% .\test\electron\index.js %CODE_ARGS% %*
|
||||
%CODE% .\test\electron\index.js %*
|
||||
|
||||
popd
|
||||
|
||||
|
||||
@@ -25,12 +25,6 @@ if [[ "$ADS_TEST_GREP" == "" ]]; then
|
||||
export ADS_TEST_INVERT_GREP=1
|
||||
fi
|
||||
|
||||
CODE_ARGS="--grep $ADS_TEST_GREP"
|
||||
|
||||
if [[ "$ADS_TEST_INVERT_GREP" == "1" ]] || [[ "$ADS_TEST_INVERT_GREP" == "true" ]]; then
|
||||
CODE_ARGS="$CODE_ARGS --invert"
|
||||
fi
|
||||
|
||||
# Node modules
|
||||
test -d node_modules || yarn
|
||||
|
||||
@@ -42,7 +36,7 @@ if [[ "$OSTYPE" == "darwin"* ]] || [[ "$AGENT_OS" == "Darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
"$CODE" \
|
||||
test/electron/index.js $CODE_ARGS $PASSED_ARGS
|
||||
test/electron/index.js $PASSED_ARGS
|
||||
else
|
||||
cd $ROOT ; \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
|
||||
@@ -29,6 +29,14 @@ const optimist = require('optimist')
|
||||
|
||||
const argv = optimist.argv;
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Set test run options. These are NOT used if grep is specified manually - that implies the user has a specific desire to
|
||||
// filter the tests beyond the defaults set for ADS_TEST_GREP in the calling scripts.
|
||||
if (!argv.grep) {
|
||||
argv.grep = process.env['ADS_TEST_GREP'];
|
||||
argv.invert = Boolean(process.env['ADS_TEST_INVERT_GREP']);
|
||||
}
|
||||
|
||||
if (argv.help) {
|
||||
optimist.showHelp();
|
||||
process.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user