Skip to content

update tests and utils to use boolean pointers #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/devfile/library
go 1.15

require (
github.com/devfile/api/v2 v2.0.0-20210910153124-da620cd1a7a1
github.com/devfile/api/v2 v2.0.0-20210914125740-da05a3e14c3b
github.com/fatih/color v1.7.0
github.com/gobwas/glob v0.2.3
github.com/golang/mock v1.5.0
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/devfile/api/v2 v2.0.0-20210910153124-da620cd1a7a1 h1:k25KKenebyxOUnGmGTZE0F/wHDQ+fh+HoxVfjsKXNv0=
github.com/devfile/api/v2 v2.0.0-20210910153124-da620cd1a7a1/go.mod h1:kLX/nW93gigOHXK3NLeJL2fSS/sgEe+OHu8bo3aoOi4=
github.com/devfile/api/v2 v2.0.0-20210914125740-da05a3e14c3b h1:OSORBTgmRBJUKbZhGJJn+CH7gyY4IBdARn9pJpnqyBs=
github.com/devfile/api/v2 v2.0.0-20210914125740-da05a3e14c3b/go.mod h1:kLX/nW93gigOHXK3NLeJL2fSS/sgEe+OHu8bo3aoOi4=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
Expand Down Expand Up @@ -223,7 +223,6 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
Expand Down
6 changes: 4 additions & 2 deletions pkg/devfile/generator/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
)

var isTrue bool = true

func TestConvertEnvs(t *testing.T) {
envVarsNames := []string{"test", "sample-var", "myvar"}
envVarsValues := []string{"value1", "value2", "value3"}
Expand Down Expand Up @@ -984,7 +986,7 @@ func TestGetPortExposure(t *testing.T) {
{
Name: urlName2,
TargetPort: 9090,
Secure: true,
Secure: &isTrue,
Path: "/testpath",
Exposure: v1.InternalEndpointExposure,
Protocol: v1.HTTPSEndpointProtocol,
Expand Down Expand Up @@ -1038,7 +1040,7 @@ func TestGetPortExposure(t *testing.T) {
{
Name: urlName2,
TargetPort: 9090,
Secure: true,
Secure: &isTrue,
Path: "/testpath",
Exposure: v1.InternalEndpointExposure,
Protocol: v1.HTTPSEndpointProtocol,
Expand Down
18 changes: 10 additions & 8 deletions pkg/devfile/parser/data/v2/common/command_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
)

var isTrue bool = true

func TestGetGroup(t *testing.T) {

tests := []struct {
Expand All @@ -24,7 +26,7 @@ func TestGetGroup(t *testing.T) {
LabeledCommand: v1.LabeledCommand{
BaseCommand: v1.BaseCommand{
Group: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.RunCommandGroupKind,
},
},
Expand All @@ -33,7 +35,7 @@ func TestGetGroup(t *testing.T) {
},
},
want: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.RunCommandGroupKind,
},
},
Expand All @@ -46,7 +48,7 @@ func TestGetGroup(t *testing.T) {
LabeledCommand: v1.LabeledCommand{
BaseCommand: v1.BaseCommand{
Group: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.BuildCommandGroupKind,
},
},
Expand All @@ -55,7 +57,7 @@ func TestGetGroup(t *testing.T) {
},
},
want: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.BuildCommandGroupKind,
},
},
Expand All @@ -73,7 +75,7 @@ func TestGetGroup(t *testing.T) {
LabeledCommand: v1.LabeledCommand{
BaseCommand: v1.BaseCommand{
Group: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.TestCommandGroupKind,
},
},
Expand All @@ -82,7 +84,7 @@ func TestGetGroup(t *testing.T) {
},
},
want: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.TestCommandGroupKind,
},
},
Expand All @@ -95,7 +97,7 @@ func TestGetGroup(t *testing.T) {
LabeledCommand: v1.LabeledCommand{
BaseCommand: v1.BaseCommand{
Group: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.BuildCommandGroupKind,
},
},
Expand All @@ -104,7 +106,7 @@ func TestGetGroup(t *testing.T) {
},
},
want: &v1.CommandGroup{
IsDefault: true,
IsDefault: &isTrue,
Kind: v1.BuildCommandGroupKind,
},
},
Expand Down
Loading