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
|
||||
APP_ROOT=$(agent.builddirectory)/azuredatastudio-linux-x64
|
||||
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 }}
|
||||
displayName: 'Run ${{ extension }} Stable Extension Unit Tests'
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
@@ -148,6 +149,14 @@ steps:
|
||||
continueOnError: 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: |
|
||||
set -e
|
||||
yarn gulp vscode-linux-x64-build-deb
|
||||
|
||||
@@ -117,8 +117,10 @@ if "%RUN_DBPROJECT_TESTS%" == "true" (
|
||||
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
rmdir /s /q %VSCODEUSERDATADIR%
|
||||
rmdir /s /q %VSCODEEXTENSIONSDIR%
|
||||
if "%NO_CLEANUP%"=="" (
|
||||
rmdir /s /q %VSCODEUSERDATADIR%
|
||||
rmdir /s /q %VSCODEEXTENSIONSDIR%
|
||||
)
|
||||
|
||||
popd
|
||||
|
||||
|
||||
@@ -33,14 +33,6 @@ let argv = require('yargs')
|
||||
.default('extensions', extensionList)
|
||||
.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) {
|
||||
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.');
|
||||
@@ -67,6 +59,14 @@ for (const ext of argv.extensions) {
|
||||
console.log(`*** starting ${ext} tests ***`);
|
||||
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`;
|
||||
console.log(`Command used: ${command}`);
|
||||
console.log(execSync(command, { stdio: 'inherit' }));
|
||||
@@ -74,5 +74,7 @@ for (const ext of argv.extensions) {
|
||||
|
||||
// clean up
|
||||
|
||||
fs.remove(VSCODEUSERDATADIR, { recursive: true }).catch(console.error);
|
||||
fs.remove(VSCODEEXTENSIONSDIR, { recursive: true }).catch(console.error);
|
||||
if (!process.env.NO_CLEANUP) {
|
||||
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
|
||||
fi
|
||||
|
||||
rm -r $VSCODEUSERDATADIR
|
||||
rm -r $VSCODEEXTDIR
|
||||
if [[ "$NO_CLEANUP" == "" ]]; then
|
||||
rm -r $VSCODEUSERDATADIR
|
||||
rm -r $VSCODEEXTDIR
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user