Fixed behavior of multi-step builds.

* Output from the main strawboss executable is properly directed to stdout
  and stderr.
* Added threshold logging to strawboss core functions.
* Fixed a bug in the way dependent steps were detected and executed.
  The logic for checking if prior steps had already been executed was only
  executed once when the initial step was prepared, not for any of the
  dependent steps. This logic has been moved into the main work block for
  executing steps.
* Renamed `initiateRun` to `run` and  `runStep` to `doRun` to be more accurate.
* Dependent steps get their owng, independent copy of the workspace.
* Updated the test project to provide a test target.
This commit is contained in:
Jonathan Bernard
2017-11-24 20:29:41 -06:00
parent 573903bda0
commit 58fbbc048c
8 changed files with 134 additions and 66 deletions

View File

@ -5,3 +5,15 @@ from langutils import sameContents
import ../testutil
import ../../../main/nim/strawbosspkg/configuration
let cfgFilePath = "src/test/json/strawboss.config.json"
let cfg = loadStrawBossConfig(cfgFilePath)
let TIMEOUT = 2.minutes
suite "strawboss core":
# Suite setup: extract test project
let testProjTempDir = mkdir()
let testProjTarFile = newTarFile("src/test/test-project.tar.gz:)
let testProjName = "test-project"
testProjTarFile.extract(testProjTempDir)

View File

@ -1,4 +1,4 @@
import json, strtabs, tables, unittest, uuids
import json, strtabs, times, tables, unittest, uuids
from langutils import sameContents
import ../../../main/nim/strawbosspkg/configuration
@ -21,11 +21,12 @@ suite "load and save configuration objects":
test "parseRunRequest":
let rr1 = RunRequest(
id: genUUID(),
runId: genUUID(),
projectName: testProjDef.name,
stepName: "build",
buildRef: "master",
workspaceDir: "/no-real/dir",
timestamp: getLocalTime(getTime()),
forceRebuild: true)
let rrStr = $rr1
@ -143,5 +144,5 @@ suite "load and save configuration objects":
check:
st.runId == "90843e0c-6113-4462-af33-a89ff9731031"
st.state == "failed"
st.state == BuildState.failed
st.details == "some very good reason"

Submodule src/test/test-project updated: df39e07da4...127be8f66f

Binary file not shown.