Added ability to test task fails

pull/73/head
Piero Toffanin 2019-02-13 14:03:28 -05:00
rodzic b19c14f2b4
commit 1ec908e9d6
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -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 <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 <number> 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;

Wyświetl plik

@ -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)