File tree Expand file tree Collapse file tree 3 files changed +41
-38
lines changed Expand file tree Collapse file tree 3 files changed +41
-38
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : ci
2
+ on :
3
+ pull_request :
4
+ push :
5
+ branches :
6
+ - main
7
+ permissions :
8
+ contents : read
9
+ env :
10
+ GO_VERSION : 1.23
11
+ jobs :
12
+ tests :
13
+ runs-on : ubuntu-latest
14
+ services :
15
+ mysql :
16
+ image : mysql:8.0
17
+ env :
18
+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
19
+ MYSQL_DATABASE : mysql
20
+ MYSQL_USER : mysql
21
+ MYSQL_PASSWORD : mysql
22
+ MYSQL_HOST : 127.0.0.1
23
+ ports :
24
+ - 3306:3306
25
+ options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
26
+ steps :
27
+ - name : checkout
28
+ uses : actions/checkout@v4
29
+ - name : setup Go environment
30
+ uses : actions/setup-go@v5
31
+ with :
32
+ go-version : ${{ env.GO_VERSION }}
33
+ cache-dependency-path : " **/*.sum"
34
+ - name : Test
35
+ run : go test -v ./...
36
+ - name : Integration tests
37
+ run : go test -v ./...
38
+ env :
39
+ INTEGRATION_TESTS : " true"
40
+ MYSQL_URL : " mysql:mysql@tcp(127.0.0.1:3306)/mysql"
Original file line number Diff line number Diff line change 4
4
"context"
5
5
"database/sql"
6
6
"errors"
7
- "log"
8
7
"os"
9
8
"strings"
10
9
"testing"
@@ -55,7 +54,7 @@ func TestQuery_MySQL(t *testing.T) {
55
54
// Attempt to connect multiple times because these tests are ran in Drone, where the mysql server may not be immediately available when this test is ran.
56
55
limit := 10
57
56
for i := 0 ; i < limit ; i ++ {
58
- log . Println ("Attempting mysql connection..." )
57
+ t . Log ("Attempting mysql connection..." )
59
58
d , err := sql .Open ("mysql" , args .MySQLURL )
60
59
if err == nil {
61
60
if err := d .Ping (); err == nil {
You can’t perform that action at this time.
0 commit comments