Skip to content

Commit 68f9ef9

Browse files
authored
split integration test using go build tag (#392)
1 parent b095938 commit 68f9ef9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,16 @@ if errors.As(err, &e) {
542542

543543
See the `examples/` folder for more.
544544

545+
### Integration tests:
546+
547+
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.
548+
549+
**Notes:**
550+
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.
551+
552+
**Run tests using:**
553+
```
554+
OPENAI_TOKEN=XXX go test -v -tags=integration ./api_integration_test.go
555+
```
556+
557+
If `OPENAI_TOKEN` environment variables are not available, integration tests will be skipped.

api_integration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build integration
2+
13
package openai_test
24

35
import (

0 commit comments

Comments
 (0)