File tree Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Original file line number Diff line number Diff line change
1
+ name : tests
2
+
3
+ on :
4
+ push :
5
+ branches : [master]
6
+ pull_request :
7
+ branches : [master]
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+ strategy :
13
+ fail-fast : false
14
+ matrix :
15
+ go : [1.16.x, 1.17.x, 1.18.x]
16
+ steps :
17
+ - uses : actions/checkout@v2
18
+
19
+ - name : Set up Go
20
+ uses : actions/setup-go@v2
21
+ with :
22
+ go-version : ${{ matrix.go }}
23
+
24
+ - name : Install goveralls
25
+ run : go install github.com/mattn/goveralls@latest
26
+
27
+ - name : Build
28
+ run : go build -v ./...
29
+
30
+ - name : Run tests
31
+ run : go test -race -covermode=atomic -coverprofile=covprofile -v ./...
32
+
33
+ - name : Update coverage
34
+ env :
35
+ COVERALLS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36
+ run : goveralls -coverprofile=covprofile -service=github
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
APNS/2 is a go package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provider API.
4
4
5
- [ ![ Build Status] ( https://travis-ci.org /sideshow/apns2. svg?branch=master )] ( https://travis-ci.org /sideshow/apns2 ) [ ![ Coverage Status] ( https://coveralls.io/repos/sideshow/apns2/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/sideshow/apns2?branch=master ) [ ![ GoDoc] ( https://godoc.org/github.com/sideshow/apns2?status.svg )] ( https://godoc.org/github.com/sideshow/apns2 )
5
+ [ ![ Build Status] ( https://github.com /sideshow/apns2/actions/workflows/tests.yml/badge. svg )] ( https://github.com /sideshow/apns2/actions/workflows/tests.yml ) [ ![ Coverage Status] ( https://coveralls.io/repos/sideshow/apns2/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/sideshow/apns2?branch=master ) [ ![ GoDoc] ( https://godoc.org/github.com/sideshow/apns2?status.svg )] ( https://godoc.org/github.com/sideshow/apns2 )
6
6
7
7
## Features
8
8
@@ -27,6 +27,7 @@ go get -u github.com/sideshow/apns2
27
27
```
28
28
29
29
If you are running the test suite you will also need to install testify:
30
+
30
31
``` sh
31
32
go get -u github.com/stretchr/testify
32
33
```
@@ -60,7 +61,7 @@ func main() {
60
61
// client := apns2.NewClient(cert).Development()
61
62
// For apps published to the app store or installed as an ad-hoc distribution use Production()
62
63
63
- client := apns2.NewClient (cert).Production ()
64
+ client := apns2.NewClient (cert).Production ()
64
65
res , err := client.Push (notification)
65
66
66
67
if err != nil {
Original file line number Diff line number Diff line change 6
6
"crypto/elliptic"
7
7
"crypto/rand"
8
8
"crypto/tls"
9
+ "errors"
9
10
"fmt"
10
11
"io/ioutil"
11
12
"net"
@@ -139,8 +140,10 @@ func TestDialTLSTimeout(t *testing.T) {
139
140
if _ , e = dialTLS ("tcp" , address , nil ); e == nil {
140
141
t .Fatal ("Dial completed successfully" )
141
142
}
142
- if ! strings .Contains (e .Error (), "timed out" ) {
143
- t .Errorf ("resulting error not a timeout: %s" , e )
143
+ // Go 1.7.x and later will return a context deadline exceeded error
144
+ // Previous versions will return a time out
145
+ if ! strings .Contains (e .Error (), "timed out" ) && ! errors .Is (e , context .DeadlineExceeded ) {
146
+ t .Errorf ("Unexpected error: %s" , e )
144
147
}
145
148
}
146
149
You can’t perform that action at this time.
0 commit comments