Skip to content

Commit e233156

Browse files
authored
chore(endtoend): Skip tests missing secrets (#2763)
GitHub does not populate secrets on pull requests sent from a forked repository. Skip tests that require these secrets when they aren't present.
1 parent 232d6f9 commit e233156

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/endtoend/ddl_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ func TestValidSchema(t *testing.T) {
2323

2424
projectID := os.Getenv("CI_SQLC_PROJECT_ID")
2525
authToken := os.Getenv("CI_SQLC_AUTH_TOKEN")
26-
2726
if projectID == "" || authToken == "" {
28-
if os.Getenv("CI") == "" {
29-
t.Skip("skiping ddl tests outside of CI")
30-
} else {
31-
t.Fatal("missing project id and auth token")
32-
}
27+
t.Skip("missing project id or auth token")
3328
}
3429

3530
client, err := quickdb.NewClient(projectID, authToken)

internal/endtoend/vet_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func TestExamplesVet(t *testing.T) {
3131
t.Parallel()
3232
ctx := context.Background()
3333

34+
authToken := os.Getenv("SQLC_AUTH_TOKEN")
35+
if authToken == "" {
36+
t.Skip("missing auth token")
37+
}
38+
3439
examples, err := filepath.Abs(filepath.Join("..", "..", "examples"))
3540
if err != nil {
3641
t.Fatal(err)

0 commit comments

Comments
 (0)