Skip to content

Tests fail due to GitHub API limit #471

@yorkshire-pudding

Description

@yorkshire-pudding

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:

      # 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions