5
0
mirror of https://gitea.com/actions/setup-java.git synced 2026-08-05 02:31:18 +00:00

Fix JDK cache CI validation

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-08-04 19:44:02 -04:00
parent b16465116b
commit c4ba924625
5 changed files with 28 additions and 9 deletions
@@ -493,6 +493,11 @@ describe('setupJava', () => {
});
it('restores the exact resolved JDK before downloading', async () => {
const toolCachePath = path.join('toolcache');
jest.replaceProperty(process, 'env', {
...process.env,
RUNNER_TOOL_CACHE: toolCachePath
});
mockJavaBase = new EmptyJavaBase({
version: '11',
architecture: 'x86',
@@ -517,7 +522,7 @@ describe('setupJava', () => {
architecture: 'x86',
version: actualJavaVersion,
source: `some/random_url/java/${actualJavaVersion}`,
path: path.join('Java_Empty_jdk', actualJavaVersion)
path: path.join(toolCachePath, 'Java_Empty_jdk', actualJavaVersion)
});
expect(downloadTool).not.toHaveBeenCalled();
expect(spyCoreInfo).not.toHaveBeenCalledWith('Trying to download...');