Extension unit tests should continue on error (#21099)

* Extension unit tests continue on error

* Fix script syntax issue.

* Block syntax issue

* Remove condition expression

* Brings back condition for sql product build linux yml

* Comment out condition in ci.yml

* Adds continue on error clause to ci.yml extension unit tests

* Adds condition to extension unit tests step in ci.yml

* Adds run extension unit test case for fail on error

* Adds fail on error case to Run Extension Unit Tests script

* Explicitly states continue on error false.

* Format adjustment to yml file

* Changes default state to fail on error

* Update .github/workflows/ci.yml

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Update build/azure-pipelines/linux/sql-product-build-linux.yml

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Update build/azure-pipelines/linux/sql-product-build-linux.yml

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Brings back original comment.

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Lewis Sanchez
2022-11-04 21:11:14 -07:00
committed by GitHub
parent facd317b4d
commit a864993e60
2 changed files with 26 additions and 4 deletions

View File

@@ -147,8 +147,23 @@ steps:
NO_CLEANUP=1 \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-linux-x64" \
DISPLAY=:10 ./scripts/test-extensions-unit.sh --build --tfs "Extension Unit Tests"
displayName: 'Run Extension Unit Tests'
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
displayName: Run Extension Unit Tests (Continue on Error)
continueOnError: true
condition: and(succeeded(), and(eq(variables['RUN_TESTS'], 'true'), eq(variables['EXTENSION_UNIT_TESTS_FAIL_ON_ERROR'], 'false')))
- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the unit tests
# to run with these builds instead of running out of sources.
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" \
NO_CLEANUP=1 \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-linux-x64" \
DISPLAY=:10 ./scripts/test-extensions-unit.sh --build --tfs "Extension Unit Tests"
displayName: Run Extension Unit Tests (Fail on Error)
condition: and(succeeded(), and(eq(variables['RUN_TESTS'], 'true'), ne(variables['EXTENSION_UNIT_TESTS_FAIL_ON_ERROR'], 'false')))
- bash: |
set -e