check missing log file

pull/531/head
Frostebite 2023-08-18 01:58:53 +01:00
parent 2b1e4cb7fd
commit 499ad8784a
4 changed files with 15 additions and 2 deletions

5
dist/index.js generated vendored
View File

@ -4622,6 +4622,11 @@ class RemoteClientLogger {
return;
}
cloud_runner_logger_1.default.log(`Collected Logs`);
// check for log file not existing
if (!node_fs_1.default.existsSync(RemoteClientLogger.LogFilePath)) {
cloud_runner_logger_1.default.log(`Log file does not exist`);
return;
}
let hashedLogs = node_fs_1.default.readFileSync(RemoteClientLogger.LogFilePath).toString();
const directory = process.cwd();
process.chdir('/home');

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,14 @@ export class RemoteClientLogger {
return;
}
CloudRunnerLogger.log(`Collected Logs`);
// check for log file not existing
if (!fs.existsSync(RemoteClientLogger.LogFilePath)) {
CloudRunnerLogger.log(`Log file does not exist`);
return;
}
let hashedLogs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString();
const directory = process.cwd();

View File

@ -30,7 +30,6 @@ describe('Cloud Runner Kubernetes', () => {
unityVersion: UnityVersioning.determineUnityVersion('test-project', UnityVersioning.read('test-project')),
targetPlatform: 'StandaloneLinux64',
cacheKey: `test-case-${uuidv4()}`,
containerHookFiles: `debug-cache`,
};
const buildParameter = await CreateParameters(overrides);
expect(buildParameter.projectPath).toEqual(overrides.projectPath);
@ -41,6 +40,7 @@ describe('Cloud Runner Kubernetes', () => {
const cachePushFail = 'Did not push source folder to cache because it was empty Library';
const buildSucceededString = 'Build succeeded';
expect(results).toContain('Collected Logs');
expect(results).toContain(libraryString);
expect(results).toContain(buildSucceededString);
expect(results).not.toContain(cachePushFail);