Skip to content

Commit

Permalink
fix(types): update types and fix tests (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r authored Mar 11, 2022
1 parent 1087bb0 commit a1f558c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
15 changes: 9 additions & 6 deletions compiler/native/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1441,8 +1441,9 @@ func TestNative_Compile_Pipeline_Type(t *testing.T) {
Version: "1",
ID: "__0",
Metadata: pipeline.Metadata{
Clone: true,
Template: false,
Clone: true,
Template: false,
Environment: []string{"steps", "services", "secrets"},
},
Steps: pipeline.ContainerSlice{
&pipeline.Container{
Expand Down Expand Up @@ -1485,8 +1486,9 @@ func TestNative_Compile_Pipeline_Type(t *testing.T) {
Version: "1",
ID: "__0",
Metadata: pipeline.Metadata{
Clone: true,
Template: false,
Clone: true,
Template: false,
Environment: []string{"steps", "services", "secrets"},
},
Steps: pipeline.ContainerSlice{
&pipeline.Container{
Expand Down Expand Up @@ -1529,8 +1531,9 @@ func TestNative_Compile_Pipeline_Type(t *testing.T) {
Version: "1",
ID: "__0",
Metadata: pipeline.Metadata{
Clone: true,
Template: false,
Clone: true,
Template: false,
Environment: []string{"steps", "services", "secrets"},
},
Steps: pipeline.ContainerSlice{
&pipeline.Container{
Expand Down
14 changes: 13 additions & 1 deletion compiler/native/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func TestNative_Parse_Parameters(t *testing.T) {
// setup types
client, _ := New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
want := &yaml.Build{
Metadata: yaml.Metadata{
Environment: []string{"steps", "services", "secrets"},
},
Steps: yaml.StepSlice{
&yaml.Step{
Image: "plugins/docker:18.09",
Expand Down Expand Up @@ -447,6 +450,9 @@ func TestNative_Parse_Secrets(t *testing.T) {
// setup types
client, _ := New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
want := &yaml.Build{
Metadata: yaml.Metadata{
Environment: []string{"steps", "services", "secrets"},
},
Secrets: yaml.SecretSlice{
&yaml.Secret{
Name: "docker_username",
Expand Down Expand Up @@ -508,6 +514,9 @@ func TestNative_Parse_Stages(t *testing.T) {
// setup types
client, _ := New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
want := &yaml.Build{
Metadata: yaml.Metadata{
Environment: []string{"steps", "services", "secrets"},
},
Stages: yaml.StageSlice{
&yaml.Stage{
Name: "install",
Expand Down Expand Up @@ -581,6 +590,9 @@ func TestNative_Parse_Steps(t *testing.T) {
// setup types
client, _ := New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
want := &yaml.Build{
Metadata: yaml.Metadata{
Environment: []string{"steps", "services", "secrets"},
},
Steps: yaml.StepSlice{
&yaml.Step{
Commands: []string{"./gradlew downloadDependencies"},
Expand Down Expand Up @@ -846,7 +858,7 @@ func Test_client_Parse(t *testing.T) {
Metadata: yaml.Metadata{
Template: false,
Clone: nil,
Environment: nil,
Environment: []string{"steps", "services", "secrets"},
},
Steps: yaml.StepSlice{
{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/gin-gonic/gin v1.7.7
github.com/go-playground/assert/v2 v2.0.1
github.com/go-redis/redis/v8 v8.11.4
github.com/go-vela/types v0.12.0
github.com/go-vela/types v0.13.0-rc1
github.com/golang-jwt/jwt/v4 v4.3.0
github.com/google/go-cmp v0.5.7
github.com/google/go-github/v42 v42.0.0
Expand Down Expand Up @@ -103,7 +103,7 @@ require (
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/microcosm-cc/bluemonday v1.0.17 // indirect
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-vela/types v0.12.0 h1:RnliZ5sZ0ceDRNyjp8o5uPKMIgLF7Gd7JRJWgOLgOPw=
github.com/go-vela/types v0.12.0/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4=
github.com/go-vela/types v0.13.0-rc1 h1:y4A5R/zbjlz/XXdwDE7iOdl+/6hgB0B/jVz9LFDfznw=
github.com/go-vela/types v0.13.0-rc1/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -460,8 +460,8 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJK
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/microcosm-cc/bluemonday v1.0.17 h1:Z1a//hgsQ4yjC+8zEkV8IWySkXnsxmdSY642CTFQb5Y=
github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM=
github.com/microcosm-cc/bluemonday v1.0.18 h1:6HcxvXDAi3ARt3slx6nTesbvorIc3QeTzBNRvWktHBo=
github.com/microcosm-cc/bluemonday v1.0.18/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
Expand Down

0 comments on commit a1f558c

Please sign in to comment.