forked from tangled.org/core
this repo has no description

.tangled/workflows: run tests on CI

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 4a7f7ca4 eeca571c

verified
Changed files
+9 -16
.tangled
workflows
spindle
engine
+5 -5
.tangled/workflows/test.yaml
··· 1 1 when: 2 - - event: ["push"] 3 - branch: ["master"] 2 + - event: push 3 + branch: master 4 4 5 5 dependencies: 6 6 nixpkgs: 7 7 - go 8 - 9 - environment: 10 - CGO_ENABLED: 1 8 + - gcc 11 9 12 10 steps: 13 11 - name: patch static dir ··· 15 13 mkdir -p appview/pages/static; touch appview/pages/static/x 16 14 17 15 - name: run all tests 16 + environment: 17 + CGO_ENABLED: 1 18 18 command: | 19 19 go test -v ./...
+4 -11
spindle/engine/envs_test.go
··· 1 1 package engine 2 2 3 3 import ( 4 - "reflect" 5 4 "testing" 5 + 6 + "github.com/stretchr/testify/assert" 6 7 ) 7 8 8 9 func TestConstructEnvs(t *testing.T) { ··· 27 28 want: EnvVars{"FOO=bar", "BAZ=qux"}, 28 29 }, 29 30 } 30 - 31 31 for _, tt := range tests { 32 32 t.Run(tt.name, func(t *testing.T) { 33 33 got := ConstructEnvs(tt.in) 34 - 35 34 if got == nil { 36 35 got = EnvVars{} 37 36 } 38 - 39 - if !reflect.DeepEqual(got, tt.want) { 40 - t.Errorf("ConstructEnvs() = %v, want %v", got, tt.want) 41 - } 37 + assert.Equal(t, tt.want, got) 42 38 }) 43 39 } 44 40 } ··· 47 43 ev := EnvVars{} 48 44 ev.AddEnv("FOO", "bar") 49 45 ev.AddEnv("BAZ", "qux") 50 - 51 46 want := EnvVars{"FOO=bar", "BAZ=qux"} 52 - if !reflect.DeepEqual(ev, want) { 53 - t.Errorf("AddEnv result = %v, want %v", ev, want) 54 - } 47 + assert.Equal(t, want, ev) 55 48 }