Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract and split integration tests #389

Conversation

vvatanabe
Copy link
Collaborator

This pull request is just a refactoring of the test.

Details:

  • Moved test cases other than integration tests in api_test.go to a suitable test file.
    • Moved the test cases for the UnmarshalJSON function of APIError to error_test.go and consolidated them into table tests.
    • numTokens function is not used in the integration test, so it was moved to openai_test.go, which consolidates commonly used functions.
    • Split the test scope of TestRequestError test function.
      • Extracted only mock test of ListEngines API and moved it to engines_test.go.
      • Moved RequestError unmarshalling test to error_test.go.
  • Renamed api_test.go to api_integration_test.go to make it easier to understand that it is an integration test.

@codecov
Copy link

codecov bot commented Jun 17, 2023

Codecov Report

Merging #389 (7fc065e) into master (e49d771) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #389   +/-   ##
=======================================
  Coverage   95.26%   95.26%           
=======================================
  Files          17       17           
  Lines         676      676           
=======================================
  Hits          644      644           
  Misses         22       22           
  Partials       10       10           

@vvatanabe
Copy link
Collaborator Author

@sashabaranov Please check it. (just a refactoring of the test.)

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much 🙌🏻 That was long overdue!

@sashabaranov sashabaranov merged commit b095938 into sashabaranov:master Jun 18, 2023
3 checks passed
coggsfl added a commit to coggsfl/go-openai that referenced this pull request Jun 18, 2023
extract and split integration tests (sashabaranov#389)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants