mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-03-02 03:40:21 +00:00
allow setting a job description
adding DESCRIPTION=foo to $JOBNAME.conf will display "foo" in the job overview page on the frontend Resolves #97
This commit is contained in:
@@ -151,3 +151,15 @@ TEST_F(LaminarFixture, Abort) {
|
||||
ASSERT_TRUE(laminar->abort("job1", 1));
|
||||
EXPECT_EQ(LaminarCi::JobResult::ABORTED, res.wait(ioContext->waitScope).getResult());
|
||||
}
|
||||
|
||||
TEST_F(LaminarFixture, JobDescription) {
|
||||
defineJob("foo", "true", "DESCRIPTION=bar");
|
||||
auto es = eventSource("/jobs/foo");
|
||||
ioContext->waitScope.poll();
|
||||
ASSERT_EQ(1, es->messages().size());
|
||||
auto json = es->messages().front().GetObject();
|
||||
ASSERT_TRUE(json.HasMember("data"));
|
||||
auto data = json["data"].GetObject();
|
||||
ASSERT_TRUE(data.HasMember("description"));
|
||||
EXPECT_STREQ("bar", data["description"].GetString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user