more logging for caching handling for faster test failure

pull/419/head
Frostebite 2022-09-03 04:15:22 +01:00
parent 00b0e4979f
commit 4c4859eb69
4 changed files with 11 additions and 1 deletions

2
dist/index.js vendored
View File

@ -3730,6 +3730,8 @@ class Caching {
} }
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tar -cvf ${cacheArtifactName}.tar.lz4 ${path_1.default.basename(sourceFolder)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`tar -cvf ${cacheArtifactName}.tar.lz4 ${path_1.default.basename(sourceFolder)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar.lz4`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar.lz4`);
const contents = yield fs_1.default.promises.readdir(path_1.default.basename(sourceFolder));
cloud_runner_logger_1.default.log(`There is ${contents.length} files/dir in the source folder ${path_1.default.basename(sourceFolder)}`);
console_1.assert(yield fileExists(`${cacheArtifactName}.tar.lz4`), 'cache archive exists'); console_1.assert(yield fileExists(`${cacheArtifactName}.tar.lz4`), 'cache archive exists');
console_1.assert(yield fileExists(path_1.default.basename(sourceFolder)), 'source folder exists'); console_1.assert(yield fileExists(path_1.default.basename(sourceFolder)), 'source folder exists');
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar.lz4 ${cacheFolder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar.lz4 ${cacheFolder}`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -61,6 +61,10 @@ export class Caching {
} }
await CloudRunnerSystem.Run(`tar -cvf ${cacheArtifactName}.tar.lz4 ${path.basename(sourceFolder)}`); await CloudRunnerSystem.Run(`tar -cvf ${cacheArtifactName}.tar.lz4 ${path.basename(sourceFolder)}`);
await CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar.lz4`); await CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar.lz4`);
const contents = await fs.promises.readdir(path.basename(sourceFolder));
CloudRunnerLogger.log(
`There is ${contents.length} files/dir in the source folder ${path.basename(sourceFolder)}`,
);
assert(await fileExists(`${cacheArtifactName}.tar.lz4`), 'cache archive exists'); assert(await fileExists(`${cacheArtifactName}.tar.lz4`), 'cache archive exists');
assert(await fileExists(path.basename(sourceFolder)), 'source folder exists'); assert(await fileExists(path.basename(sourceFolder)), 'source folder exists');
await CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar.lz4 ${cacheFolder}`); await CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar.lz4 ${cacheFolder}`);

View File

@ -41,6 +41,9 @@ describe('Cloud Runner', () => {
expect(results).toContain(libraryString); expect(results).toContain(libraryString);
expect(results).toContain(buildSucceededString); expect(results).toContain(buildSucceededString);
expect(results).not.toContain('There is 0 files/dir in the source folder Library');
expect(results).not.toContain('There is 0 files/dir in the source folder LFS');
CloudRunnerLogger.log(`run 1 succeeded`); CloudRunnerLogger.log(`run 1 succeeded`);
const buildParameter2 = await CreateParameters(overrides); const buildParameter2 = await CreateParameters(overrides);
const baseImage2 = new ImageTag(buildParameter2); const baseImage2 = new ImageTag(buildParameter2);
@ -49,6 +52,7 @@ describe('Cloud Runner', () => {
expect(results2).toContain(buildSucceededString); expect(results2).toContain(buildSucceededString);
expect(results2).not.toContain('There is 0 files/dir in the cache pulled contents for Library'); expect(results2).not.toContain('There is 0 files/dir in the cache pulled contents for Library');
expect(results2).not.toContain('There is 0 files/dir in the cache pulled contents for LFS');
expect(results2).not.toContain(libraryString); expect(results2).not.toContain(libraryString);
}, 1000000); }, 1000000);
} }