Skip to content

Commit

Permalink
chore(endtoend): Skip tests missing secrets (#2763)
Browse files Browse the repository at this point in the history
GitHub does not populate secrets on pull requests sent from a forked
repository. Skip tests that require these secrets when they aren't
present.
  • Loading branch information
kyleconroy committed Sep 22, 2023
1 parent 232d6f9 commit e233156
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 1 addition & 6 deletions internal/endtoend/ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ func TestValidSchema(t *testing.T) {

projectID := os.Getenv("CI_SQLC_PROJECT_ID")
authToken := os.Getenv("CI_SQLC_AUTH_TOKEN")

if projectID == "" || authToken == "" {
if os.Getenv("CI") == "" {
t.Skip("skiping ddl tests outside of CI")
} else {
t.Fatal("missing project id and auth token")
}
t.Skip("missing project id or auth token")
}

client, err := quickdb.NewClient(projectID, authToken)
Expand Down
5 changes: 5 additions & 0 deletions internal/endtoend/vet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ func TestExamplesVet(t *testing.T) {
t.Parallel()
ctx := context.Background()

authToken := os.Getenv("SQLC_AUTH_TOKEN")
if authToken == "" {
t.Skip("missing auth token")
}

examples, err := filepath.Abs(filepath.Join("..", "..", "examples"))
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit e233156

Please sign in to comment.