mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Upload user dir from test runs (#13326)
* Add archive logs step to linux build * right file * try * try this * correct order * build artifact * export * log * use tmp * zip up all * Remove extra publish * other scripts * add test name to dir
This commit is contained in:
@@ -133,7 +133,8 @@ steps:
|
|||||||
set -e
|
set -e
|
||||||
APP_ROOT=$(agent.builddirectory)/azuredatastudio-linux-x64
|
APP_ROOT=$(agent.builddirectory)/azuredatastudio-linux-x64
|
||||||
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
|
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
|
||||||
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
|
export INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
|
||||||
|
export NO_CLEANUP=1
|
||||||
DISPLAY=:10 node ./scripts/test-extensions-unit.js ${{ extension }}
|
DISPLAY=:10 node ./scripts/test-extensions-unit.js ${{ extension }}
|
||||||
displayName: 'Run ${{ extension }} Stable Extension Unit Tests'
|
displayName: 'Run ${{ extension }} Stable Extension Unit Tests'
|
||||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||||
@@ -148,6 +149,14 @@ steps:
|
|||||||
continueOnError: true
|
continueOnError: true
|
||||||
condition: and(succeeded(), eq(variables['RUN_UNSTABLE_TESTS'], 'true'))
|
condition: and(succeeded(), eq(variables['RUN_UNSTABLE_TESTS'], 'true'))
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
mkdir -p $(Build.ArtifactStagingDirectory)/logs/linux-x64
|
||||||
|
cd /tmp
|
||||||
|
tar -czvf $(Build.ArtifactStagingDirectory)/logs/linux-x64/logs-linux-x64.tar.gz adsuser*
|
||||||
|
displayName: Archive Logs
|
||||||
|
continueOnError: true
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
yarn gulp vscode-linux-x64-build-deb
|
yarn gulp vscode-linux-x64-build-deb
|
||||||
|
|||||||
@@ -117,8 +117,10 @@ if "%RUN_DBPROJECT_TESTS%" == "true" (
|
|||||||
|
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
rmdir /s /q %VSCODEUSERDATADIR%
|
if "%NO_CLEANUP%"=="" (
|
||||||
rmdir /s /q %VSCODEEXTENSIONSDIR%
|
rmdir /s /q %VSCODEUSERDATADIR%
|
||||||
|
rmdir /s /q %VSCODEEXTENSIONSDIR%
|
||||||
|
)
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,6 @@ let argv = require('yargs')
|
|||||||
.default('extensions', extensionList)
|
.default('extensions', extensionList)
|
||||||
.strict().help().wrap(null).version(false).argv;
|
.strict().help().wrap(null).version(false).argv;
|
||||||
|
|
||||||
// set up environment
|
|
||||||
|
|
||||||
const VSCODEUSERDATADIR = tmp.dirSync({ prefix: 'adsuser' }).name;
|
|
||||||
const VSCODEEXTENSIONSDIR = tmp.dirSync({ prefix: 'adsext' }).name;
|
|
||||||
|
|
||||||
console.log(VSCODEUSERDATADIR);
|
|
||||||
console.log(VSCODEEXTENSIONSDIR);
|
|
||||||
|
|
||||||
if (!process.env.INTEGRATION_TEST_ELECTRON_PATH) {
|
if (!process.env.INTEGRATION_TEST_ELECTRON_PATH) {
|
||||||
process.env.INTEGRATION_TEST_ELECTRON_PATH = path.join(__dirname, '..', 'scripts', os.platform() === 'win32' ? 'code.bat' : 'code.sh');
|
process.env.INTEGRATION_TEST_ELECTRON_PATH = path.join(__dirname, '..', 'scripts', os.platform() === 'win32' ? 'code.bat' : 'code.sh');
|
||||||
console.log('Running unit tests out of sources.');
|
console.log('Running unit tests out of sources.');
|
||||||
@@ -67,6 +59,14 @@ for (const ext of argv.extensions) {
|
|||||||
console.log(`*** starting ${ext} tests ***`);
|
console.log(`*** starting ${ext} tests ***`);
|
||||||
console.log('*'.repeat(ext.length + 23));
|
console.log('*'.repeat(ext.length + 23));
|
||||||
|
|
||||||
|
// set up environment
|
||||||
|
|
||||||
|
const VSCODEUSERDATADIR = tmp.dirSync({ prefix: `adsuser_${ext}` }).name;
|
||||||
|
const VSCODEEXTENSIONSDIR = tmp.dirSync({ prefix: `adsext_${ext}` }).name;
|
||||||
|
|
||||||
|
console.log(`VSCODEUSERDATADIR : ${VSCODEUSERDATADIR}`);
|
||||||
|
console.log(`VSCODEEXTENSIONSDIR : ${VSCODEEXTENSIONSDIR}`);
|
||||||
|
|
||||||
const command = `${process.env.INTEGRATION_TEST_ELECTRON_PATH} --no-sandbox --extensionDevelopmentPath=${path.join(__dirname, '..', 'extensions', ext)} --extensionTestsPath=${path.join(__dirname, '..', 'extensions', ext, 'out', 'test')} --user-data-dir=${VSCODEUSERDATADIR} --extensions-dir=${VSCODEEXTENSIONSDIR} --remote-debugging-port=9222 --disable-telemetry --disable-crash-reporter --disable-updates --nogpu`;
|
const command = `${process.env.INTEGRATION_TEST_ELECTRON_PATH} --no-sandbox --extensionDevelopmentPath=${path.join(__dirname, '..', 'extensions', ext)} --extensionTestsPath=${path.join(__dirname, '..', 'extensions', ext, 'out', 'test')} --user-data-dir=${VSCODEUSERDATADIR} --extensions-dir=${VSCODEEXTENSIONSDIR} --remote-debugging-port=9222 --disable-telemetry --disable-crash-reporter --disable-updates --nogpu`;
|
||||||
console.log(`Command used: ${command}`);
|
console.log(`Command used: ${command}`);
|
||||||
console.log(execSync(command, { stdio: 'inherit' }));
|
console.log(execSync(command, { stdio: 'inherit' }));
|
||||||
@@ -74,5 +74,7 @@ for (const ext of argv.extensions) {
|
|||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
|
|
||||||
fs.remove(VSCODEUSERDATADIR, { recursive: true }).catch(console.error);
|
if (!process.env.NO_CLEANUP) {
|
||||||
fs.remove(VSCODEEXTENSIONSDIR, { recursive: true }).catch(console.error);
|
fs.remove(VSCODEUSERDATADIR, { recursive: true }).catch(console.error);
|
||||||
|
fs.remove(VSCODEEXTENSIONSDIR, { recursive: true }).catch(console.error);
|
||||||
|
}
|
||||||
|
|||||||
@@ -111,5 +111,7 @@ if [[ "$RUN_DBPROJECT_TESTS" == "true" ]]; then
|
|||||||
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX --extensionDevelopmentPath=$ROOT/extensions/sql-database-projects --extensionTestsPath=$ROOT/extensions/sql-database-projects/out/test --user-data-dir=$VSCODEUSERDATADIR --extensions-dir=$VSCODEEXTDIR --disable-telemetry --disable-crash-reporter --disable-updates --nogpu
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX --extensionDevelopmentPath=$ROOT/extensions/sql-database-projects --extensionTestsPath=$ROOT/extensions/sql-database-projects/out/test --user-data-dir=$VSCODEUSERDATADIR --extensions-dir=$VSCODEEXTDIR --disable-telemetry --disable-crash-reporter --disable-updates --nogpu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -r $VSCODEUSERDATADIR
|
if [[ "$NO_CLEANUP" == "" ]]; then
|
||||||
rm -r $VSCODEEXTDIR
|
rm -r $VSCODEUSERDATADIR
|
||||||
|
rm -r $VSCODEEXTDIR
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user