mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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
|
setlocal
|
||||||
|
|
||||||
set ADS_TEST_GREP=@UNSTABLE@
|
set ADS_TEST_GREP=@UNSTABLE@
|
||||||
@@ -5,6 +6,6 @@ set ADS_TEST_INVERT_GREP=
|
|||||||
|
|
||||||
echo Running UNSTABLE ADS Core Tests
|
echo Running UNSTABLE ADS Core Tests
|
||||||
|
|
||||||
call %~dp0\test.bat
|
call %~dp0\test.bat %*
|
||||||
|
|
||||||
endlocal
|
endlocal
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
PASSED_ARGS="$@"
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||||
ROOT=$(dirname $(dirname $(realpath "$0")))
|
ROOT=$(dirname $(dirname $(realpath "$0")))
|
||||||
@@ -15,4 +17,4 @@ export ADS_TEST_INVERT_GREP=
|
|||||||
|
|
||||||
echo Running UNSTABLE ADS Core Tests
|
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 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
|
:: Run tests
|
||||||
set ELECTRON_ENABLE_LOGGING=1
|
set ELECTRON_ENABLE_LOGGING=1
|
||||||
%CODE% .\test\electron\index.js %CODE_ARGS% %*
|
%CODE% .\test\electron\index.js %*
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,6 @@ if [[ "$ADS_TEST_GREP" == "" ]]; then
|
|||||||
export ADS_TEST_INVERT_GREP=1
|
export ADS_TEST_INVERT_GREP=1
|
||||||
fi
|
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
|
# Node modules
|
||||||
test -d node_modules || yarn
|
test -d node_modules || yarn
|
||||||
|
|
||||||
@@ -42,7 +36,7 @@ if [[ "$OSTYPE" == "darwin"* ]] || [[ "$AGENT_OS" == "Darwin"* ]]; then
|
|||||||
cd $ROOT ; ulimit -n 4096 ; \
|
cd $ROOT ; ulimit -n 4096 ; \
|
||||||
ELECTRON_ENABLE_LOGGING=1 \
|
ELECTRON_ENABLE_LOGGING=1 \
|
||||||
"$CODE" \
|
"$CODE" \
|
||||||
test/electron/index.js $CODE_ARGS $PASSED_ARGS
|
test/electron/index.js $PASSED_ARGS
|
||||||
else
|
else
|
||||||
cd $ROOT ; \
|
cd $ROOT ; \
|
||||||
ELECTRON_ENABLE_LOGGING=1 \
|
ELECTRON_ENABLE_LOGGING=1 \
|
||||||
|
|||||||
@@ -29,6 +29,14 @@ const optimist = require('optimist')
|
|||||||
|
|
||||||
const argv = optimist.argv;
|
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) {
|
if (argv.help) {
|
||||||
optimist.showHelp();
|
optimist.showHelp();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user