Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
932663bd
Commit
932663bd
authored
May 11, 2016
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for malformed values.toml file
parent
012b0f7c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
lint_test.go
pkg/lint/lint_test.go
+12
-1
Chart.yaml
pkg/lint/testdata/badvaluesfile/Chart.yaml
+4
-0
badvaluesfile.yaml
pkg/lint/testdata/badvaluesfile/templates/badvaluesfile.yaml
+2
-0
values.toml
pkg/lint/testdata/badvaluesfile/values.toml
+2
-0
No files found.
pkg/lint/lint_test.go
View file @
932663bd
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
)
)
const
badChartDir
=
"testdata/badchartfile"
const
badChartDir
=
"testdata/badchartfile"
const
badValuesFileDir
=
"testdata/badvaluesfile"
const
badYamlFileDir
=
"testdata/albatross"
const
badYamlFileDir
=
"testdata/albatross"
const
goodChartDir
=
"testdata/goodone"
const
goodChartDir
=
"testdata/goodone"
...
@@ -40,13 +41,23 @@ func TestBadChart(t *testing.T) {
...
@@ -40,13 +41,23 @@ func TestBadChart(t *testing.T) {
func
TestInvalidYaml
(
t
*
testing
.
T
)
{
func
TestInvalidYaml
(
t
*
testing
.
T
)
{
m
:=
All
(
badYamlFileDir
)
m
:=
All
(
badYamlFileDir
)
if
len
(
m
)
!=
1
{
if
len
(
m
)
!=
1
{
t
.
Errorf
(
"All didn't fail with expected errors
"
)
t
.
Errorf
(
"All didn't fail with expected errors
, got %#v"
,
m
)
}
}
if
!
strings
.
Contains
(
m
[
0
]
.
Text
,
"deliberateSyntaxError"
)
{
if
!
strings
.
Contains
(
m
[
0
]
.
Text
,
"deliberateSyntaxError"
)
{
t
.
Errorf
(
"All didn't have the error for deliberateSyntaxError"
)
t
.
Errorf
(
"All didn't have the error for deliberateSyntaxError"
)
}
}
}
}
func
TestBadValues
(
t
*
testing
.
T
)
{
m
:=
All
(
badValuesFileDir
)
if
len
(
m
)
!=
1
{
t
.
Errorf
(
"All didn't fail with expected errors, got %#v"
,
m
)
}
if
!
strings
.
Contains
(
m
[
0
]
.
Text
,
"Bare keys cannot contain ':'"
)
{
t
.
Errorf
(
"All didn't have the error for invalid key format"
)
}
}
func
TestGoodChart
(
t
*
testing
.
T
)
{
func
TestGoodChart
(
t
*
testing
.
T
)
{
m
:=
All
(
goodChartDir
)
m
:=
All
(
goodChartDir
)
if
len
(
m
)
!=
0
{
if
len
(
m
)
!=
0
{
...
...
pkg/lint/testdata/badvaluesfile/Chart.yaml
0 → 100644
View file @
932663bd
name
:
badvaluesfile
description
:
A Helm chart for Kubernetes
version
:
0.0.1
home
:
"
"
pkg/lint/testdata/badvaluesfile/templates/badvaluesfile.yaml
0 → 100644
View file @
932663bd
metadata
:
name
:
{{
.name | default "foo" | title
}}
pkg/lint/testdata/badvaluesfile/values.toml
0 → 100644
View file @
932663bd
# Invalid value for badvaluesfile for testing lint fails with invalid toml format
name:
"value"
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