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:
@@ -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...');
|
||||
|
||||
Reference in New Issue
Block a user