From 4e56c31b28053b7081e102121153633227d6dd8e Mon Sep 17 00:00:00 2001 From: Gregory Mitchell Date: Mon, 11 Nov 2024 14:06:05 +0000 Subject: [PATCH] Fix JetBrains Tests, Issues in `e2e-versions.yml` --- .github/workflows/e2e-versions.yml | 14 ++++++-------- __tests__/distributors/jetbrains-installer.test.ts | 9 +++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e-versions.yml b/.github/workflows/e2e-versions.yml index bbbc1f0..b93b983 100644 --- a/.github/workflows/e2e-versions.yml +++ b/.github/workflows/e2e-versions.yml @@ -157,6 +157,8 @@ jobs: distribution: ${{ matrix.distribution }} java-version: 11 check-latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Verify Java run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}" shell: bash @@ -192,6 +194,8 @@ jobs: java-version: | 11 17 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Verify Java env variables run: | $versionsArr = "11","17" @@ -332,10 +336,6 @@ jobs: java-package: jre+jcef version: '21' os: ubuntu-latest - - distribution: 'jetbrains' - java-package: jdk+ft - version: '11' - os: ubuntu-latest - distribution: 'jetbrains' java-package: jdk+ft version: '17' @@ -344,10 +344,6 @@ jobs: java-package: jdk+ft version: '21' os: ubuntu-latest - - distribution: 'jetbrains' - java-package: jre+ft - version: '11' - os: ubuntu-latest - distribution: 'jetbrains' java-package: jre+ft version: '17' @@ -367,6 +363,8 @@ jobs: java-version: ${{ matrix.version }} java-package: ${{ matrix.java-package }} distribution: ${{ matrix.distribution }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Verify Java run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" shell: bash diff --git a/__tests__/distributors/jetbrains-installer.test.ts b/__tests__/distributors/jetbrains-installer.test.ts index 27b46ab..f0ca18b 100644 --- a/__tests__/distributors/jetbrains-installer.test.ts +++ b/__tests__/distributors/jetbrains-installer.test.ts @@ -3,7 +3,7 @@ import {HttpClient} from '@actions/http-client'; import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer'; import manifestData from '../data/jetbrains.json'; -import {fstat, writeFileSync} from 'fs'; +import os from 'os'; describe('getAvailableVersions', () => { let spyHttpClient: jest.SpyInstance; @@ -50,7 +50,12 @@ describe('getAvailableVersions', () => { }); const availableVersions = await distribution['getAvailableVersions'](); expect(availableVersions).not.toBeNull(); - expect(availableVersions.length).toBe(manifestData.length * 2); + + const length = + os.platform() === 'win32' + ? manifestData.length * 2 - 4 + : manifestData.length * 2; + expect(availableVersions.length).toBe(length); }, 10_000); });