wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.8k stars 814 forks source link

How to setup CI (Continuous Integration) for GitHub URL accesses? #1319

Closed evandrocoan closed 11 months ago

evandrocoan commented 6 years ago

From:

  1. https://github.com/wbond/package_control/issues/1317 Ran 60 tests, FAILED (failures=3, errors=7)

We notice that all the failures are related to the accesses to the GitHub URLs, then there is no way to setup CI if we need a client_id and client_secret from GitHub.

  1. https://developer.github.com/v3/guides/basics-of-authentication/

I have setup/implemented:

  1. https://github.com/wbond/package_control/issues/1318 Replace the builtin tests runner by UnitTesting

On my fork of Package Control and added CL integration with Travis and AppVeyor:

Build Status Build status codecov Coverage Status https://github.com/evandrocoan/PackagesManager

However, Coverage is not working due:

  1. https://github.com/SublimeText/UnitTesting/issues/77 Not uploading coverage reports when there are tests failures/errors

Anyways, after solving how to pass client_id and client_secret for GitHub tests, everything should be working.

evandrocoan commented 6 years ago

After fixing:

  1. https://github.com/wbond/package_control/issues/1317 Ran 60 tests, FAILED (failures=3, errors=7)

The tests are passing for Linux and Windows, however the OSX tests on Travis are hanging and causing the build process to fail after Travis expiring its timeout of 10 minutes:

  1. https://github.com/SublimeText/UnitTesting/issues/78 Travis OSX build is halting
deathaxe commented 11 months ago

PC's unittests may perform a lot of API calls to various code hosters and thus may cause API limits to be hit.

To reduce the risk of doing so, proper authentication information need to be provided via environment variables.

The following lines are from https://github.com/wbond/package_control/blob/four-point-oh/package_control/tests/_config.py:

GH_USER = os.environ.get('GH_USER', 'packagecontrol-bot')
GH_PASS = os.environ.get('GH_PASS', '')

GL_USER = os.environ.get('GL_USER', 'wbond')
GL_PASS = os.environ.get('GL_PASS', '')

BB_USER = os.environ.get('BB_USER', 'wbond')
BB_PASS = os.environ.get('BB_PASS', '')

They are used to perform basic auth, which pushes the limits from 60 to 5000 API calls.