E2E AutoTest #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E AutoTest | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| test_plan: | |
| description: "Test plan to run (leave empty for all)" | |
| required: false | |
| default: "" | |
| type: string | |
| jobs: | |
| e2e-test: | |
| runs-on: windows-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout javaext-autotest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: wenytang-ms/javaext-autotest | |
| path: javaext-autotest | |
| - name: Checkout vscode-java (test projects) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: redhat-developer/vscode-java | |
| path: vscode-java | |
| - name: Checkout eclipse.jdt.ls (Gradle test projects) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: eclipse-jdtls/eclipse.jdt.ls | |
| path: eclipse.jdt.ls | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Java 25 (for java25 test plans) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 25-ea | |
| - name: Create JDK 25 path for test plans | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Junction -Path "C:\Program Files\Java\jdk-25" -Target $env:JAVA_HOME | |
| - name: Setup Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Install autotest dependencies | |
| working-directory: javaext-autotest | |
| run: npm ci && npm run build | |
| - name: Run test plan(s) | |
| shell: pwsh | |
| working-directory: javaext-autotest | |
| run: | | |
| $plan = "${{ inputs.test_plan }}" | |
| if ($plan -and $plan -ne "") { | |
| Write-Host "Running: $plan" | |
| npx autotest run "test-plans/$plan" | |
| } else { | |
| Write-Host "Running all test plans..." | |
| $plans = Get-ChildItem test-plans -Filter "*.yaml" | | |
| Where-Object { $_.Name -ne "java-fresh-import.yaml" } | | |
| Sort-Object Name | |
| $failed = @() | |
| foreach ($p in $plans) { | |
| Write-Host "`n========== $($p.Name) ==========" | |
| npx autotest run "test-plans/$($p.Name)" | |
| if ($LASTEXITCODE -ne 0) { $failed += $p.Name } | |
| } | |
| Write-Host "`n========== Summary ==========" | |
| Write-Host "Total: $($plans.Count) Failed: $($failed.Count)" | |
| if ($failed.Count -gt 0) { | |
| Write-Host "Failed: $($failed -join ', ')" | |
| exit 1 | |
| } | |
| } | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-results | |
| path: javaext-autotest/test-results/ | |
| retention-days: 30 |