Skip to content

Commit

Permalink
split integration test using go build tag (sashabaranov#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatanabe committed Jun 19, 2023
1 parent b095938 commit 68f9ef9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,16 @@ if errors.As(err, &e) {

See the `examples/` folder for more.

### Integration tests:

Integration tests are requested against the production version of the OpenAI API. These tests will verify that the library is properly coded against the actual behavior of the API, and will fail upon any incompatible change in the API.

**Notes:**
These tests send real network traffic to the OpenAI API and may reach rate limits. Temporary network problems may also cause the test to fail.

**Run tests using:**
```
OPENAI_TOKEN=XXX go test -v -tags=integration ./api_integration_test.go
```

If `OPENAI_TOKEN` environment variables are not available, integration tests will be skipped.
2 changes: 2 additions & 0 deletions api_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package openai_test

import (
Expand Down

0 comments on commit 68f9ef9

Please sign in to comment.