Skip to content

Commit

Permalink
Preparing and finalizing for build.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Jul 22, 2024
1 parent 4e74dc3 commit 356258e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.11.0)
project(recodex-worker)
set(RECODEX_VERSION 1.8.0)
set(RECODEX_VERSION 1.9.0)
enable_testing()

set(EXEC_NAME ${PROJECT_NAME})
Expand Down
4 changes: 2 additions & 2 deletions examples/job-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ tasks:
cmd:
bin: "./test"
args: []
success_exit_codes: # list of exit codes which will be accepted as success
- 0 # zero is success by default, but if success_exit_codes is present, it must be added explicitly.
success-exit-codes: # list of exit codes which will be accepted as success
- 0 # zero is success by default, but if success-exit-codes is present, it must be added explicitly.
- 1 # single code
- [100, 200] # an interval (inclusive)
# codes 0, 1, 100, 101, ... 199, and 200 will all be accepted
Expand Down
8 changes: 7 additions & 1 deletion src/config/task_results.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
/**
* Return error codes of sandbox. Code names corresponds isolate's meta file error codes.
*/
enum class isolate_status { OK, RE, SG, TO, XX };
enum class isolate_status {
OK,
RE, // run-time error, i.e., exited with a non-zero exit code
SG, // program died on a signal
TO, // timed out
XX, // internal error of the sandbox
};

/**
* Status of whole task after execution.
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void load_task_success_exit_codes(const YAML::Node &node, std::vector<bool> &suc
}
}
} else {
throw helpers::config_exception("Task command success_exit_codes must be an integer or a list.");
throw helpers::config_exception("Task command success-exit-codes must be an integer or a list.");
}
}

Expand Down Expand Up @@ -125,8 +125,8 @@ std::shared_ptr<job_metadata> helpers::build_job_metadata(const YAML::Node &conf
task_meta->cmd_args = ctask["cmd"]["args"].as<std::vector<std::string>>();
} // can be omitted... no throw

if (ctask["cmd"]["success_exit_codes"]) {
load_task_success_exit_codes(ctask["cmd"]["success_exit_codes"], task_meta->success_exit_codes);
if (ctask["cmd"]["success-exit-codes"]) {
load_task_success_exit_codes(ctask["cmd"]["success-exit-codes"], task_meta->success_exit_codes);
}
} else {
throw config_exception("Command in task is not a map");
Expand Down
2 changes: 1 addition & 1 deletion tests/job_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ TEST(job_config_test, config_data)
" args:\n"
" - -v\n"
" - \"-f 01.in\"\n"
" success_exit_codes:\n"
" success-exit-codes:\n"
" - 1\n"
" - [3,5]\n"
" - [10,12]\n"
Expand Down

0 comments on commit 356258e

Please sign in to comment.