File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1- name : JWT Encryption Job
1+ name : JWT/JWE Encryption
22
33on :
44 push :
2929 go version
3030 go get -u golang.org/x/lint/golint
3131
32- # Run testing on the code
32+ # Run unit test
3333 - name : Run testing
34- run : go test -v -cover ./... -gcflags=all=-l
34+ run : go test -v -cover ./... -gcflags=all=-l
35+
36+ # Upload coverage report
37+ - name : Upload coverage reports to Codecov
38+ uses : codecov/codecov-action@v3
39+ env :
40+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change 22[ ![ Build Status] ( https://github.com/megablend/jwt-encryption/actions/workflows/build.yml/badge.svg?branch=master )] [ build ]
33[ ![ GoDoc] ( https://img.shields.io/badge/api-Godoc-blue.svg )] [ godoc ]
44[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/jxskiss/gopkg/v2 )] [ goreport ]
5+ [ ![ Coverage] ( https://codecov.io/gh/megablend/jwt-encryption/branch/master/graph/badge.svg )] [ coverage ]
56[ ![ Issues] ( https://img.shields.io/github/issues/megablend/jwt-encryption.svg )] [ issues ]
67[ ![ GitHub release] ( http://img.shields.io/github/release/megablend/jwt-encryption.svg )] [ release ]
78[ ![ MIT License] ( http://img.shields.io/badge/license-MIT-blue.svg )] [ license ]
89
910[ build ] : https://github.com/megablend/jwt-encryption/actions
1011[ godoc ] : https://pkg.go.dev/github.com/megablend/jwt-encryption
1112[ goreport ] : https://goreportcard.com/report/github.com/megablend/jwt-encryption
13+ [ coverage ] : https://codecov.io/gh/megablend/jwt-encryption
1214[ issues ] : https://github.com/megablend/jwt-encryption/issues
1315[ release ] : https://github.com/megablend/jwt-encryption/releases
1416[ license ] : https://github.com/megablend/jwt-encryption/blob/master/LICENSE
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ import (
1111)
1212
1313func patchOsOpen (message string ) {
14- monkey .Patch (os .Open , func (_ string ) (* os.File , error ) {
15- return nil , errors .New (message )
16- })
14+ monkey .Patch (os .Open ,
15+ func (_ string ) (* os.File , error ) {
16+ return nil , errors .New (message )
17+ })
1718}
1819
1920func TestNew_shouldReturnValidDetails (t * testing.T ) {
@@ -40,11 +41,11 @@ func TestNew_shouldReturnValidDetails(t *testing.T) {
4041
4142func TestNew_shouldReturnError_whenUnableToReadFile (t * testing.T ) {
4243 errMsg := "test error message while opening file"
43- err := os .Setenv (BASE_PATH , "/path/to/config" )
44-
4544 defer monkey .UnpatchAll ()
4645 patchOsOpen (errMsg )
4746
47+ err := os .Setenv (BASE_PATH , "/path/to/config" )
48+
4849 config , configErr := New ()
4950
5051 require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments