Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully initialize global state in tests by calling apply_options #2117

Merged
merged 1 commit into from
May 31, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented May 31, 2024

As stated in this comment: #1926 (comment) A global state is not fully initialized without apply_options being called, which the current with_server test helper does not do.

This means that when tests are being run, detections around things like test library are not performed, which can yield unexpected results to developers, especially addon authors.

This commit changes the with_server test helper to call apply_options.

As stated in this comment: #1926 (comment)
A global state is not fully initialized without `apply_options` being called,
which the current `with_server` test helper does not do.

This means that when tests are being run, detections around things like
test library are not performed, which can yield unexpected results to
developers, especially addon authors.

This commit changes the `with_server` test helper to call `apply_options`.
@st0012 st0012 added bugfix This PR will fix an existing bug addons Tasks related to Ruby LSP addons server This pull request should be included in the server gem's release notes labels May 31, 2024
@st0012 st0012 self-assigned this May 31, 2024
@st0012 st0012 requested a review from a team as a code owner May 31, 2024 20:45
@st0012 st0012 requested review from andyw8 and vinistock May 31, 2024 20:45
@st0012 st0012 merged commit cad8b88 into main May 31, 2024
36 checks passed
@st0012 st0012 deleted the fully-initialize-global-state-in-tests branch May 31, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Tasks related to Ruby LSP addons bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants