Skip to content

Commit 0913e9a

Browse files
salmanmkcaparnajyothi-yHarithaVattikuti
authored
Upgrade to node 24 (#888)
* Upgrade to node 24 Upgrading action to node 24 since new runner version. * fix tests * Fix tests and licences * format * format x2 * Upgrade Node.js version in workflow files to 24.x * check failure fix * check failures fix * Fix mock platform --------- Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com> Co-authored-by: Haritha <73516759+HarithaVattikuti@users.noreply.github.com>
1 parent e9343db commit 0913e9a

22 files changed

+98
-60
lines changed

.github/workflows/basic-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
name: Basic validation
1717
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
1818
with:
19-
node-version: '20.x'
19+
node-version: '24.x'

.github/workflows/check-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
name: Check dist/
1717
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
1818
with:
19-
node-version: '20.x'
19+
node-version: '24.x'

.github/workflows/e2e-cache-dependency-path.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: setup-java
3131
with:
3232
distribution: 'adopt'
33-
java-version: '11'
33+
java-version: '17'
3434
cache: gradle
3535
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
3636
- name: Create files to cache

.github/workflows/e2e-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: setup-java
3131
with:
3232
distribution: 'adopt'
33-
java-version: '11'
33+
java-version: '17'
3434
cache: gradle
3535
- name: Create files to cache
3636
# Need to avoid using Gradle daemon to stabilize the save process on Windows

.licenses/npm/@types/node.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/undici-types.dep.yml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__tests__/distributors/adopt-installer.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ describe('getAvailableVersions', () => {
191191
])(
192192
'defaults to os.arch(): %s mapped to distro arch: %s',
193193
async (osArch: string, distroArch: string) => {
194-
jest.spyOn(os, 'arch').mockReturnValue(osArch);
194+
jest
195+
.spyOn(os, 'arch')
196+
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
195197

196198
const installerOptions: JavaInstallerOptions = {
197199
version: '17',

__tests__/distributors/base-installer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ describe('setupJava', () => {
287287
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
288288
spyCoreSetOutput.mockImplementation(() => undefined);
289289

290-
jest.spyOn(os, 'arch').mockReturnValue('x86');
290+
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
291291
});
292292

293293
afterEach(() => {

__tests__/distributors/corretto-installer.test.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,28 +203,27 @@ describe('getAvailableVersions', () => {
203203
});
204204

205205
it.each([
206-
['arm64', 'aarch64'],
207-
['amd64', 'x64']
206+
['amd64', 'x64'],
207+
['arm64', 'aarch64']
208208
])(
209209
'defaults to os.arch(): %s mapped to distro arch: %s',
210210
async (osArch: string, distroArch: string) => {
211-
jest.spyOn(os, 'arch').mockReturnValue(osArch);
211+
jest
212+
.spyOn(os, 'arch')
213+
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
212214

213-
const version = '17';
214-
const installerOptions: JavaInstallerOptions = {
215-
version,
215+
const distribution = new CorrettoDistribution({
216+
version: '17',
216217
architecture: '', // to get default value
217218
packageType: 'jdk',
218219
checkLatest: false
219-
};
220-
221-
const distribution = new CorrettoDistribution(installerOptions);
220+
});
222221
mockPlatform(distribution, 'macos');
223222

224223
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
225224

226225
const availableVersion = await distribution['findPackageForDownload'](
227-
version
226+
'17'
228227
);
229228
expect(availableVersion).not.toBeNull();
230229
expect(availableVersion.url).toBe(expectedLink);

__tests__/distributors/graalvm-installer.test.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,31 +98,35 @@ describe('findPackageForDownload', () => {
9898
});
9999

100100
it.each([
101-
['amd64', 'x64'],
102-
['arm64', 'aarch64']
101+
['amd64', ['x64', 'amd64']],
102+
['arm64', ['aarch64', 'arm64']]
103103
])(
104104
'defaults to os.arch(): %s mapped to distro arch: %s',
105-
async (osArch: string, distroArch: string) => {
106-
jest.spyOn(os, 'arch').mockReturnValue(osArch);
107-
jest.spyOn(os, 'platform').mockReturnValue('linux');
105+
async (osArch: string, distroArchs: string[]) => {
106+
jest
107+
.spyOn(os, 'arch')
108+
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
108109

109-
const version = '21';
110-
const distro = new GraalVMDistribution({
111-
version,
110+
const distribution = new GraalVMDistribution({
111+
version: '21',
112112
architecture: '', // to get default value
113113
packageType: 'jdk',
114114
checkLatest: false
115115
});
116116

117117
const osType = distribution.getPlatform();
118-
if (osType === 'windows' && distroArch == 'aarch64') {
118+
if (osType === 'windows' && distroArchs.includes('aarch64')) {
119119
return; // skip, aarch64 is not available for Windows
120120
}
121121
const archiveType = getDownloadArchiveExtension();
122-
const result = await distro['findPackageForDownload'](version);
123-
const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
122+
const result = await distribution['findPackageForDownload']('21');
124123

125-
expect(result.url).toBe(expectedUrl);
124+
const expectedUrls = distroArchs.map(
125+
distroArch =>
126+
`https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`
127+
);
128+
129+
expect(expectedUrls).toContain(result.url);
126130
}
127131
);
128132

0 commit comments

Comments
 (0)