@@ -9,10 +9,12 @@ import (
9
9
"fmt"
10
10
"os"
11
11
"path/filepath"
12
+ "strings"
12
13
"testing"
13
14
14
15
"github.com/sqlc-dev/sqlc/internal/cmd"
15
16
"github.com/sqlc-dev/sqlc/internal/sqltest"
17
+ "github.com/sqlc-dev/sqlc/internal/sqltest/local"
16
18
)
17
19
18
20
func findSchema (t * testing.T , path string ) (string , bool ) {
@@ -31,11 +33,6 @@ func TestExamplesVet(t *testing.T) {
31
33
t .Parallel ()
32
34
ctx := context .Background ()
33
35
34
- authToken := os .Getenv ("SQLC_AUTH_TOKEN" )
35
- if authToken == "" {
36
- t .Skip ("missing auth token" )
37
- }
38
-
39
36
examples , err := filepath .Abs (filepath .Join (".." , ".." , "examples" ))
40
37
if err != nil {
41
38
t .Fatal (err )
@@ -62,6 +59,14 @@ func TestExamplesVet(t *testing.T) {
62
59
defer db .Close ()
63
60
defer cleanup ()
64
61
}
62
+ if s , found := findSchema (t , filepath .Join (path , "mysql" )); found {
63
+ uri := local .MySQL (t , []string {s })
64
+ os .Setenv (fmt .Sprintf ("VET_TEST_EXAMPLES_MYSQL_%s" , strings .ToUpper (tc )), uri )
65
+ }
66
+ if s , found := findSchema (t , filepath .Join (path , "postgresql" )); found {
67
+ uri := local .PostgreSQL (t , []string {s })
68
+ os .Setenv (fmt .Sprintf ("VET_TEST_EXAMPLES_POSTGRES_%s" , strings .ToUpper (tc )), uri )
69
+ }
65
70
}
66
71
67
72
var stderr bytes.Buffer
0 commit comments