Skip to content

Commit

Permalink
test: Add kubernetes SetupMock to executor StreamBuild test
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Feb 21, 2023
1 parent d183498 commit 5cf18d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion executor/linux/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,16 @@ func TestLinux_StreamBuild(t *testing.T) {
t.Errorf("%s unable to create build: %v", test.name, err)
}

// simulate ExecBuild() which runs concurrently with StreamBuild()
// simulate AssembleBuild()/ExecBuild() which run concurrently with StreamBuild()
go func() {
// This Kubernetes setup would normally be called within AssembleBuild()
if test.runtime == constants.DriverKubernetes {
err = _runtime.(kubernetes.MockKubernetesRuntime).SetupMock()
if err != nil {
t.Errorf("Kubernetes runtime SetupMock returned err: %v", err)
}
}

if test.earlyBuildDone {
// imitate build getting canceled or otherwise finishing before ExecBuild gets called.
done()
Expand Down

0 comments on commit 5cf18d5

Please sign in to comment.