Skip to content

Ngrok parallel tunnel support for parallel tests - #270

Open
mishautkin wants to merge 2 commits into
mainfrom
feature/ngrok-for-parallel-tests
Open

Ngrok parallel tunnel support for parallel tests#270
mishautkin wants to merge 2 commits into
mainfrom
feature/ngrok-for-parallel-tests

Conversation

@mishautkin

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature.


What is the current behavior? (You can also link to an open issue here)

The ngrok used a single fixed domain, so parallel matrix jobs sharing that domain collided with ERR_NGROK_334. WordPress also wasn't aware that the forwarded requests were HTTPS.


What is the new behavior (if this is a feature change)?

By default the tunnel starts with no domain, so each job gets a random URL that is parallel-safe. An optionalc reserved NGROK_DOMAIN still can be used when set. NGROK_ENABLED allows to skip ngrok for jobs that don't require it. The forwarded port is taken from .wp-env.json testsPort, and an mu-plugin trusts X-Forwarded-Proto so WordPress treats tunnelled requests as HTTPS.


Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No.


Security impact

Requires NGROK_AUTH_TOKEN as a secret; the tunnel steps are skipped when it's unset. While active, the tunnel exposes the test WordPress instance on a public URL for the duration of the run.

@mishautkin
mishautkin requested review from a team and Biont August 13, 2026 10:49
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
if: ${{ inputs.NGROK_ENABLED && env.NGROK_AUTH_TOKEN != '' }}
run: |
npx wp-env run tests-cli wp eval '

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"How many commands should we chain? - @mishautkin: "Yes!" 😆

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.

3 participants