Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
94cfe39a
Commit
94cfe39a
authored
Jun 03, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: coreBuild.Cancel calls the builder Cancel method
parent
30a061a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
packer/build.go
packer/build.go
+1
-0
packer/build_test.go
packer/build_test.go
+12
-0
No files found.
packer/build.go
View file @
94cfe39a
...
@@ -91,4 +91,5 @@ func (b *coreBuild) Run(ui Ui) Artifact {
...
@@ -91,4 +91,5 @@ func (b *coreBuild) Run(ui Ui) Artifact {
// Cancels the build if it is running.
// Cancels the build if it is running.
func
(
b
*
coreBuild
)
Cancel
()
{
func
(
b
*
coreBuild
)
Cancel
()
{
b
.
builder
.
Cancel
()
}
}
packer/build_test.go
View file @
94cfe39a
...
@@ -92,3 +92,15 @@ func TestBuild_RunBeforePrepare(t *testing.T) {
...
@@ -92,3 +92,15 @@ func TestBuild_RunBeforePrepare(t *testing.T) {
testBuild
()
.
Run
(
testUi
())
testBuild
()
.
Run
(
testUi
())
}
}
func
TestBuild_Cancel
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
build
:=
testBuild
()
build
.
Cancel
()
coreB
:=
build
.
(
*
coreBuild
)
builder
:=
coreB
.
builder
.
(
*
TestBuilder
)
assert
.
True
(
builder
.
cancelCalled
,
"cancel should be called"
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment