mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-11-02 00:29:32 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9968f74ae9 | ||
|
|
9d928ccad8 | ||
|
|
e62148b5f5 | ||
|
|
d25b7a46bb |
@@ -30,7 +30,7 @@ Section:
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Oliver Giles <web ohwg net>
|
||||
Depends: libcapnp-1.0.1, libsqlite3-0, zlib1g
|
||||
Depends: libcapnp-1.1.0, libsqlite3-0, zlib1g
|
||||
Description: Lightweight Continuous Integration Service
|
||||
EOF
|
||||
echo /etc/laminar.conf > laminar/DEBIAN/conffiles
|
||||
|
||||
@@ -47,7 +47,7 @@ Section:
|
||||
Priority: optional
|
||||
Architecture: armhf
|
||||
Maintainer: Oliver Giles <web ohwg net>
|
||||
Depends: libcapnp-1.0.1, libsqlite3-0, zlib1g
|
||||
Depends: libcapnp-1.1.0, libsqlite3-0, zlib1g
|
||||
Description: Lightweight Continuous Integration Service
|
||||
EOF
|
||||
echo /etc/laminar.conf > laminar/DEBIAN/conffiles
|
||||
|
||||
@@ -30,7 +30,7 @@ Section:
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Oliver Giles <web ohwg net>
|
||||
Depends: libcapnp-1.1.0, libsqlite3-0, zlib1g
|
||||
Depends: libcapnp-1.5.0, libsqlite3-0, zlib1g
|
||||
Description: Lightweight Continuous Integration Service
|
||||
EOF
|
||||
echo /etc/laminar.conf > laminar/DEBIAN/conffiles
|
||||
|
||||
@@ -47,7 +47,7 @@ Section:
|
||||
Priority: optional
|
||||
Architecture: armhf
|
||||
Maintainer: Oliver Giles <web ohwg net>
|
||||
Depends: libcapnp-1.1.0, libsqlite3-0, zlib1g
|
||||
Depends: libcapnp-1.5.0, libsqlite3-0, zlib1g
|
||||
Description: Lightweight Continuous Integration Service
|
||||
EOF
|
||||
echo /etc/laminar.conf > laminar/DEBIAN/conffiles
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <fnmatch.h>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <zlib.h>
|
||||
|
||||
#define COMPRESS_LOG_MIN_SIZE 1024
|
||||
@@ -306,7 +307,7 @@ std::string Laminar::getStatus(MonitorScope scope) {
|
||||
.bind(scope.job)
|
||||
.fetch<uint,uint>([&](uint nRuns, uint averageRuntime){
|
||||
j.set("averageRuntime", averageRuntime);
|
||||
j.set("pages", (nRuns-1) / runsPerPage + 1);
|
||||
j.set("pages", nRuns ? (nRuns-1) / runsPerPage + 1 : 1);
|
||||
j.startObject("sort");
|
||||
j.set("page", scope.page)
|
||||
.set("field", scope.field)
|
||||
@@ -872,6 +873,7 @@ R"x(
|
||||
return false;
|
||||
|
||||
badge = svg;
|
||||
std::free(svg);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#include "run.h"
|
||||
|
||||
const int SET_ENV_BUF_SIZE = 1024;
|
||||
|
||||
// short syntax helper for kj::Path
|
||||
template<typename T>
|
||||
inline kj::Path operator/(const kj::Path& p, const T& ext) {
|
||||
@@ -131,7 +133,7 @@ Leader::Leader(kj::AsyncIoContext &ioContext, kj::Filesystem &fs, const char *jo
|
||||
|
||||
LSYSCALL(pipe(setEnvPipe));
|
||||
auto event = ioContext.lowLevelProvider->wrapInputFd(setEnvPipe[0], kj::LowLevelAsyncIoProvider::TAKE_OWNERSHIP);
|
||||
auto buffer = kj::heapArrayBuilder<char>(1024);
|
||||
auto buffer = kj::heapArrayBuilder<char>(SET_ENV_BUF_SIZE);
|
||||
tasks.add(readEnvPipe(event, buffer.asPtr().begin()).attach(kj::mv(event), kj::mv(buffer)));
|
||||
}
|
||||
|
||||
@@ -295,7 +297,7 @@ kj::Promise<void> Leader::reapChildProcesses()
|
||||
}
|
||||
|
||||
kj::Promise<void> Leader::readEnvPipe(kj::AsyncInputStream *stream, char *buffer) {
|
||||
return stream->tryRead(buffer, 1, 1024).then([this,stream,buffer](size_t sz) {
|
||||
return stream->tryRead(buffer, 1, SET_ENV_BUF_SIZE - 1).then([this,stream,buffer](size_t sz) {
|
||||
if(sz > 0) {
|
||||
buffer[sz] = '\0';
|
||||
if(char* eq = strchr(buffer, '=')) {
|
||||
|
||||
@@ -163,6 +163,18 @@ TEST_F(LaminarFixture, JobDescription) {
|
||||
EXPECT_STREQ("bar", data["description"].GetString());
|
||||
}
|
||||
|
||||
TEST_F(LaminarFixture, JobPagesWithoutRuns) {
|
||||
defineJob("foo", "true");
|
||||
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("pages"));
|
||||
EXPECT_EQ(1, data["pages"].GetInt());
|
||||
}
|
||||
|
||||
TEST_F(LaminarFixture, QueueFront) {
|
||||
setNumExecutors(0);
|
||||
defineJob("foo", "true");
|
||||
|
||||
Reference in New Issue
Block a user