Skip to content

Commit

Permalink
Fix tests for some changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Dec 1, 2021
1 parent 3d55049 commit 68143e8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e-versions.yml
Expand Up @@ -14,7 +14,6 @@ on:
workflow_dispatch:
jobs:
setup-java-major-versions:
if: ${{ matrix.distribution != 'microsoft' || matrix.version != '8' }}
name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -23,6 +22,9 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft' ] # internally 'adopt-hotspot' is the same as 'adopt'
version: ['8', '11', '16']
exclude:
- distribution: microsoft
version: 8
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -59,7 +59,7 @@ Currently, the following distributions are supported:
| `adopt` or `adopt-hotspot` | Adopt OpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `adopt-openj9` | Adopt OpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
| `microsoft` | Microsoft OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)

**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.

Expand Down
2 changes: 1 addition & 1 deletion __tests__/distributors/microsoft-installer.test.ts
Expand Up @@ -53,7 +53,7 @@ describe('findPackageForDownload', () => {

it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
/Could not find satisfied version for semver */
/Could not find satisfied version for SemVer */
);
});
});
Expand Down
10 changes: 5 additions & 5 deletions src/distributions/microsoft/installer.ts
Expand Up @@ -48,7 +48,7 @@ export class MicrosoftDistributions extends JavaBase {

const opts = this.getPlatformOption();
const availableVersions = availableVersionsRaw.map(item => ({
url: `https://aka.ms/download-jdk/microsoft-jdk-${item.fullVersion}-${opts.os}-${this.architecture}.${opts.archive}`,
url: `https://aka.ms/download-jdk/microsoft-jdk-${item.fullVersion.join('.')}-${opts.os}-${this.architecture}.${opts.archive}`,
version: this.convertVersionToSemver(item)
}));

Expand Down Expand Up @@ -78,14 +78,14 @@ export class MicrosoftDistributions extends JavaBase {
majorVersion: 17,
minorVersion: 0,
patchVersion: 1,
fullVersion: '17.0.1.12.1'
fullVersion: [17,0,1,12,1],
},
{
majorVersion: 16,
minorVersion: 0,
patchVersion: 2,
fullVersion: '16.0.2.7.1'
}
fullVersion: [16,0,2.7,1],
},
];

// M1 is only supported for Java 16 & 17
Expand All @@ -94,7 +94,7 @@ export class MicrosoftDistributions extends JavaBase {
majorVersion: 11,
minorVersion: 0,
patchVersion: 13,
fullVersion: '11.0.13.8.1'
fullVersion: [11, 0, 13, 8, 1],
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/distributions/microsoft/models.ts
Expand Up @@ -11,5 +11,5 @@ export interface MicrosoftVersion {
majorVersion: number;
minorVersion: number;
patchVersion: number;
fullVersion: string;
fullVersion: Array<number>;
}

0 comments on commit 68143e8

Please sign in to comment.