diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-02-05 11:24:44 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-02-05 12:03:25 +0100 |
| commit | ba514b601ba6be15b823e0a12d4b6e42f9d2489e (patch) | |
| tree | 286c42f6202954263a460f5fe44fd59c76da6a38 /tests/status.scm | |
| parent | c7465dcb96e8d35fb992f4e14c4e22251b951a98 (diff) | |
status: Keep track of the current build phase.
* guix/status.scm (<build>)[phase]: New field.
(%phase-start-rx): New variable.
(update-build): Add clause to match %PHASE-START-RX and adjust the
'phase' field accordingly.
* tests/status.scm ("compute-status, build phase"): Add test
Diffstat (limited to 'tests/status.scm')
| -rw-r--r-- | tests/status.scm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/status.scm b/tests/status.scm index f3afadfcd0f..01a61f73452 100644 --- a/tests/status.scm +++ b/tests/status.scm | |||
| @@ -211,4 +211,37 @@ | |||
| 211 | (display "@ build-succeeded foo.drv\n" port) | 211 | (display "@ build-succeeded foo.drv\n" port) |
| 212 | (list first second third (get-status))))))) | 212 | (list first second third (get-status))))))) |
| 213 | 213 | ||
| 214 | (test-equal "compute-status, build phase" | ||
| 215 | (list (build-status | ||
| 216 | (building (list (build "foo.drv" "x86_64-linux" #:id 121 | ||
| 217 | #:phase 'configure)))) | ||
| 218 | (build-status | ||
| 219 | (building (list (build "foo.drv" "x86_64-linux" #:id 121 | ||
| 220 | #:phase 'configure | ||
| 221 | #:completion 50.)))) | ||
| 222 | (build-status | ||
| 223 | (building (list (build "foo.drv" "x86_64-linux" #:id 121 | ||
| 224 | #:phase 'install)))) | ||
| 225 | (build-status | ||
| 226 | (builds-completed (list (build "foo.drv" "x86_64-linux" #:id 121 | ||
| 227 | #:phase 'install))))) | ||
| 228 | (let-values (((port get-status) | ||
| 229 | (build-event-output-port (lambda (event status) | ||
| 230 | (compute-status event status | ||
| 231 | #:current-time | ||
| 232 | (const 'now)))))) | ||
| 233 | (display "@ build-started foo.drv - x86_64-linux 121\n" port) | ||
| 234 | (display "@ build-log 121 27\nstarting phase `configure'\n" port) | ||
| 235 | (display "@ build-log 121 6\nabcde!" port) | ||
| 236 | (let ((first (get-status))) | ||
| 237 | (display "@ build-log 121 20\n[50/100] building Y\n" port) | ||
| 238 | (display "@ build-log 121 6\nfghik!" port) | ||
| 239 | (let ((second (get-status))) | ||
| 240 | (display "@ build-log 121 21\n[100/100] building Z\n" port) | ||
| 241 | (display "@ build-log 121 25\nstarting phase `install'\n" port) | ||
| 242 | (display "@ build-log 121 6\nlmnop!" port) | ||
| 243 | (let ((third (get-status))) | ||
| 244 | (display "@ build-succeeded foo.drv\n" port) | ||
| 245 | (list first second third (get-status))))))) | ||
| 246 | |||
| 214 | (test-end "status") | 247 | (test-end "status") |
