Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/e2e-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ jobs:
- distribution: microsoft
os: macos-latest
version: 25
- distribution: microsoft
os: windows-latest
version: '25.0.5+0.2'
- distribution: microsoft
os: ubuntu-latest
version: '25.0.5+0.2'
- distribution: microsoft
os: macos-latest
version: '25.0.5+0.2'
- distribution: kona
os: windows-latest
version: 25
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ Additional distribution notes:

- Oracle OpenJDK builds are archived after a limited number of releases and no longer receive security updates. To continue receiving security patches, use Oracle JDK or another vendor.
- Azul Zulu maps `arm64` to `aarch64` when querying the Azul Metadata API.
- Microsoft Build of OpenJDK uses Microsoft's live version manifest, falling back to the bundled version list when no release matches. Version `25.0.5.0.2` can also be requested as `25.0.5+0.2`.
- GraalVM Community is available as `distribution: graalvm-community` for stable JDK 17 and later releases.
- On Ubuntu runners, commands executed with `sudo` do not inherit the `JAVA_HOME` and `PATH` set by `setup-java` and may fall back to the system-default JDK.

Expand Down
84 changes: 84 additions & 0 deletions __tests__/distributors/microsoft-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,90 @@ describe('findPackageForDownload', () => {
expect(result.signatureUrl).toBe(`${url}.sig`);
});

describe.each(['25.0.5.0.2', '25.0.5+0.2', '25.0.5'])(
'version %s missing from the live manifest',
version => {
it.each([
['darwin', 'x64', 'macos', 'tar.gz'],
['linux', 'x64', 'linux', 'tar.gz'],
['win32', 'x64', 'windows', 'zip'],
['darwin', 'aarch64', 'macos', 'tar.gz'],
['linux', 'aarch64', 'linux', 'tar.gz'],
['win32', 'aarch64', 'windows', 'zip']
])(
'resolves the bundled release for %s/%s',
async (platform, architecture, osType, extension) => {
mockOsPlatform.mockReturnValue(platform);
const distro = new MicrosoftDistributions({
version,
architecture,
packageType: 'jdk',
checkLatest: false
});

const result = await distro['findPackageForDownload'](
distro['version']
);
const url = `https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-${osType}-${architecture}.${extension}`;

expect(result).toEqual({
version: '25.0.5+0.2',
url,
signatureUrl: `${url}.sig`,
checksum: {
algorithm: 'sha256',
value: MICROSOFT_CHECKSUM,
source: `${url}.sha256sum.txt`
}
});
expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.sha256sum.txt`);
}
);
}
);

it('prefers the live manifest when it contains the requested release', async () => {
mockOsPlatform.mockReturnValue('linux');
const url =
'https://example.test/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz';
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '25.0.5+0.2',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: url
}
]
}
],
statusCode: 200,
headers: {}
});

const result = await distribution['findPackageForDownload']('25.0.5+0.2');

expect(result.version).toBe('25.0.5+0.2');
expect(result.url).toBe(url);
expect(spyGetManifestFromRepo).toHaveBeenCalledWith(
'https://aka.ms/download-jdk/microsoft-openjdk-versions.json',
{accept: 'application/json'}
);
});

it('preserves the error when the live manifest cannot be loaded', async () => {
spyGetManifestFromRepo.mockRejectedValue(new Error('Network error'));

await expect(
distribution['findPackageForDownload']('25.0.5+0.2')
).rejects.toThrow('Could not load manifest for Microsoft Build of OpenJDK');
});

it.each([
['amd64', 'x64'],
['arm64', 'aarch64']
Expand Down
Loading
Loading