Debug cache extract

pull/310/head
Frostebite 2022-01-13 22:08:44 +00:00
parent b5ef5b6cf2
commit bc58fb2ef4
3 changed files with 7 additions and 5 deletions

5
dist/index.js vendored
View File

@ -608,6 +608,7 @@ class Caching {
const cacheSelection = cacheKey !== `` && fs_1.default.existsSync(`${cacheKey}.zip`) ? cacheKey : latestInBranch; const cacheSelection = cacheKey !== `` && fs_1.default.existsSync(`${cacheKey}.zip`) ? cacheKey : latestInBranch;
yield cloud_runner_logger_1.default.log(`cache key ${cacheKey} selection ${cacheSelection}`); yield cloud_runner_logger_1.default.log(`cache key ${cacheKey} selection ${cacheSelection}`);
if (fs_1.default.existsSync(`${cacheSelection}.zip`)) { if (fs_1.default.existsSync(`${cacheSelection}.zip`)) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p results`);
if (__1.Input.cloudRunnerTests) { if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${destinationFolder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${destinationFolder}`);
} }
@ -618,13 +619,13 @@ class Caching {
if (__1.Input.cloudRunnerTests) { if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${cacheFolder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${cacheFolder}`);
} }
yield extract_zip_1.default(`${cacheSelection}.zip`, { dir: process.cwd() }); yield extract_zip_1.default(`${cacheSelection}.zip`, { dir: `results` });
if (__1.Input.cloudRunnerTests) { if (__1.Input.cloudRunnerTests) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${fullDestination}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${fullDestination}`);
} }
remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
console_1.assert(`${fs_1.default.existsSync(fullDestination)}`); console_1.assert(`${fs_1.default.existsSync(fullDestination)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv "${fullDestination}" "${destinationFolder}"`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv "results" "${destinationFolder}"`);
} }
else { else {
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -93,6 +93,7 @@ export class Caching {
await CloudRunnerLogger.log(`cache key ${cacheKey} selection ${cacheSelection}`); await CloudRunnerLogger.log(`cache key ${cacheKey} selection ${cacheSelection}`);
if (fs.existsSync(`${cacheSelection}.zip`)) { if (fs.existsSync(`${cacheSelection}.zip`)) {
await CloudRunnerSystem.Run(`mkdir -p results`);
if (Input.cloudRunnerTests) { if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`tree ${destinationFolder}`); await CloudRunnerSystem.Run(`tree ${destinationFolder}`);
} }
@ -103,13 +104,13 @@ export class Caching {
if (Input.cloudRunnerTests) { if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`tree ${cacheFolder}`); await CloudRunnerSystem.Run(`tree ${cacheFolder}`);
} }
await extract(`${cacheSelection}.zip`, { dir: process.cwd() }); await extract(`${cacheSelection}.zip`, { dir: `results` });
if (Input.cloudRunnerTests) { if (Input.cloudRunnerTests) {
await CloudRunnerSystem.Run(`tree ${fullDestination}`); await CloudRunnerSystem.Run(`tree ${fullDestination}`);
} }
RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
assert(`${fs.existsSync(fullDestination)}`); assert(`${fs.existsSync(fullDestination)}`);
await CloudRunnerSystem.Run(`mv "${fullDestination}" "${destinationFolder}"`); await CloudRunnerSystem.Run(`mv "results" "${destinationFolder}"`);
} else { } else {
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
if (cacheSelection !== ``) { if (cacheSelection !== ``) {