github.com/google/go-github/v42@v42.0.0/test/README.md (about)

     1  go-github tests
     2  ===============
     3  
     4  This directory contains additional test suites beyond the unit tests already in
     5  [../github](../github). Whereas the unit tests run very quickly (since they
     6  don't make any network calls) and are run by Travis on every commit, the tests
     7  in this directory are only run manually.
     8  
     9  The test packages are:
    10  
    11  integration
    12  -----------
    13  
    14  This will exercise the entire go-github library (or at least as much as is
    15  practical) against the live GitHub API. These tests will verify that the
    16  library is properly coded against the actual behavior of the API, and will
    17  (hopefully) fail upon any incompatible change in the API.
    18  
    19  Because these tests are running using live data, there is a much higher
    20  probability of false positives in test failures due to network issues, test
    21  data having been changed, etc.
    22  
    23  These tests send real network traffic to the GitHub API and will exhaust the
    24  default unregistered rate limit (60 requests per hour) very quickly.
    25  Additionally, in order to test the methods that modify data, a real OAuth token
    26  will need to be present. While the tests will try to be well-behaved in terms
    27  of what data they modify, it is **strongly** recommended that these tests only
    28  be run using a dedicated test account.
    29  
    30  Run tests using:
    31  
    32      GITHUB_AUTH_TOKEN=XXX go test -v -tags=integration ./integration
    33  
    34  Additionally there are a set of integration tests for the Authorizations API.
    35  These tests require a GitHub user (username and password), and also that a
    36  [GitHub Application](https://github.com/settings/applications/new) (with
    37  attendant Client ID and Client Secret) be available. Then, to execute just the
    38  Authorization tests:
    39  
    40      GITHUB_USERNAME='<GH_USERNAME>' GITHUB_PASSWORD='<GH_PASSWORD>' GITHUB_CLIENT_ID='<CLIENT_ID>' GITHUB_CLIENT_SECRET='<CLIENT_SECRET>' go test -v -tags=integration -run=Authorizations ./integration
    41  
    42  If some or all of these environment variables are not available, certain of the
    43  Authorization integration tests will be skipped.
    44  
    45  fields
    46  ------
    47  
    48  This will identify the fields being returned by the live GitHub API that are
    49  not currently being mapped into the relevant Go data type. Sometimes fields
    50  are deliberately not mapped, so the results of this tool should just be taken
    51  as a hint.
    52  
    53  This test sends real network traffic to the GitHub API and will exhaust the
    54  default unregistered rate limit (60 requests per hour) very quickly.
    55  Additionally, some data is only returned for authenticated API calls. Unlike
    56  the integration tests above, these tests only read data, so it's less
    57  imperative that these be run using a dedicated test account (though you still
    58  really should).
    59  
    60  Run the fields tool using:
    61  
    62      GITHUB_AUTH_TOKEN=XXX go run ./fields/fields.go