1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

tests: add setNumExecutors method

This commit is contained in:
Oliver Giles 2022-01-22 08:07:41 +13:00
parent 4a6f99a203
commit e581a0cf5d
2 changed files with 9 additions and 0 deletions

View File

@ -98,6 +98,14 @@ public:
return { res.getResult(), kj::mv(log) }; return { res.getResult(), kj::mv(log) };
} }
void setNumExecutors(int nexec) {
KJ_IF_MAYBE(f, tmp.fs->tryOpenFile(kj::Path{"cfg", "contexts", "default.conf"},
kj::WriteMode::CREATE | kj::WriteMode::MODIFY | kj::WriteMode::CREATE_PARENT)) {
std::string content = "EXECUTORS=" + std::to_string(nexec);
(*f)->writeAll(content);
}
}
kj::String stripLaminarLogLines(const kj::String& str) { kj::String stripLaminarLogLines(const kj::String& str) {
auto out = kj::heapString(str.size()); auto out = kj::heapString(str.size());
char *o = out.begin(); char *o = out.begin();

View File

@ -38,6 +38,7 @@ public:
// set up empty directory structure // set up empty directory structure
fs->openSubdir(kj::Path{"cfg"}, kj::WriteMode::CREATE); fs->openSubdir(kj::Path{"cfg"}, kj::WriteMode::CREATE);
fs->openSubdir(kj::Path{"cfg", "jobs"}, kj::WriteMode::CREATE); fs->openSubdir(kj::Path{"cfg", "jobs"}, kj::WriteMode::CREATE);
fs->openSubdir(kj::Path{"cfg", "contexts"}, kj::WriteMode::CREATE);
} }
void clean() { void clean() {
// rm -rf in config folder // rm -rf in config folder