Skip to content

test(regex): Support environments without RE2#44484

Open
zharinov wants to merge 4 commits into
renovatebot:mainfrom
zharinov:agent/support-environments-without-re2
Open

test(regex): Support environments without RE2#44484
zharinov wants to merge 4 commits into
renovatebot:mainfrom
zharinov:agent/support-environments-without-re2

Conversation

@zharinov

@zharinov zharinov commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Changes

Renovate already falls back to JavaScript's RegExp when the native RE2 addon is unavailable. The regex spec bypasses that loader by importing re2 at module load, so runtimes with an incompatible native ABI fail before the fallback can be tested.

This PR makes the spec follow the production loader's behavior:

  • Skip the RE2-specific test group when regexEngineStatus reports that RE2 is unavailable.
  • Import re2 lazily so skipped runtimes never load the incompatible native addon.
  • Keep the mocked load-failure test deterministic when RENOVATE_X_IGNORE_RE2 is set externally.

This changes no production behavior. Under Bun, the RE2-specific assertions are skipped while the remaining regex and fallback tests continue to run.

Context

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

GPT-5.6 Sol implemented the test compatibility change.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository: N/A

@zharinov zharinov marked this pull request as ready for review July 10, 2026 17:49
@github-actions github-actions Bot requested a review from viceice July 10, 2026 17:49
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.

2 participants