Fix bug around spawning worker processes.

We were expecting to find the path to the `strawboss` binary implicitly from
the environment, which meant that configuration was also implicit, and required
more setup. Now the path to the binary is explicit in the StrawBoss runtime
configuration, and the path to the configuration file can also be explicitly given.
This commit is contained in:
Jonathan Bernard
2017-05-11 10:43:55 -05:00
parent 42f37a21e6
commit a1100f17d8
6 changed files with 47 additions and 15 deletions

View File

@ -5,14 +5,14 @@ import ../../../main/nim/strawbosspkg/configuration
suite "load and save configuration objects":
# suite setup & common data
let testProjDefStr = """{ "name": "test-project-1", "repo":
let testProjDefStr = """{ "name": "dummy-project", "repo":
"/non-existent/dir",
"cfgFilePath": "strawhat.json",
"defaultBranch": "deploy",
"envVars": { "VAR1": "value" } }"""
let testProjDef = ProjectDef(
name: "test-project-1",
name: "dummy-project",
repo: "/non-existent/dir",
cfgFilePath: "strawhat.json",
defaultBranch: "deploy",
@ -23,7 +23,7 @@ suite "load and save configuration objects":
let pd = parseProjectDef(parseJson(testProjDefStr))
check:
pd.name == "test-project-1"
pd.name == "dummy-project"
pd.repo == "/non-existent/dir"
pd.cfgFilePath == "strawhat.json"
pd.defaultBranch == "deploy"
@ -61,13 +61,13 @@ suite "load and save configuration objects":
let expectedUsers = @[UserRef(name: "bob@builder.com", hashedPwd: "testvalue"),
UserRef(name: "sam@sousa.com", hashedPwd: "testvalue")]
let expectedProjects = @[
ProjectDef(name: "test-project-1",
ProjectDef(name: "dummy-project",
repo: "/non-existent/dir",
defaultBranch: "deploy",
cfgFilePath: "strawhat.json",
envVars: newStringTable("VAR1", "value", modeCaseSensitive)),
ProjectDef(name: "test-strawboss",
repo: "https://git.jdb-labs.com:jdb/test-strawboss.git",
ProjectDef(name: "test-project",
repo: "",
defaultBranch: "master",
cfgFilePath: "strawboss.json",
envVars: newStringTable(modeCaseSensitive))]
@ -80,10 +80,10 @@ suite "load and save configuration objects":
sameContents(expectedProjects, cfg.projects)
test "loadProjectConfig":
let pc = loadProjectConfig("src/test/json/test-project-1.config.json")
let pc = loadProjectConfig("src/test/json/dummy-project.config.json")
check:
pc.name == "test-project-1"
pc.name == "dummy-project"
pc.versionCmd == "git describe --all --always"
pc.steps.len == 2