Skip to content

Commit

Permalink
test: update vsc tester version
Browse files Browse the repository at this point in the history
  • Loading branch information
ayachensiyuan committed Apr 19, 2024
1 parent 6d34c80 commit c792581
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 40 deletions.
70 changes: 31 additions & 39 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ permissions:
jobs:
setup:
runs-on: ubuntu-latest
environment: engineering
permissions:
id-token: write
contents: read
env:
ADO_TOKEN: ${{ secrets.ADO_PAT }}
AUTO_TEST_PLAN_ID: ${{ github.event.inputs.source-testplan-id }}
TARGET_TEST_PLAN_NAME: ${{ github.event.inputs.target-testplan-name }}
DEVTUNNEL_CLIENT_ID: ${{ secrets.TEST_CLEAN_CLIENT_ID }}
Expand All @@ -72,6 +75,12 @@ jobs:
- name: Init GitHub CLI
run: |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
- uses: azure/login@v1
with:
client-id: ${{secrets.DEVOPS_CLIENT_ID}}
tenant-id: ${{secrets.DEVOPS_TENANT_ID}}
subscription-id: ${{secrets.DEVOPS_SUB_ID}}

- name: bvt (dispatch)
id: bvt
Expand Down Expand Up @@ -189,9 +198,12 @@ jobs:
main:
name: ${{ matrix.test-case }}|${{ matrix.os }}|node ${{ matrix.node-version }}|${{ github.ref_name }}
needs: setup
environment: engineering
permissions:
id-token: write
contents: read
timeout-minutes: 50
env:
ADO_TOKEN: ${{ secrets.ADO_PAT }}
CI_ENABLED: true
NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}
TARGET_CLI_VERSION: ${{ needs.setup.outputs.target_cli_version }}
Expand Down Expand Up @@ -226,6 +238,12 @@ jobs:
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: azure/login@v1
with:
client-id: ${{secrets.DEVOPS_CLIENT_ID}}
tenant-id: ${{secrets.DEVOPS_TENANT_ID}}
subscription-id: ${{secrets.DEVOPS_SUB_ID}}

- name: Set m365 account (unix)
if: matrix.os != 'windows-latest'
run: |
Expand Down Expand Up @@ -382,69 +400,43 @@ jobs:
ref: main
path: ./packages/tests/resource

- name: Get VSCode
- name: Get VSCode & chromedriver
working-directory: packages/tests
run: |
npx extest get-vscode --storage .test-resources --type stable --code_version 1.88.1
- name: Get chromedriver(mac)
if: matrix.os == 'macos-latest'
working-directory: packages/tests/.test-resources
run: |
URL="https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/mac-x64/chromedriver-mac-x64.zip"
OUTPUT_FILE="chromedriver_mac64.zip"
curl -o "$OUTPUT_FILE" "$URL"
- name: Get chromedriver(unix)
if: matrix.os == 'ubuntu-latest'
working-directory: packages/tests/.test-resources
run: |
URL="https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/linux64/chromedriver-linux64.zip"
OUTPUT_FILE="chromedriver_linux64.zip"
curl -o "$OUTPUT_FILE" "$URL"
- name: Get chromedriver(win)
if: matrix.os == 'windows-latest'
working-directory: packages/tests/.test-resources
run: |
$url = "https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/win32/chromedriver-win32.zip"
$outputFile = "chromedriver_win32.zip"
Invoke-WebRequest -Uri $url -OutFile $outputFile
npx extest get-vscode --storage .test-resources --type stable --code_version .1.88.1
npx extest get-chromedriver --storage .test-resources --type stable --code_version .1.88.1
- name: Extract VSCode & chromedriver(unix)
if: matrix.os == 'ubuntu-latest'
working-directory: packages/tests
run: |
7z x ".test-resources/chromedriver_linux64.zip" -o".test-resources" -y
tar xzvf ".test-resources/stable.tar.gz" --directory ".test-resources"
cd .test-resources/chromedriver-linux64
ls
mv chromedriver ../chromedriver
- name: Extract VSCode & chromedriver(mac)
if: matrix.os == 'macos-latest'
working-directory: packages/tests
run: |
7z x ".test-resources/chromedriver_mac64.zip" -o".test-resources" -y
cd .test-resources/chromedriver-mac-x64
ls
mv chromedriver ../chromedriver
- name: Extract VSCode & chromedriver(win)
if: matrix.os == 'windows-latest'
working-directory: packages/tests
run: |
7z x ".test-resources/chromedriver_win32.zip" -o".test-resources" -y
7z x ".test-resources/stable.zip" -o".test-resources/VSCode-win32-x64-archive" -y
cd .test-resources/chromedriver-win32
ls
Move-Item chromedriver.exe ..\chromedriver.exe
- name: M365 Login
working-directory: packages/tests
run: | # rm -r -f ~/.fx/account
npx ts-node src/scripts/m365Login.ts -- '${{ env.M365_ACCOUNT_NAME }}' '${{ env.M365_ACCOUNT_PASSWORD }}'
- name: Azure Login(win)
if: matrix.os == 'windows-latest'
working-directory: packages/tests
run: |
npx ts-node src/scripts/azureLogin.ts -- '${{ env.AZURE_ACCOUNT_NAME }}' '${{ env.AZURE_ACCOUNT_PASSWORD }}'
- name: Build
working-directory: packages/tests
run: |
Expand All @@ -471,13 +463,13 @@ jobs:
sudo apt-get install xvfb
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x16 &
npx extest run-tests --storage .test-resources --extensions_dir .test-resources --type stable --code_version 1.88.1 --code_settings ./settings.json ./out/ui-test/**/${{ matrix.test-case }}.test.js
npx extest run-tests --storage .test-resources --extensions_dir .test-resources --type stable --code_version .1.88.1 --code_settings ./settings.json ./out/ui-test/**/${{ matrix.test-case }}.test.js
- name: Run UI Test(mac & win)
if: matrix.os != 'ubuntu-latest'
working-directory: packages/tests
run: |
npx extest run-tests --storage .test-resources --extensions_dir .test-resources --type stable --code_version 1.88.1 --code_settings ./settings.json ./out/ui-test/**/${{ matrix.test-case }}.test.js
npx extest run-tests --storage .test-resources --extensions_dir .test-resources --type stable --code_version .1.88.1 --code_settings ./settings.json ./out/ui-test/**/${{ matrix.test-case }}.test.js
- name: Upload test result json file
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"tslib": "^2.3.1",
"typescript": "^5.0.4",
"uuid": "^8.3.2",
"vscode-extension-tester": "^5.9.1"
"vscode-extension-tester": "^8.0.2"
},
"dependencies": {
"@azure/arm-apimanagement": "^8.0.0",
Expand Down

0 comments on commit c792581

Please sign in to comment.