-
Notifications
You must be signed in to change notification settings - Fork 22
Description
In #470 a test failure was encountered due to the GitHub API limit being nearly reached. The tests themselves didn't trigger this locally so I suspect the API limit is shared by other test runners.
Multisite Download Commands
✘ Download command works
│
│ Failed asserting that '\n
│ ✘ You have nearly reached your rate limit (60/hour) for the GitHub API and it is estimated that the amount remaining will not be enough to complete this operation. Your quota will reset at 2025-10-02 08:06:35 GMT+0000.\n
│ ℹ The GitHub API rate limit is 60/hour for anonymous use. You can increase this by using a token. See the help or wiki for more information.\n
│ \n
│ ' matches PCRE pattern "/'bamboo' ([\w\s.\W]*) was downloaded into '/app/multisite/sites/multi_two/layouts/bamboo'/".
│
│ /app/tests/multisite/MultisiteDownloadCommandsTest.php:44
│
This may be a one-off but it could happen again. Thoughts on how to fix this:
- Use the
GITHUB_TOKENsecret within the test. https://docs.github.com/en/actions/tutorials/authenticate-with-github_token - this gives a limit of 1000 per hour - This will need to be passed into
phpunitvia an environment variable.
# Runs PHPUnit tests.
- name: PHPUnit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd $GITHUB_WORKSPACE
lando run-tests foreach (getenv() as $settingKey => $settingValue) {
if ($settingKey == 'GH_TOKEN') {
$token = $settingValue;
}
} However, the check needs to either use a different one locally or not use a token locally.