diff --git a/config.js b/config.js index 770327c..541009a 100644 --- a/config.js +++ b/config.js @@ -38,6 +38,7 @@ Options: --test_skip_orthophotos If test mode is enabled, skip orthophoto results when generating assets. (default: false) --test_skip_dems If test mode is enabled, skip dems results when generating assets. (default: false) --test_drop_uploads If test mode is enabled, drop /task/new/upload requests with 50% probability. (default: false) + --test_fail_tasks If test mode is enabled, mark tasks as failed. (default: false) --powercycle When set, the application exits immediately after powering up. Useful for testing launch and compilation issues. --token Sets a token that needs to be passed for every request. This can be used to limit access to the node only to token holders. (default: none) --max_images Specify the maximum number of images that this processing node supports. (default: unlimited) @@ -97,6 +98,7 @@ config.test = argv.test || fromConfigFile("test", false); config.testSkipOrthophotos = argv.test_skip_orthophotos || fromConfigFile("testSkipOrthophotos", false); config.testSkipDems = argv.test_skip_dems || fromConfigFile("testSkipDems", false); config.testDropUploads = argv.test_drop_uploads || fromConfigFile("testDropUploads", false); +config.testFailTasks = argv.test_fail_tasks || fromConfigFile("testFailTasks", false); config.powercycle = argv.powercycle || fromConfigFile("powercycle", false); config.token = argv.token || fromConfigFile("token", ""); config.maxImages = parseInt(argv.max_images || fromConfigFile("maxImages", "")) || null; diff --git a/libs/Task.js b/libs/Task.js index ad5a6df..694e94d 100644 --- a/libs/Task.js +++ b/libs/Task.js @@ -317,6 +317,7 @@ module.exports = class Task{ 'odm_georeferencing', 'odm_texturing', 'odm_dem/dsm.tif', 'odm_dem/dtm.tif', 'dsm_tiles', 'dtm_tiles', 'orthophoto_tiles', 'potree_pointcloud', 'images.json']; + let tasks = []; if (config.test){ if (config.testSkipOrthophotos){ @@ -336,11 +337,14 @@ module.exports = class Task{ allPaths.splice(allPaths.indexOf(p), 1); }); } + + if (config.testFailTasks){ + logger.info("Test mode will fail the task"); + tasks.push(done => done(new Error("Test fail"))); + } } - let tasks = []; if (!this.skipPostProcessing) tasks.push(runPostProcessingScript()); - tasks.push(createZipArchive('all.zip', allPaths)); // Upload to S3 all paths + all.zip file (if config says so)