Skip to content

Commit 5a13182

Browse files
committed
tests: always make sure we return an LLB state
Before this we are returning errors to buildkit when there are test errors. Or for that matter, if there is an error during evaluation of the stuff running up to the tests. This causes issues with the debug workflow ("docker buildx dap") since there is no LLB state to attach to, so it can't set breakpoints properly. With this change even when we get a solve error when evaluating state, we return the bad state so that the debugger can attach to it. When a test fails, we add a new LLB exec op which prints the joined test errors and exits non-zero so that the build will fail. There's also some minor changes to make it simpler to discard any changes to the filesystem from running tests, or in the case of non-container outputs return the original state, while keeping the dependency chain in tact. Signed-off-by: Brian Goff <[email protected]>
1 parent 4999a52 commit 5a13182

File tree

6 files changed

+319
-260
lines changed

6 files changed

+319
-260
lines changed

cmd/frontend/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ func main() {
5555
case testrunner.CheckFilesCmdName:
5656
args := flag.Args()[2:]
5757
testrunner.CheckFilesCmd(args)
58+
case frontend.TestErrorCmdName:
59+
args := flag.Args()[2:]
60+
frontend.TestErrorCmd(args)
5861
default:
5962
dalecMain()
6063
}

0 commit comments

Comments
 (0)