- Fixing issue with parameter expansion on DAG submission to server

- Adding sections to unit_server tests
- Adding cleanup
This commit is contained in:
Ian Roddis
2021-08-20 11:11:12 -03:00
parent 8fa9af95af
commit 1f2712b090
3 changed files with 38 additions and 23 deletions

View File

@@ -62,29 +62,34 @@ TEST_CASE("Server Basic Endpoints", "[server_basic]") {
const std::string host = "localhost:";
const std::string baseURL = host + std::to_string(server.getPort());
{
SECTION ("Ready Endpoint") {
auto response = REQUEST(baseURL + "/ready");
REQUIRE(response.code() == Pistache::Http::Code::Ok);
}
std::string dagRun = R"({
"name": "unit_server",
"parameters": { "DIRS": [ "A", "B" ] },
"tasks": [
{ "name": "touch",
"command": [ "/usr/bin/touch", "/tmp/{{DIRS}}" ]
},
{
"name": "cat",
"command": [ "/usr/bin/cat", "/tmp/A", "/tmp/B" ]
"parents": [ "touch" ]
}
]
})";
SECTION("Simple DAGRun Submission") {
std::string dagRun = R"({
"name": "unit_server",
"parameters": { "FILE": [ "A", "B" ] },
"tasks": [
{ "name": "touch",
"command": [ "/usr/bin/touch", "/tmp/{{FILE}}" ]
},
{
"name": "cat",
"command": [ "/usr/bin/cat", "/tmp/A", "/tmp/B" ],
"parents": [ "touch" ]
}
]
})";
{
auto response = REQUEST(baseURL + "/v1/dagrun/", dagRun);
REQUIRE(response.code() == Pistache::Http::Code::Ok);
for (const auto &pth : std::vector<fs::path>{"/tmp/A", "/tmp/B"}) {
REQUIRE(fs::exists(pth));
fs::remove(pth);
}
}
server.shutdown();