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
801e5aaa
Commit
801e5aaa
authored
Jun 18, 2015
by
Chris Bednarski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move test configs into the test func
parent
d02f6644
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
49 deletions
+48
-49
post-processor/compress/post-processor_test.go
post-processor/compress/post-processor_test.go
+48
-49
No files found.
post-processor/compress/post-processor_test.go
View file @
801e5aaa
...
...
@@ -54,19 +54,18 @@ func TestDetectFilename(t *testing.T) {
}
}
const
simpleTestCase
=
`
{
func
TestSimpleCompress
(
t
*
testing
.
T
)
{
const
config
=
`
{
"post-processors": [
{
"type": "compress",
"output": "package.tar.gz"
}
]
}
`
func
TestSimpleCompress
(
t
*
testing
.
T
)
{
artifact
:=
testArchive
(
t
,
simpleTestCase
)
}
`
artifact
:=
testArchive
(
t
,
config
)
defer
artifact
.
Destroy
()
fi
,
err
:=
os
.
Stat
(
"package.tar.gz"
)
...
...
@@ -78,19 +77,19 @@ func TestSimpleCompress(t *testing.T) {
}
}
const
zipTestCase
=
`
{
func
TestZipArchive
(
t
*
testing
.
T
)
{
const
config
=
`
{
"post-processors": [
{
"type": "compress",
"output": "package.zip"
}
]
}
`
}
`
func
TestZipArchive
(
t
*
testing
.
T
)
{
artifact
:=
testArchive
(
t
,
zipTestCase
)
artifact
:=
testArchive
(
t
,
config
)
defer
artifact
.
Destroy
()
// Verify things look good
...
...
@@ -100,19 +99,19 @@ func TestZipArchive(t *testing.T) {
}
}
const
tarTestCase
=
`
{
func
TestTarArchive
(
t
*
testing
.
T
)
{
const
config
=
`
{
"post-processors": [
{
"type": "compress",
"output": "package.tar"
}
]
}
`
}
`
func
TestTarArchive
(
t
*
testing
.
T
)
{
artifact
:=
testArchive
(
t
,
tarTestCase
)
artifact
:=
testArchive
(
t
,
config
)
defer
artifact
.
Destroy
()
// Verify things look good
...
...
@@ -122,8 +121,9 @@ func TestTarArchive(t *testing.T) {
}
}
const
optionsTestCase
=
`
{
func
TestCompressOptions
(
t
*
testing
.
T
)
{
const
config
=
`
{
"post-processors": [
{
"type": "compress",
...
...
@@ -131,11 +131,10 @@ const optionsTestCase = `
"compression_level": 9
}
]
}
`
}
`
func
TestCompressOptions
(
t
*
testing
.
T
)
{
artifact
:=
testArchive
(
t
,
optionsTestCase
)
artifact
:=
testArchive
(
t
,
config
)
defer
artifact
.
Destroy
()
// Verify things look good
...
...
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