- Fixing issue with parameter expansion on DAG submission to server
- Adding sections to unit_server tests - Adding cleanup
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user